I need to program the User Signature Area on SAM4E (store production data, serial number, calibration, etc.)
I found this thread with a person requesting writing the user signature area on a different SAM4 MCU, but there is no reply and the thread is 3 years old:
forum.segger.com/index.php/Thr…e-programming-via-J-Link/
I have written a Flash Loader (ramcode/applet) and included it in JLinkDevices.xml. I can erase the User Signature area using J-Link commander:
I can write to the User Signature Area (which includes read/verify):
And if I try to program again, the section gets skipped, because it already matches:
And immediately after programming I can read back the user signature area:
Unfortunately, if i exit the JLink commander session and start a new one, I cannot read out the user signature area:
Because the User Signature Area is not memory mapped, I have implemented a native read function. But it seems the ramcode/applet is not loaded or used when calling savebin.
Reading works fine in J-Flash (manual > read-back > range...):
Unfortunately, I really need to call this from a script, so using Jlink Commander would be ideal.
Can anyone suggest a method to read out the user signature using Jlink Commander?
Best regards,
Mikkel Holm Olsen
I found this thread with a person requesting writing the user signature area on a different SAM4 MCU, but there is no reply and the thread is 3 years old:
forum.segger.com/index.php/Thr…e-programming-via-J-Link/
I have written a Flash Loader (ramcode/applet) and included it in JLinkDevices.xml. I can erase the User Signature area using J-Link commander:
Source Code
- J-Link>exec EnableEraseAllFlashBanks
- J-Link>erase 0x00C00000 0x00C001FF
- Erasing selected range...
- J-Link: Flash download: Total time needed: 0.129s (Prepare: 0.018s, Compare: 0.000s, Erase: 0.065s, Program: 0.000s, Ver
- ify: 0.000s, Restore: 0.046s)
- J-Link: Flash download:
- Flash sectors within Range [0x00C00000 - 0x00C001FF] deleted.
- Erasing done.
I can write to the User Signature Area (which includes read/verify):
Source Code
- J-Link>loadfile c:\test\usig_src.bin 0x00C00000
- Downloading file [c:\test\usig_src.bin]...
- J-Link: Flash download: Bank 1 @ 0x00C00000: 1 range affected (512 bytes)
- J-Link: Flash download: Total: 0.211s (Prepare: 0.030s, Compare: 0.052s, Erase: 0.027s, Program: 0.030s, Verify: 0.024s,
- Restore: 0.046s)
- J-Link: Flash download: Program speed: 17 KB/s
- O.K.
Reading works fine in J-Flash (manual > read-back > range...):
Source Code
- Reading target memory (0x00C00000 - 0x00C001FF) ...
- - Start of determining flash info (Bank 1 @ 0x00C00000)
- - End of determining flash info
- - Flash bank info:
- - 1 * 512 bytes @ 0x00C00000
- - Start of preparing flash programming
- - End of preparing flash programming
- - Start of restoring
- - End of restoring
- - Target memory read successfully. (512 bytes, 1 range) - Completed after 0.165 sec
Can anyone suggest a method to read out the user signature using Jlink Commander?
Best regards,
Mikkel Holm Olsen