FreeRTOS ,S32K312 chip, the configTOTAL_HEAP_SIZE modify

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

FreeRTOS ,S32K312 chip, the configTOTAL_HEAP_SIZE modify

ソリューションへジャンプ
746件の閲覧回数
guochuan
Contributor III

Based on the official FreeRTOS demo of the S32K312 chip, the  configTOTAL_HEAP_SIZE was modified lead to main function could not be accessed

1、Modify the memory allocation in the link file as follows

MEMORYMEMORY

2、If I change the stack to be smaller than 30K or larger than 60K, the program can run normally. However, if the stack is between 30K and 60K, the main function cannot enter

0 件の賞賛
1 解決策
673件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @guochuan,

I tested your configuration (linker  + HEAP size (1024 * 65)) and it fails (MemManage Fault) in Clock_Ip_InitClock() at a write to 0x2040F394

00406690: str r0, [r5, #0]

This is because of the MPU configuration in system.c

Confirmed by disabling the MPU:

/* Enable MPU */
// S32_MPU->CTRL |= S32_MPU_CTRL_ENABLE_MASK;

 

Regards,

Daniel

元の投稿で解決策を見る

0 件の賞賛
3 返答(返信)
733件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @guochuan,

Can you please list all the modifications you made?

How did you changed the configTOTAL_HEAP_SIZE?

You allocated 4KB for the stack, so I don't understand this sentence:

"If I change the stack to be smaller than 30K or larger than 60K..."

 

Regards,

Daniel

 

0 件の賞賛
720件の閲覧回数
guochuan
Contributor III

FreeRTOSConfig.hFreeRTOSConfig.hIf I change the  configTOTAL_HEAP_SIZE to 1024*60,compilation can pass, but not into the main function。

But when I change the configTOTAL_HEAP_SIZE to less than 1024*30, the compilation will go through and the program will work。

Attached is the map file I compiled and generated. Please check whether there are any exceptions

0 件の賞賛
674件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @guochuan,

I tested your configuration (linker  + HEAP size (1024 * 65)) and it fails (MemManage Fault) in Clock_Ip_InitClock() at a write to 0x2040F394

00406690: str r0, [r5, #0]

This is because of the MPU configuration in system.c

Confirmed by disabling the MPU:

/* Enable MPU */
// S32_MPU->CTRL |= S32_MPU_CTRL_ENABLE_MASK;

 

Regards,

Daniel

0 件の賞賛