Hi,
I need to flash an SQI flash memory (Serial Quad I/O) using the J-Link and J-Link GDB Server.
With OpenOCD and Flyswatter i can configure a work area to download an algorithm in axf format used to write into the SQI.
In the openOCD cfg file i use the following piece of script to read the binary file and write to the SQI using the axf in the work area:
Display All
My question is: How can i replicate this mechanism with J-Link and J-Link GDB Server via JTAG ?
Thanks in advance.
I need to flash an SQI flash memory (Serial Quad I/O) using the J-Link and J-Link GDB Server.
With OpenOCD and Flyswatter i can configure a work area to download an algorithm in axf format used to write into the SQI.
In the openOCD cfg file i use the following piece of script to read the binary file and write to the SQI using the axf in the work area:
Source Code
- proc loadsqi { image_file } {
- set blksize 32768
- load_image [find target/sqi_loader.axf] 0 elf
- set bin_image [find $image_file]
- set file_size [exec ls -lH $bin_image | awk "{print \$5}"]
- for {set buf_pos 0} {$buf_pos < $file_size} {set buf_pos [expr $buf_pos + $blksize]} {
- set remain [expr $file_size - $buf_pos]
- set xfer $blksize
- if {$remain < $blksize} {
- set xfer $remain
- }
- mww 0x00100ff8 $buf_pos
- mww 0x00100ffc $xfer
- load_image $bin_image 0x00101000 bin 0x00101000 $blksize $buf_pos
- reg pc 0
- reg cpsr 0xd3
- bp 0xc00 4
- resume 0
- puts ">>>>> flashing $xfer bytes at $buf_pos of $file_size ..."
- wait_halt 100
- }
- puts ">>>>> $bin_image $file_size bytes loaded"
- }
My question is: How can i replicate this mechanism with J-Link and J-Link GDB Server via JTAG ?
Thanks in advance.