Debug microprocessor program without compiling everything with TrueStudio

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

mbr
Posts: 10
Joined: Fri Sep 14, 2018 8:53 am

Debug microprocessor program without compiling everything with TrueStudio

Postby mbr » Mon Mar 04, 2019 4:19 pm

Hello,

we're using an STM32F4 with a bootloader in the µP flash starting our application code by some branch command (which is written into the flash by some external update program). Since obviously our application code is not started, we need to debug this branch command.

Does anybody know of a way to step trough the µP instructions? I know how to do it when I have the whole sources and compile everything using TrueStudio. But how to do it if the only thing that I have is the processor's flash memory dump? Is there a way to do it using TrueStudio? Or is the only way to run the gdb binary directly (from console) on the memory dump? If so, does anybody know how to configure the connection to the debugger (we're using ST-Link v2) in this case?

Kind regards,

Markus

frank_ee
Posts: 89
Joined: Wed Apr 05, 2017 5:08 pm
Location: USA

Re: Debug microprocessor program without compiling everything with TrueStudio

Postby frank_ee » Wed Mar 06, 2019 9:54 pm

Hello,

I am also using the STM32F4 and understand your problem. Do you have the disassembly of the bootloader program? Application not starting can be due to many reasons. The bootloader should jump to the reset vector which has to be relocated in the flash memory. The boot pins of the STM32F4 need to properly set. Are you using an RTOS?

mbr
Posts: 10
Joined: Fri Sep 14, 2018 8:53 am

Re: Debug microprocessor program without compiling everything with TrueStudio

Postby mbr » Thu Mar 07, 2019 7:26 am

Hello Frank,
thanks for responding!
Meanwhile I've managed to get the boot mechanism running - it was only that the addresses for application stack pointer and the jump from bootloader to application had been incorrectly set. Also, I needed to set VTOR to the start address of the application (vector table).
Boot pins were set correctly.

I figured out the correct jump addresses by creating a new program for STM32F4 which I could debug.

Still, it would be interesting (for future cases) if there's a possibility to e.g. use the Atollic GDB to step through the program in STM32F4 flash when having only the hex file of the bootloader (not containing the jump addresses) and the memory dump of the flash after the jump addresses have been set by some external (update) program.
We're not using an RTOS.

Kind regards,

Markus

frank_ee
Posts: 89
Joined: Wed Apr 05, 2017 5:08 pm
Location: USA

Re: Debug microprocessor program without compiling everything with TrueStudio

Postby frank_ee » Thu Mar 07, 2019 4:59 pm

Hello Markus,

Do you plan on updating the application firmware image also? For the hex file, it will not be possible to debug this, but what does the memory contents show?

Regards,

Frank

mbr
Posts: 10
Joined: Fri Sep 14, 2018 8:53 am

Re: Debug microprocessor program without compiling everything with TrueStudio

Postby mbr » Fri Mar 08, 2019 9:09 am

Hello Frank,

we're using the bootloader to start or update (overwrite) the application.

Thanks for your ideas!

Since my issue is solved, I will now close the thread.

Kind regards,

Markus


Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 1 guest