Using stmqspi Driver in OpenOCD to Program External Flash with GDB

0

In the past I've used OpenOCD to program STM32 MCUs. It's been fairly simple, I launch OpenOCD and GDB and use the load command to dump my .elf file into internal flash memory. This has been working fine, no problem.

Now I'm trying to do the same thing with an external flash connected via QSPI. I'm using the STM32H750 Discovery board to test this with.

I have cloned OpenOCD from the master branch and applied the following patch:

http://openocd.zylin.com/#/c/4321/

I am using the OpenOCD configuration files provided by the patch. However when I execute the load command this is the output:

target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Loading section .vectors, size 0x2a0 lma 0x90000000
Load failed

When I look at the log output from OpenOCD, this is what it says:

Debug: gdb_server.c:3265 gdb_input_inner(): received packet: 'X90000000,0:<binary-data>'
Debug: gdb_server.c:3265 gdb_input_inner(): received packet: 'X90000000,2a0:<binary-data>'
Debug: gdb_server.c:1596 gdb_write_memory_binary_packet(): addr: 0x90000000, len: 0x000002a0
Debug: target.c:2341 target_write_buffer(): writing buffer of 672 byte at 0x90000000
Debug: hla_target.c:784 adapter_write_memory(): adapter_write_memory 0x90000000 4 168
Debug: stlink_usb.c:758 stlink_usb_error_check(): STLINK_SWD_AP_FAULT
Debug: gdb_server.c:3265 gdb_input_inner(): received packet: 'X900002a0,c:<binary-data>'
Debug: gdb_server.c:1415 gdb_error(): Reporting -4 to GDB as generic error
Debug: gdb_server.c:1596 gdb_write_memory_binary_packet(): addr: 0x900002a0, len: 0x0000000c
Debug: target.c:2341 target_write_buffer(): writing buffer of 12 byte at 0x900002a0
Debug: hla_target.c:784 adapter_write_memory(): adapter_write_memory 0x900002a0 4 3
Debug: stlink_usb.c:758 stlink_usb_error_check(): STLINK_SWD_AP_FAULT

However, using the load command to flash to internal flash memory works fine.

Has anyone here used the stmqspi driver to program external flash memory before? Could you provide me with some insight on how to go about doing this? Thank you.

debugging
gdb
stm32
openocd
asked on Stack Overflow Jun 26, 2020 by cDreamer

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0