Question

This is for a ADuC ARM (ARM7TDMI) chip... I've done:

char WD_Track __attribute__( ( section( "NoInit"),zero_init) );

And checked the NoInit checkbox for IRAM2... and it still gets initialized to 0 at startup (I don't want this one initialized -- I want to see what it was doing when the watchdog bit me).

I saw the other post about using __at__ in another question, but should I really do that (I don't care where the compiler puts it as long as it leaves it alone. OTOH, I have a section in flash using the __at__ bit because I need to erase that page during operation)?

Was it helpful?

Solution

You also need to tell the linker to put that piece of data into IRAM2. The "NoInit" is just a section name and you can supply a linker scatter file (you'll have to disable Use Memory Layout from Target Dialog) to place sections with that name in IRAM2. See the example scatter file in http://www.keil.com/support/docs/3480.htm (but it uses IRAM1 as the UNINIT region).

Or, if the whole .c file is uninit data then you can use the per-file options to place the .c file into IRAM2 (instead of using a manual scatter file).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top