1

I'm using GCC for and specific MCU target (to be accurate for AVR) I have a special external memory that I try to define a custom Section by using following command in linker options

-Wl,--section-start=.customsection=0x821000

and then using attribute inside the code just like this:

unsigned char X __attribute__((section (".customsection")));

everything is correct and works fine. But how can I define some limitation to this custom section that force the GCC linker to raise an error in case of overrun? By limitation I mean a way to define length of the section or end-address.

1 Answer 1

1

AFAIK, you can only specify the length in a linker file.

You would have to copy the linker file for your MCU and modify it.

For more information and examples see:
- https://www.avrfreaks.net/forum/create-new-section-ram
- https://www.avrfreaks.net/forum/custom-linker-script-atmega

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.