Increase stack size - CCSv5.1

Hi,

I'm trying to increase the stack size in my code to 500 but with no success.

I receive this massage error:

"available memory. run placement with alignment fails for section ".stack"

size 0x15e . Available memory ranges:

RAM size: 0x400 unused: 0x13e max hole: 0x13e

error #10010: errors encountered during linking; "Hci Tester Application.out"

>> Compilation failure

not built"

I understand that the maximum stack size I'm currently aloud is 0x13e.

I set the heep size to 0 but still no change.

Please find attached my linker file.

What should I configure in order to increase the stack size?

Thanks,

Yael 

 7181.lnk_msp430fr5739.cmd

  • In reply to George Mock:

    Hi,

    Thanks for the link; I read it but my question still remains open.

    The RAM size is 0x400 according the the linker file.

    This is the massage I received:

    RAM size: 0x400 unused: 0x13e max hole: 0x13e

    The hip size is set to 0, and therefore I can't understanf why the stack size is limit to 0x13e.

    I tried turning on optimization but there was no change.

    I'm compiling the same code with identical RAM mapping with IAR and I can define the stack size as 500.

    Is there any diffrent confiruration required?

    How can I defined my stack size as 500?

    Please note that I attached my linker file on the previous post.

    Also, is possible to move this thread to the internal  E2E?

    Thanks,

    Yael

     

  • In reply to Yael Oz:

    The RAM memory range has 0x13e bytes left unused.  You say the .stack section 500 byte big.  That's 0x1F4 in hex.  So, the size of the .stack section is too big to fit in the space left available in RAM.  Either move something out of RAM, or make the stack section smaller.  There are no other choices.

    Thanks and regards,

    -George

  • In reply to George Mock:

    Hi George,

    I took your advice and moved 2 buffers from the RAM and allocate them manually to the FRAM using the linker file.

    Now I have enough room from my stack, so thanks.

    But now I have a different issue with the FRAM size.

    As I can see from the .map file the code (.text + .cinit) consumption is 0x3370  (.cio .system .pinit  .const are all 0 ).

    According the MSP430 datashit there are 16k FRAM.

    I have 4 buffers mapped to the FRAM - total size for all of them is 1.6k,

    The code (0x3370) according to the map file is 13.1k.

    Theoretically looks ok but when trying to compile I receive this error:

    "../lnk_msp430fr5739.cmd", line 105: error #10099-D: program will not fit into

    available memory. placement with alignment fails for section "ALL_FRAM"

    size 0x396d . Available memory ranges:

    FRAM size: 0x3420 unused: 0x3420 max hole: 0x3420

    error #10010: errors encountered during linking; "Hci Tester Application.out"

    not built

    >> Compilation failure

    How can it be that the place needed in the FRAM is 0x396d? As I can see from the map file I will need 0x3370 for the code and 0x960 for the buffer.

    Are there any other addones that I'm not aware at during compilation that might increase the FRAM consumption?

    Thanks,

    Yael

  • In reply to Yael Oz:

    Hi George,

    I just realized that the sizes conflict actually results from the alignment there is in the FRAM groups sections:

    SECTIONS

    {

    GROUP(ALL_FRAM)

    {

    GROUP(READ_WRITE_MEMORY): ALIGN(0x0200) RUN_START(fram_rw_start)

    {

    .cio : {} /* C I/O BUFFER */

    .sysmem : {} /* DYNAMIC MEMORY ALLOCATION AREA */

    }

    GROUP(READ_ONLY_MEMORY): ALIGN(0x0200) RUN_START(fram_ro_start)

    {

    .cinit : {} /* INITIALIZATION TABLES */

    .pinit : {} /* C++ CONSTRUCTOR TABLES */

    .const : {} /* CONSTANT DATA */

    }

    GROUP(EXECUTABLE_MEMORY): ALIGN(0x0200) RUN_START(fram_rx_start)

    {

    .text : {} /* CODE */

    }

    } > FRAM

     

    Since the groups are align to 0x200 holes are created and the FRAM space is not enough for my code.

    Is there any requirement by MSP-EXP430FR5739 to align these groups to 0x200? I didn't see any comment regarding this in the data ***.

    Also, I'm working in parallel with IAR IDE and there is no alignment for these sections.

    Can you please explain this alignment? Can I remove it? What is the correct syntax for that?

    Thanks,

    Yael

  • In reply to Yael Oz:

    There is no reason the compiler requires those sections be on a 0x200 byte boundary.  There could be a hardware reason.  For that, I recommend you post a query to the MSP430 forum.

    Thanks and regards,

    -George