Skip to main content
Stephen28
Associate III
May 19, 2019
Question

CubeIDE Debug Application with BootLoader

  • May 19, 2019
  • 4 replies
  • 4149 views

I am porting over an application from SystemWorkbench to CubeIDE. This application has a bootloader and application. The application is loaded at 0x08008000. With SystemWorkbench I added a linker flag of -nmagic, but in CubeIDE that throws an error. When I try to debug the app, it breaks at an address inside the bootloader memory space and gets stuck there, never reaching the application at 0x08008000. Can someone point me to some documentation on how to make this work?

Thanks.

4 replies

Tesla DeLorean
Guru
May 19, 2019

While this gets added to the list, consider if you can just change the PC in the debugger to App ResetHandler, make the loader startup vector straight to the app SP/PC, or code a simple debugger script to make it happen.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Ethan HUANG
ST Employee
May 27, 2019

​Hi Stephen,

I happened to write a document of this topic last week for a local workshop:

https://github.com/ethanhuanginst/STM32CubeIDE-Workshop-2019/tree/master/hands-on/09_BOOT-APP

In short, to make your application (starting from 0x08008000), the process is pretty straightforward as long as FLASH ORIGIN in linker script and VECT_TAB_OFFSET in system_stm32xxxx.c are managed well.

To debug the application, you have the following two options which are also described in the same document. Those are mostly what Clive mentioned in previous thread.

  • Running Debug Session of BOOT.elf with Breakpoints in APP.elf
  • Running Debug Session of APP.elf with Breakpoints in BOOT.elf

JMerr.2
Associate
June 28, 2024

Thank you for the very clear and concise document.  It saved me quite a  bit of effort!

CLe.1
Visitor II
July 2, 2021

Found issue with st-link, use openOCD instead

Associate
June 18, 2024

......issue like this?.......

Error in final launch sequence:

Failed to execute MI command:
add -symbol -file E:\Projects\Test Area\Prova_Led\Debug\Prova_Led.elf 0x080080bc
Error message from debugger back end:
Ambiguous command "add -symbol -file E:\Projects\Test Area\Prova_Led\Debug\Prova_Led.elf 0x080080bc": add-auto-load-safe-path, add-auto-load-scripts-directory, add-inferior, add-symbol-file.