2026-02-05 3:37 AM
Hi everyone,
I'm currently porting the App of STM32U5 SBSFU example to CubeMX and "smooth" is not the word I would use to describe the process.
Namely, the SBSFU example includes Bootloader, Loader and App projects with memory map being in separate centralized header files included by all these projects. These files (region_defs and flash_layout) are not fully polished (some bugginess and inconsistencies) but they do ease the memory management a lot by using defines and not hardcoding; these defines are then used in projects' linker files in order to define memory regions.
In contrast, CubeMX just provides a UI representation of the memory space where users can input all the memory bounds, be it flash or RAM. The trouble is, we can only enter numbers and not constants, so generated code is full of hardcoded address bounds.
This does not play well with SBSFU Example - since these address bounds are not only used in LD files, but rather for defining FLASH areas, SAU regions etc etc, it is an enormous amount of work to get this synchronized.
My suggestion that would dramatically improve productivity here:
Add support for using constants in UI memory map tool in CubeMX: since we can even set these constants in CubeMX, you could even implement a sanity check when generating. Although I've already seen that sanity checks are not a strong side of CubeMX (e.g. unbuildable projects are generated out-of-the-box), at least for trustzone Apps, there are ALWAYS changes needed to BSP after the generation, which implies users are already used to this and are expecting it :)
Anyway, would love to know if anyone has similar issues as well and finds this a good idea?
Cheers!
Ivan
2026-02-05 4:25 AM
Hello @ikozic
I'm currently checking your request. I will get back to you asap.
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.