Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve linker scripts for multi-project setup (multi-processor, boot/app, secure/non-secure) #1828

Open
ReinhardKeil opened this issue Oct 29, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ReinhardKeil
Copy link
Collaborator

The Problem To Be Solved

It is complex to manage the memory resources across a multi-project system.

The CMSIS-Toolbox contains a flexible linker script management. There should be best-practice examples that show the usage.

One way outlined in the picture below is the usage of a central regions header file (that could be also generated by tools such as CMSIS-Zone). Using #define statements the preprocessor step should be able to extract the information for each project. The benefit is that generic linker scripts would still work. As the CMSIS-Toolbox provides this for each compiler toolchain, the project templates could be toolchain agnostic. Such template projects may be provided as part of a DFP or BSP and can be therefore contain a device or board specific setup.

image

A benefit of a regions header file is that it can be also directly used by C/C++ source files.

@ReinhardKeil ReinhardKeil added the enhancement New feature or request label Oct 29, 2024
@TeoMahnic
Copy link

I have created a mock-up multi-project example available here: https://github.com/TeoMahnic/multi-project
It has a global_regions.h file, which describes total device memory available and how it is split/partitioned between the projects A and B. In order to keep the global regions file as simple as possible, glue logic necessary for preprocessor step was moved to the check_regions.h (this could eventually also be handled by a tool/script). The projects include a modified AC6 linker script template (based on the one provided by CMSIS-Toolbox), which includes additional guards for startup, heap and stack.

@ReinhardKeil
Copy link
Collaborator Author

Implementation is now covered under Experimental Features #1867.

Leaving this issue open to collect feedback on the proposal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants