Skip to main content
Andrew Neil
Super User
Jul 12, 2024 11:37 AM UTC
Question

Feature Request: "no-init" linker section

It is a common requirement to have an area of RAM that is not cleared or otherwise initialised by the startup code; eg,

https://community.st.com/t5/stm32cubeide-mcus/how-to-make-keep-ram-value-after-software-reset/m-p/96132

https://community.st.com/t5/stm32cubeide-mcus/how-to-port-no-init-iar-directive-with-to-gcc-compiler-please/m-p/661867

to mention but two.

Currently, this means making manual edits to the linker script - which get overwritten with every 'Generate'. :frowning_face:

So how about adding a "noinit section" option in the Project 'Linker Settings':

 

AndrewNeil_1-1720784015857.png

 

Or making the generated linker script have areas which will not get overwritten - as in the generated 'C' code.

 

(I've tagged this as 'Bug Report' because the forum insists on having a tag, but none of the available tags is relevant! 'Bug Report' seems the least worst.)

This topic has been closed for replies.

8 replies

Pavel A.
Jul 12, 2024 12:02 PM UTC

> Or making the generated linker script have areas which will not get overwritten

Maybe easier and faster can be to write a KB article about implementing a no-init RAM section. This not necessarily can be a piece of the "main" RAM. Some STM32s have the backup RAM, or several SRAM units that are not referenced in the "standard" link script. These can be used for no-init data as well.

 

Radosław
Associate II
Jul 12, 2024 1:06 PM UTC

I'm waiting many years to have posibility to define new section and menage them  in MX or IDE.

Pavel A.
Jul 12, 2024 1:18 PM UTC

Manage sections in a GUI? Do you mean, a GUI for GNU ld scripts? This is possible, as an Eclipse add-on.

You can propose this in the common Eclipse CDT forum, even sponsor this idea to show your motivation and support.

A simpler variant can be like the linker option dialogs in Keil MDK and IAR IDE: a couple of input fields, like ROM1, ROM2, RAM1, RAM2... address & size, with "no init" check boxes. These fields generate defined symbols prepended to a common link script with conditional ifdef's. ... and so on.

Radosław
Associate II
Jul 12, 2024 1:22 PM UTC

Done by many people In many ways,  Compatitors creates this long time ago. 

 

I have my own solution for this :D

 

Andrew Neil
Super User
Jul 12, 2024 2:05 PM UTC

@Andrew Neil wrote:

Currently, this means making manual edits to the linker script - which get overwritten with every 'Generate'. :frowning_face:


Actually, it seems that's not true - 'Generate' does not (necessarily?) overwrite the linker script.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
BarryWhit
Lead
Jul 12, 2024 2:57 PM UTC

My point is that ST has already (for some families) implemented a GUI for editing memory sections that drives linker script generation - so what Andrew (or your own thread hijacking feature request) is asking for is a natural extension of something that already exists, not a complete rewrite of their flow.

"- If someone's post helped resolve your issue, please thank them by clicking ""Accept as Solution"".- Please post an update with details once you've solved your issue. Your experience may help others."