Hi
I'm trying to write flash in AT91SAM7S256 target using J-link and Embedded Studio. When i has used default configuration I have result as bellow - it always fails for different reasons.
I tested device using testwspeed command in J-Link Commander and i can write succesfully data into SRAM space but not into flash.
But when I configured target using "w4" command (disable watchdog and change MCK to 10MHz from PLL), Flash has been also succesfully written.
I also tried to connect with target using J-Flash and it also works - It can reset, halt and write default registers.
My question: when in my projet (in Embedded Studio) i can add this actions (write some registers) to run it before writting into flash? Is .jlinkscript file correct place to do this?
Unfortunatly i can't found any documentation describing this script.
br/
Ryszard
Logs from Segger Embedded Studio:
Display All
Another fail:
Display All
Edit:
Now I'm confused. I see that if I every time execute power sequence (power off, power on, reset), then I can always succesfully run testwspeed on flash memory, but erase and loadfile never run without errors. (hex file I got from Embedded Studio). Due to problem with erase command I'm not now sure that is problem with configuration in Studio. Another question why addres 0x00200000 is used - it is a SRAM space, not flash in this target.
I'm trying to write flash in AT91SAM7S256 target using J-link and Embedded Studio. When i has used default configuration I have result as bellow - it always fails for different reasons.
I tested device using testwspeed command in J-Link Commander and i can write succesfully data into SRAM space but not into flash.
But when I configured target using "w4" command (disable watchdog and change MCK to 10MHz from PLL), Flash has been also succesfully written.
I also tried to connect with target using J-Flash and it also works - It can reset, halt and write default registers.
My question: when in my projet (in Embedded Studio) i can add this actions (write some registers) to run it before writting into flash? Is .jlinkscript file correct place to do this?
Unfortunatly i can't found any documentation describing this script.
br/
Ryszard
Logs from Segger Embedded Studio:
Source Code
- Connecting ‘J-Link’
- Connecting to target adapter
- Loaded C:\Program Files (x86)\SEGGER\JLink_V510m\JLinkARM.dll
- Firmware Version: J-Link V9 compiled Feb 2 2016 18:43:46
- DLL Version: 5.10m
- Hardware Version: V9.30
- Target Voltage: 3.309
- Device "AT91SAM7S256" selected.
- TotalIRLen = 4, IRPrint = 0x01
- Identifying
- ARM7TDMI (0x3F0F0F0F)
- CPU is not halted
- Preparing target for download
- Executing script TargetInterface.resetAndStop(1000)
- Using DBGRQ to halt CPU
- Resetting TRST in order to halt CPU
- Failed to halt CPU core before Reset (SAM7).
- Resetting target using RESET pin
- TotalIRLen = 4, IRPrint = 0x01
- Halting CPU core
- Using DBGRQ to halt CPU
- Resetting TRST in order to halt CPU
- Resetting target using RESET pin
- TotalIRLen = 4, IRPrint = 0x01
- Halting CPU core
- Using DBGRQ to halt CPU
- Resetting TRST in order to halt CPU
- Unable to halt CPU core
- Can not read register 0 (R0) while CPU is running
- Can not read register 1 (R1) while CPU is running
- Can not read register 2 (R2) while CPU is running
- Can not read register 3 (R3) while CPU is running
- Can not read register 4 (R4) while CPU is running
- Can not read register 5 (R5) while CPU is running
- Can not read register 6 (R6) while CPU is running
- Can not read register 7 (R7) while CPU is running
- Can not read register 10 (R8_USR) while CPU is running
- Can not read register 11 (R9_USR) while CPU is running
- Can not read register 12 (R10_USR) while CPU is running
- Can not read register 13 (R11_USR) while CPU is running
- Can not read register 14 (R12_USR) while CPU is running
- Can not read register 15 (R13_USR) while CPU is running
- Can not read register 16 (R14_USR) while CPU is running
- Can not read register 9 (R15 (PC)) while CPU is running
- Can not read register 8 (CPSR) while CPU is running
- Can not read register 18 (R8_FIQ) while CPU is running
- Can not read register 19 (R9_FIQ) while CPU is running
- Can not read register 20 (R10_FIQ) while CPU is running
- Can not read register 21 (R11_FIQ) while CPU is running
- Can not read register 22 (R12_FIQ) while CPU is running
- Can not read register 23 (R13_FIQ) while CPU is running
- Can not read register 24 (R14_FIQ) while CPU is running
- Can not read register 17 (SPSR_FIQ) while CPU is running
- Can not read register 26 (R13_SVC) while CPU is running
- Can not read register 27 (R14_SVC) while CPU is running
- Can not read register 25 (SPSR_SVC) while CPU is running
- Can not read register 29 (R13_ABT) while CPU is running
- Can not read register 30 (R14_ABT) while CPU is running
- Can not read register 28 (SPSR_ABT) while CPU is running
- Can not read register 32 (R13_IRQ) while CPU is running
- Can not read register 33 (R14_IRQ) while CPU is running
- Can not read register 31 (SPSR_IRQ) while CPU is running
- Can not read register 35 (R13_UND) while CPU is running
- Can not read register 36 (R14_UND) while CPU is running
- Can not read register 34 (SPSR_UND) while CPU is running
- Erasing all memory
- Erase successful
- Programming
- Programming 0.0 KB of .vectors addresses 00100000 — 0010003b
- Programming 0.6 KB of .init addresses 0010003c — 001002af
- Programming 0.3 KB of .text addresses 001002b0 — 001003f3
- Failed to measure CPU clock frequency
- Can not read register 0 (R0) while CPU is running
- Can not read register 1 (R1) while CPU is running
- Can not read register 2 (R2) while CPU is running
- Can not read register 3 (R3) while CPU is running
- Can not read register 4 (R4) while CPU is running
- Can not read register 5 (R5) while CPU is running
- Can not read register 6 (R6) while CPU is running
- Can not read register 7 (R7) while CPU is running
- Can not read register 10 (R8_USR) while CPU is running
- Can not read register 11 (R9_USR) while CPU is running
- Can not read register 12 (R10_USR) while CPU is running
- Can not read register 13 (R11_USR) while CPU is running
- Can not read register 14 (R12_USR) while CPU is running
- Can not read register 15 (R13_USR) while CPU is running
- Can not read register 16 (R14_USR) while CPU is running
- Can not read register 9 (R15 (PC)) while CPU is running
- Can not read register 8 (CPSR) while CPU is running
- Can not read register 30 (R14_ABT) while CPU is running
- Can not read register 28 (SPSR_
- Failed to download application.
- Generic error.
- Please check J-Link and target connection.
- Programming completed in 1.1 s — 0 bytes/sec
- CPU is not halted
Another fail:
Source Code
- Connecting ‘J-Link’
- Connecting to target adapter
- Loaded C:\Program Files (x86)\SEGGER\JLink_V510m\JLinkARM.dll
- Firmware Version: J-Link V9 compiled Feb 2 2016 18:43:46
- DLL Version: 5.10m
- Hardware Version: V9.30
- Target Voltage: 3.312
- Device "AT91SAM7S256" selected.
- TotalIRLen = 4, IRPrint = 0x01
- Identifying
- ARM7TDMI (0x3F0F0F0F)
- Preparing target for download
- Executing script TargetInterface.resetAndStop(1000)
- Programming
- Programming 0.0 KB of .vectors addresses 00100000 — 0010003b
- Programming 0.6 KB of .init addresses 0010003c — 001002af
- Programming 0.3 KB of .text addresses 001002b0 — 001003f3
- Failed to download RAMCode.
- Failed to download RAMCode!
- Write memory error @ address 0x00200000, word access: Memory access timeout.
- Could not detect CPU clock speed. Readback of test code downloaded into RAM failed.
- Failed to download application.
- Generic error.
- Please check J-Link and target connection.
- Programming completed in 5.7 s — 0 bytes/sec
- CPU is not halted
- Can not read register 0 (R0) while CPU is running
- Can not read register 1 (R1) while CPU is running
- Can not read register 2 (R2) while CPU is running
- Can not read register 3 (R3) while CPU is running
- Can not read register 4 (R4) while CPU is running
- Can not read register 5 (R5) while CPU is running
- Can not read register 6 (R6) while CPU is running
- Can not read register 7 (R7) while CPU is running
- Can not read register 10 (R8_USR) while CPU is running
- Can not read register 11 (R9_USR) while CPU is running
- Can not read register 12 (R10_USR) while CPU is running
- Can not read register 13 (R11_USR) while CPU is running
- Can not read register 14 (R12_USR) while CPU is running
- Can not read register 15 (R13_USR) while CPU is running
- Can not read register 16 (R14_USR) while CPU is running
- Can not read register 9 (R15 (PC)) while CPU is running
- Can not read register 8 (CPSR) while CPU is running
- Can not read register 18 (R8_FIQ) while CPU is running
- Can not read register 19 (R9_FIQ) while CPU is running
- Can not read register 20 (R10_FIQ) while CPU is running
- Can not read register 21 (R11_FIQ) while CPU is running
- Can not read register 22 (R12_FIQ) while CPU is running
- Can not read register 23 (R13_FIQ) while CPU is running
- Can not read register 24 (R14_FIQ) while CPU is running
- Can not read register 17 (SPSR_FIQ) while CPU is running
- Can not read register 26 (R13_SVC) while CPU is running
- Can not read register 27 (R14_SVC) while CPU is running
- Can not read register 25 (SPSR_SVC) while CPU is running
- Can not read register 29 (R13_ABT) while CPU is running
- Can not read register 30 (R14_ABT) while CPU is running
- Can not read register 28 (SPSR_ABT) while CPU is running
- Can not read register 32 (R13_IRQ) while CPU is running
- Can not read register 33 (R14_IRQ) while CPU is running
- Can not read register 31 (SPSR_IRQ) while CPU is running
- Can not read register 35 (R13_UND) while CPU is running
- Can not read register 36 (R14_UND) while CPU is running
- Can not read register 34 (SPSR_UND) while CPU is running
- CPU is not halted
Edit:
Now I'm confused. I see that if I every time execute power sequence (power off, power on, reset), then I can always succesfully run testwspeed on flash memory, but erase and loadfile never run without errors. (hex file I got from Embedded Studio). Due to problem with erase command I'm not now sure that is problem with configuration in Studio. Another question why addres 0x00200000 is used - it is a SRAM space, not flash in this target.
The post was edited 3 times, last by rgal ().