How can I implement an external loader for SMTCubeIDE?
- November 22, 2019
- 2 replies
- 4312 views
Hello
I'm developing an application with an STM32F750Z8 and I need to put the code in the external flash and then debug it.
I tried to implement the firmware:
1) I created the Launcher with STMCubeIDE and STMCubeMX and programmed the microcontroller with them. This application perform only a jump and a led blink if enter in HardFault.
You can find the Launcher in attached (is with IAR because is a old project but there should not be any problems or differences).
2) I implemented FlashLoader, following the guide https://www.st.com/content/ccc/resource/technical/document/user_manual/e6/10/d8/80/d6/1d/4a/f2/CD00262073.pdf/files/CD00262073.pdf/jcr:content/translations/en.CD00262073.pdf at 3.9 chapter and based on the example in N25Q512A_STM32F769I-EVAL path of STM32 ST-LINK Utility/ST-LINK Utility/ExternalLoader directory (inside STMCubeIDE directory there are no examples for STM32F7): I created the FlashLoader with STMCubeIDE and configured the STM32F750Z8 (it's microcontroller for my application) with STMCubeMX; I added the files in N25Q512A_STM32F769I-EVAL, added my custom library for QSPI (the QSPI.c and QSPI.h files) and all the HAL libraries necessary and set the proper linker file (Target.ld).
I compiled, modified the extension of "elf" file in "stldr" and I moved this file in ExternalLoader directory of STMCubeIDE.
You can find the FlashLoader in attached.
Step3) I implemented an empty application with STMCubeIDE and STMCubeMX and tried to change "External loader" in Debug Configuration -> Debugger.
First of all the file that I copied in 2) doesn't appeare when I click Scan. If I insert manually the name of "stldr" file, the debug starts (I'm using ST-LINK V2) but is not able to debug code and indicates "Break at address "0x8001e9a" with no debug information available, or outside of program code."
In attached you can find a screenshot and application.
What can be my problem/error?
Why the ST-LINK V2 can't debug code?
Are there any templates or step-by-step guides for build a custom flash loader for STMCubeIDE?
Thanks in advance.