This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/MSP430F6659: Compiler says not enough memory when using grlib

Part Number: MSP430F6659

Tool/software: TI C/C++ Compiler

I get the following error in the console window. 

Description Resource Path Location Type
<a href="processors.wiki.ti.com/.../10099"> program will not fit into available memory. placement with alignment fails for section ".cinit" size 0x2c1 . Available memory ranges: lnk_msp430f6659.cmd /DM10-10-18Project line 152 C/C++ Problem

/lnk_msp430f6659.cmd", line 152: error #10099-D: program will not fit into available memory. placement with alignment fails for section ".cinit" size 0x2c1 . Available memory ranges:
FLASH size: 0x7f80 unused: 0x0 max hole: 0x0

If I change the link command file from this;

   .cinit      : {} > FLASH             /* Initialization tables    

to;

   .cinit      : {} > FLASH2            /* Initialization tables    

it compiles, but I don't know if that is okay to do?  I want to be able to download new firmware from the built in USB BSL, so I dont want to step on any memory that is reserved for that? 

Please help.

Thanks

  • It might be OK to allocate .cinit to FLASH2.  I am not certain.  The final word on this needs to come from the MSP430 device experts who supply the linker command files.  I'll contact them, discuss things with them, then have them post to this thread.

    Thanks and regards,

    -George

  • Why .cinit is so huge?

    Did that came from grlib?

    Could you check and post .cinit memeory allocations using View -> Memory Allocation :

  • Hello Jerry,

    You could potentially move cinit to FLASH2 as you describe. Personally, I would do the directive to allow it to be placed into FLASH or FLASH2. That would look something like the following.

    .cinit       : {} > FLASH | FLASH2

    This tells the IDE to try to fit cinit in FLASH space and if it doesn't fit, to move to FLASH2 space. 

  • The previous post had a minor error, which I have since corrected.  I'll explain the error here just to avoid any confusion.

    Here is the incorrect syntax ...

    /* !!!DO NOT DO THIS!!! */
    .cinit       : {} >> FLASH | FLASH2

    Notice it is correct to use > , but wrong to use >> .  That's subtle, but significant.  To understand the difference, please visit this article.  There is more detail specific to .cinit.  The section .cinit, because of how it is processed by the startup code, cannot be split.  It must be contiguous in memory.  If you try to split it, the linker issues a diagnostic.

    Thanks and regards,

    -George

  • With George response to your previous post, you can see how important is to isolate questions.
    Let Power be with you.
  • Thanks George for the added information that cinit cannot be split.
  • Thanks guys. For some reason I can't copy the memory allocation, but the program is using 100% of  flash and about 35% of flash2. and 18% of Ram. Yes GRlib has a bunch of fonts and I have stored images. Does it matter to use flash or flash2?