Open-CMSIS-Pack / devtools

Open-CMSIS-Pack development tools - C++
Apache License 2.0
74 stars 57 forks source link

Generated `regions.h` and linker scripts are not aligned #1718

Closed ReinhardKeil closed 1 month ago

ReinhardKeil commented 2 months ago

Describe the problem

The CMSIS-Toolbox auto-generates regions.h files and provides linker scripts in the etc directory as described here: https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/build-overview.md#linker-script-management

However the two files are not aligned. The problems are:

It is unclear how RAM_INIT should be handled by a linker script itself.

To Reproduce See https://github.com/Open-CMSIS-Pack/STM32F746G-DISCO_BSP/tree/main/Layers/IoT/RTE/Device/STM32F746NGHx

Suggested behavior

Changes to auto-generated regions.h:

Once the files are generated/imported to the project they are under user control. Therefore the suggested behavior has acceptable user impact.

Environment (please complete the following information):

Additional context It is unclear if and how init should be handled in linker scripts.

IMHO, there should be a resource management added to CMSIS-Toolbox that can deal with multi-core systems and applications that require bootloader/application/secure enclave.

ReinhardKeil commented 2 months ago

Proposed changes:

DONE ALREADY: 1. Remove the defines HEAP and STACK from the linker script templates (as they are also in the regions.h files).

  1. regions.h file example: regions_B-U585I-IOT02A.h.txt. Changes are:
    • Always 4 regions for ROM and RAM generated.
    • Resources are combined when (a) same access, (b) same pack, (c) directly after each other. Example see RAM0 region.
    • Resources that have default 0 or a different Pname then the current project are under "Resources that are not allocated to linker regions".
    • Comment text uses less lines, adds 'access' information from PDSC

This is how it looks in Config Wizard view image