FreeRTOS allocation problem

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

FreeRTOS allocation problem

ソリューションへジャンプ
1,828件の閲覧回数
john71
Senior Contributor I

I use MK10FN1M0xxx12.

I create two tasks

FRTOS1_xTaskCreate((TaskFunction_t)operation_task, (signed char*) "tx", 1024, NULL, 1, NULL); FRTOS1_xTaskCreate((TaskFunction_t)log_managment_task, (signed char*) "rx", 512, NULL, 1, NULL);

It runs OK.

But if I increase the stack size

FRTOS1_xTaskCreate((TaskFunction_t)operation_task, (signed char*) "tx", 1024, NULL, 1, NULL); FRTOS1_xTaskCreate((TaskFunction_t)log_managment_task, (signed char*) "rx", 1024, NULL, 1, NULL);

I fall into FRTOS1_vApplicationMallocFailedHook

And I have  #define configTOTAL_HEAP_SIZE (24576) /* size of heap in bytes */

How to fix the problem?

1 解決策
1,676件の閲覧回数
john71
Senior Contributor I

Sorry. Found the problem. Should increase  heap size #define configTOTAL_HEAP_SIZE (32768)

元の投稿で解決策を見る

4 返答(返信)
1,677件の閲覧回数
john71
Senior Contributor I

Sorry. Found the problem. Should increase  heap size #define configTOTAL_HEAP_SIZE (32768)

1,676件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Hi,

just a comment:

xTaskCreate((TaskFunction_t)operation_task, (signed char*) "tx", 1024, NULL, 1, NULL);

this means you actually are requesting 4KB (4*1024 bytes) of stack space.

This of course depends on your application, but is rather high, and you maybe only wanted to reserve 1024 bytes of stack?

Erich

1,676件の閲覧回数
john71
Senior Contributor I

I see. Thank you.

0 件の賞賛
返信
1,676件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Thanks for sharing.

Regards

Daniel

0 件の賞賛
返信