How do I set the stack size in linker flash S32K344.ld

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I set the stack size in linker flash S32K344.ld

1,442 Views
shunyizhang
Contributor IV

Previously developed the S32K146 chip, modifying the stack size in the linked file is also relatively simple,

S32K146_128_flash.ld:

HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x00000400;
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x00000400;

linker_flash_s32k344.ld:

HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x00002000;
__STANDBY_RAM_LIMIT_END = 0x20419000; /* 100Kbyte for standby ram */

 

What should I do if I want to change the stack size in the linker_flash_s32k344.ld file?

 

 

0 Kudos
Reply
3 Replies

1,387 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @shunyizhang,

This is already there.

Linker file from RTD 2.0.1 attached.

 

0 Kudos
Reply

1,415 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @shunyizhang,

If you use RTD, the linker file defines sections for the stacks.

danielmartynek_0-1696857121484.png

If you change the stack sections, you need to adjust the adjacent sections accordingly.

 

Regards,

Daniel

 

 

0 Kudos
Reply

1,396 Views
shunyizhang
Contributor IV

@danielmartynek ,Hi,

After allocating the Stack size, should I add the following code?

__Stack_end_c0 = ORIGIN(int_sram_stack_c0);
__Stack_start_c0 = ORIGIN(int_sram_stack_c0) + LENGTH(int_sram_stack_c0);
__Stack_end_c1 = ORIGIN(int_sram_stack_c1);
__Stack_start_c1 = ORIGIN(int_sram_stack_c1) + LENGTH(int_sram_stack_c1);

0 Kudos
Reply