Debugging two applications in different flash sectors?

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

Posts: 10
Joined: Fri Jul 07, 2017 8:48 pm

Debugging two applications in different flash sectors?

Postby mihooper » Sat Oct 12, 2019 5:31 pm

I am attempting to write a flasher application that runs in STM32 segment 2. My main application runs in segment 5. In the main application I have pre-loaded segment 6 with a new application image. I now want to jump to segment 2 and have the flasher application reprogram the image stored in segment 6 into segment 5, then do a system restart, so that a new version of the main application runs.

So, I am attempting to use the same process as outlined in the document ... Cortex.pdf
but seem to be doing something wrong.

Here is my debugger script:

Code: Select all

# Default GDB command file (FLASH) for SEGGER J-LINK and STMicroelectronics STM32F765VI microcontroller.

# Set character encoding
set host-charset CP1252
set target-charset CP1252

# Set JTAG speed to 30 kHz
monitor speed 30

# Set GDBServer to little endian
monitor endian little

# Reset the chip to get to a known state.
monitor reset

# Set auto JTAG speed
monitor speed auto

set remote memory-write-packet-size 1024
set remote memory-write-packet-size fixed

# Enable flash download
monitor flash download = 1

#Load the Flasher applicaton
file ../Flasher/Debug/STS-Flasher-V1.0.elf

# Load the program executable
file ../STS-170-COMBO-765VI/Debug/STS-RAMP-V3.0.elf

#Add debug symbol information from the bootloader (start of .text section)   
add-symbol-file ./Debug/Flasher.elf 0x080101f8

# Reset the chip to get to a known state. Remove "monitor reset" command
#  if the code is not located at default address and does not run by reset.
#monitor reset

# Set a breakpoint at main().
tbreak flasher_main
tbreak main

# Run to the breakpoint.

The applicatiosn seem to load, and stop at the main application breakpoint. But the main app does not run.

Any guidance would be appreciated....
Mike H

Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 4 guests