Running bootloader + application solution
Hi
Has anybpdy found a solution for the OP’s problem?
My current workflow is:
1 Code and debug the application
2. Relocate the application 16 pages higher in flash by editing STM32F103C8Tx_FLASH.ld and Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c
to get space for the bootloader and then build again
3. Erase the flash with external tool (qstlink)
4. Apply the bootloader (another project) by means of the debugger
5. Load the application.bin by meams of the bootloader via DFU
It should be possible to load the application with ac6 -> openocd to the production offset address while keeping the bootloader starting at 0x8000000.
I even tried to use a modified copy of target/stm32f1x.cfg in my USER-OPENOCD.cfg file. But openocd ignores the modified base address (0x8004000) given to the “flash bank” command and uses default 0x8000000.
The bootloader gets destroyed this way.
The debugger setup in ac6 can only use application.elf. Maybe thats the key. Openocd is called with “-c program ...”.
Command: program filename verify reset exit offset
From openocd docu:
# program and verify using elf/hex/s19. verify and reset # are optional parameters openocd -f board/stm32f3discovery.cfg \ -c "program filename.elf verify reset exit" # binary files need the flash address passing openocd -f board/stm32f3discovery.cfg \ -c "program filename.bin exit 0x08000000"
If possible one could make a Release setup in ac6 and then deploy application.bin to the right offset address.
The string “verify exit reset” can be found in ac6 only in binary file ..../debug/launching/MCUGdbLaunch.class
Dieter