Hi all, I've got a project using Atmel's SAM3S8B I've just found about SAM4S and cortex-M4 and I chose SAM4S8B to migrate to.
But I've got no result after a few days of trying to port the project. The debug boards are designed by myself and was working for SAM3S with no problem. Sam4s series are PIN to PIN compatible with SAM3s
Questions: I was positive even the SAM3S binary file(X.bin output of fromelf.exe) will be downloaded to SAM4S and run with no problem but it won't! Is there any problem with the hardware or the binary should be compiled for SAM4S?
Trying to debug the SAM4S configured project: The software runs, SPI works, IO is ok but trying to write to internal flash fails! The behavior is: after copying the buffer to the address of internal flash in order to call IAP for writing to occur, checking the content of that address shows only 0xFF values. calling IAP function with Clear Lock Bit command before coping to buffer and calling IAP with Erase with program function succeeds returning 1 as the status. even trying to copy a piece of memory to a local buffer in the same function which calls IAP gives the same result. The destination buffer is full of oxFF. making the buffer global solved this issue. but I still can't copy to internal flash buffer and perform IAP
That issue is resolved by myself. I specify the differences for other people with the same problem.
1. The PLL multipliers had a constraint specified in the datasheet. Atmel SAM3S has a constraint that the multiplier must not be bigger than 36 while reserving 11 bits for it. Atmel SAM4s had the same constraint but with a bigger range (between 7 & 62)
The multiplier I was using was out of range for both chips and it was causing problem for USB clock in SAM4S while surprisingly it was working fine in SAM3S which had the smaller range compared to SAM4S.
2. The Embedded flash module of SAM4S is totally different with SAM3S read datasheets for detailed information.
I'm surprised how Atmel can claim software & hardware compatibility between SAM3S and SAM4S series causing this much problem for developers. There is also no such information in the migration guide provided by Atmel as well.
Yes, that is the key!!
"I'm surprised how Atmel can claim software & hardware compatibility"
What, exactly, do they actually claim?
"software compatibility" doesn't usually mean that you can take the binary from one, and expect it to "just work" on the other - that would be called "binary compatibility"
If you feel that you have been misled by Atmel, then you should contact Atmel directly about that.
If you have complaints about Atmel's documentation, then you should contact Atmel directly about that.