Hello,
I am trying to use JLink to program the "USER_PAGE" of an Atmel chip (ATSAML21J18 ).
This USER_PAGE is a flash sector (256 bytes) that defines, among others, the size of the bootloader that I need to flash on this chip.
I can correctly connect and read memory at this sector and write does not give me an error, however the memory is not programmed...
Connecting to J-Link via USB...O.K.
Firmware: J-Link V9 compiled Mar 29 2016 18:46:37
Hardware version: V9.30
S/N: 59XXXX50
License(s): GDB
VTref = 2.731V
[...]
Device "ATSAMD20J18" selected.
Found SWD-DP with ID 0x0BC11477
Found SWD-DP with ID 0x0BC11477
Found Cortex-M0 r0p1, Little endian.
[...]
J-Link>mem32 0x00804000 2
00804000 = B11E86FB FFFFF8BB
J-Link>w4 0x00804000 0xB11E86FF
Writing B11E86FF -> 00804000
J-Link>mem32 0x00804000 2
00804000 = B11E86FB FFFFF8BB
I tried writing one byte at a time, 16bits word, 32 bits, nothing works.
I also even try to write an hex file of the sector and load it on the flash :
J-Link>loadfile C:\Users\Me\Atmel\USER_PAGE.hex 0
Connection to device lost. Trying to reconnect to target.
Found SWD-DP with ID 0x0BC11477
Downloading file [C:\Users\Me\Atmel\USER_PAGE.hex]...
**************************
WARNING: CPU is running at low speed (5310 kHz).
**************************
J-Link: Flash download: Flash programming performed for 1 range (256 bytes)
J-Link: Flash download: Total time needed: 0.080s (Prepare: 0.069s, Compare: 0.001s, Erase: 0.003s, Program: 0.001s, Verify: 0.000s, Restore: 0.003s)
O.K.
J-Link>mem32 0x804000 2
00804000 = B11E86FB FFFFF8BB
Same result, and even worse, if I try to load the file again I have this:
J-Link: Flash download: Flash download skipped. Flash contents already match
O.K.
But when I read the memory again the value is not changed. I am really confused here.
I know that this memory sector has some reserved bits, could that prevent me to program this sector?
Is there any way to program only one bit of a byte using jlink?
Thank you very much for your help.
I am trying to use JLink to program the "USER_PAGE" of an Atmel chip (ATSAML21J18 ).
This USER_PAGE is a flash sector (256 bytes) that defines, among others, the size of the bootloader that I need to flash on this chip.
I can correctly connect and read memory at this sector and write does not give me an error, however the memory is not programmed...
Connecting to J-Link via USB...O.K.
Firmware: J-Link V9 compiled Mar 29 2016 18:46:37
Hardware version: V9.30
S/N: 59XXXX50
License(s): GDB
VTref = 2.731V
[...]
Device "ATSAMD20J18" selected.
Found SWD-DP with ID 0x0BC11477
Found SWD-DP with ID 0x0BC11477
Found Cortex-M0 r0p1, Little endian.
[...]
J-Link>mem32 0x00804000 2
00804000 = B11E86FB FFFFF8BB
J-Link>w4 0x00804000 0xB11E86FF
Writing B11E86FF -> 00804000
J-Link>mem32 0x00804000 2
00804000 = B11E86FB FFFFF8BB
I tried writing one byte at a time, 16bits word, 32 bits, nothing works.
I also even try to write an hex file of the sector and load it on the flash :
J-Link>loadfile C:\Users\Me\Atmel\USER_PAGE.hex 0
Connection to device lost. Trying to reconnect to target.
Found SWD-DP with ID 0x0BC11477
Downloading file [C:\Users\Me\Atmel\USER_PAGE.hex]...
**************************
WARNING: CPU is running at low speed (5310 kHz).
**************************
J-Link: Flash download: Flash programming performed for 1 range (256 bytes)
J-Link: Flash download: Total time needed: 0.080s (Prepare: 0.069s, Compare: 0.001s, Erase: 0.003s, Program: 0.001s, Verify: 0.000s, Restore: 0.003s)
O.K.
J-Link>mem32 0x804000 2
00804000 = B11E86FB FFFFF8BB
Same result, and even worse, if I try to load the file again I have this:
J-Link: Flash download: Flash download skipped. Flash contents already match
O.K.
But when I read the memory again the value is not changed. I am really confused here.
I know that this memory sector has some reserved bits, could that prevent me to program this sector?
Is there any way to program only one bit of a byte using jlink?
Thank you very much for your help.