What special requirements does ST-LINK_gdbserver place on an external flash loader? My loader works with ST-Link Utility, STM32CubeProgrammer, but not ST-LINK_gdbserver.
- November 26, 2020
- 2 replies
- 1571 views
I've written an External Flash Loader and successfully tested erase, read, and write functionality first in my own firmware, then with ST-Link Utility v4.5.0, and also with STMCubeProgrammer v2.6.0.
However, when I try to use it to debug with TrueStudio, or simply with ST-LINK_gdbserver, I can not get past the loader's Init() so I'm unable to successfully connect to my system.
I initially had the problem when trying to debug with TrueStudio and selecting the external loader gave me the dreaded "Failed to initialize external memory!" error so I got TrueStudio out of the way and tried to work directly with ST-LINK_gdbserver instead.
- I'm using -el to tell GDB server where the .stldr file is.
- If Init() function does nothing but return 1, ST-LINK_gdbserver will start.
- If Init() function initializes clocks and peripherals (GPIO, OCTOSPI) and then returns 1, ST-LINK_gdbserver will start.
- If Init() tries to use GPIOs to indicate progress with LEDs or tries to use the OCTOSPI to configure the flash memory, even if my OCTOSPI init function only contains a return statement, ST-LINK_gdbserver fails to start.
Since I can use the memory and the external loader with other tools, I'm led to thinking that ST-LINK_gdbserver needs something specific from the external loader, or that it places some restrictions on it that my loader is not meeting.
Can anyone advise me on either how I should be configuring ST-LINK_gdbserver or how I should to change my loader to be able to debug my application?
Additional info:
- MCU is STM32L4S9xx
- Flash memory is W25Q128JV
- Debug log is attached
