2022-07-27 09:07 AM
Hello,
I am attaching the programmer console from the IDE. It looks like both .elf are programmed in the specified region but ultimately only the one that gets loaded last persists. Does this happen because during the download of the last .elf the whole FLASH gets erased? Is there a setting to prevent that?
I have also attached screenshots of the memory regions and a screenshot of the debug configurations.
It might be useful to mention that if set the debug settings so that the start up is from the application, region 0x8008000 holds firmware and 0x8000000 is empty, which in my eyes enforces the hypothesis that flash gets wiped out before the second .elf is programmed.
Any thoughts?
Thank you!
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a56820.srec
File : ST-LINK_GDB_server_a56820.srec
Size : 4554488 Bytes
Address : 0x08008000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 2]
Erasing memory corresponding to segment 1:
Erasing external memory sectors [0 1028]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:50.620
Verifying ...
Download verified successfully
-------------------------------------------------------------------
STM32CubeProgrammer v2.8.0
-------------------------------------------------------------------
Warning: Wrong connect parameter: speed=fast
ST-LINK SN : 003D00213156501920323443
ST-LINK FW : V3J9M3B5S1
Board : STLINK-V3SET
Voltage : 3.26V
SWD freq : 24000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x450
Revision ID : Rev V
Device name : STM32H7xx
Flash size : 2 MBytes
Device type : MCU
Device CPU : Cortex-M7
BL Version : 0x90
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a56820.srec
File : ST-LINK_GDB_server_a56820.srec
Size : 21880 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sector 0
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:00.950
Verifying ...
Download verified successfully
Solved! Go to Solution.
2022-07-28 07:15 PM
Sector size is 128k bytes. Your bootloader and app must reside in different sectors, else an erase of the app will erase the bootloader too.
2022-07-28 06:40 PM
Try this:
build both projects, then load the application (don't debug or run).
Edit the launch config, uncheck build and download of the app. Only load its symbols.
Then start debugging the bootloader.
2022-07-28 07:15 PM
Sector size is 128k bytes. Your bootloader and app must reside in different sectors, else an erase of the app will erase the bootloader too.
2022-07-29 12:34 AM
THIS
2022-07-29 12:51 AM
Honestly, for a projects with bootloaders and user data storage those single size 128KB sectors on H7 are a huge waste of memory. For example, F7 has 4*32KB + 128KB + N*256KB, which is a much better fit for complex real life projects. I can have two bootloaders and two user data sectors and it takes 4*32KB = 128KB in total. On H7 the same would take 4*128KB = 512KB, which is a huge waste.
2022-07-29 08:18 AM
Yeah, this seems like the better approach for having a project you can quickly launch from the IDE and debug. Fortunately, in my case, I can spare the space.
I placed the bootloader in the same section of the app using the stm32 cube programmer as it presents an option to program without erasing, but this approach will not be convenient long-term for me.
Thanks!