This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Local variables storage optimization

Hi ,

I am using ARM Cortex M4 . When I compile my code I get "No space in Execution region with .ANY selector matching section .const data .When I decrease the code size I am able to compile the code properly.I think I am overusing the data section which in my controller is 32KB.

I want to know where are all local variables stored in ARM KEIL IDE.Is it stored in Stack dynamically or stored in DATA memory Statically .

Thanks in advance

Regards,
Dhanush

Parents
  • Hi all,

    As per your advice I tried to free some of my code space memory , by taking literal pool strings i.e "strings" into data memory by assigning a char array.Now I am getting "No space in Execution region with .ANY selector matching section .data" or "No space in Execution region with .ANY selector matching section .bss"

    Regards,
    Dhanush

Reply
  • Hi all,

    As per your advice I tried to free some of my code space memory , by taking literal pool strings i.e "strings" into data memory by assigning a char array.Now I am getting "No space in Execution region with .ANY selector matching section .data" or "No space in Execution region with .ANY selector matching section .bss"

    Regards,
    Dhanush

Children
  • Hi all ,

    I have now found a work around . I have checked the " USE MICRO LIB " check box in

    Options for Target -> Target tab.

    Please let me know if i ma doing anything wrong .As of now the code is working properly and will let you know if I find any bug in the normal working of code.

    Regards,
    Dhanush

  • Your text strings always (!) needs to be stored in the flash. Nothing but what you have in flash survives a power cycle.

    Copying the text strings into a RAM variable will not remove the use of flash. It will just add extra code to do the copying. Any copying still requires a source.

    Switching to the microlib means you get a bit smaller library so there is a bit more code space available for your own program.

    In the end, your program is too large for the processor or for the Keil license.