A question about the S32K144 Heap and Stack.

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

A question about the S32K144 Heap and Stack.

Jump to solution
335 Views
whale
Contributor I

1、S32DS v3.5 + SDK 4.0.1
2、Example:uart_pal_echo_s32k144
3、The original S32K144_64_flash.ld file.

       whale_0-1695178842217.png
4、The modified S32K144_64_flash_modify.ld file.

      whale_1-1695178924428.png
5、Compile uart_pal_echo_s32k144 separately with these two ld files.

6、arm-none-eabi-size --format=berkeley uart_pal_echo_s32k144.elf
      - S32K144_64_flash.ld
            text    data    bss     dec        hex      filename
         16492   628     3592  20712    50e8    uart_pal_echo_s32k144.elf

      - S32K144_64_flash_modify.ld
            text    data    bss     dec        hex      filename
        16848   1696   36384  54928   d690    uart_pal_echo_s32k144.elf

The question:
      1、Why is the size of bss measured by arm-none-eabi-size consistent with the size increased by Heap/Stack? 
      2、Is it true that in S32K144 both Stack and Heap define a global array of all zeros, and then implement specific memory management through that array? If so, can you find the reference code in SDK 4.0.1?

 

 


       

 

0 Kudos
1 Solution
275 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Compiler uses bss section for putting of uninitilized variables and from this point of view stack/heap is the same category.

RAM area used for stack/heap should be cleared anyway as startup initialized RAM memory for ECC.

View solution in original post

0 Kudos
1 Reply
276 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Compiler uses bss section for putting of uninitilized variables and from this point of view stack/heap is the same category.

RAM area used for stack/heap should be cleared anyway as startup initialized RAM memory for ECC.

0 Kudos