what should be the value of stack and heap for K66

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

what should be the value of stack and heap for K66

703件の閲覧回数
rimidhanjal
Contributor I

hi ,

   I have tryed to create a project for usb hid (keyboard as host) for k66 ,using processor expert .I have configured  the stack and Heap size  to 4k each ,while building the project it generates elf error and at default setting (stack / Heap size ) it gets build ...

While Debugging

usb_khci_host_state_struct_t* usb_host_ptr = (usb_khci_host_state_struct_t*) OS_Mem_alloc_zero(sizeof(usb_khci_host_state_struct_t));

 

OS_Mem_alloc_zero( )  returns a null to usb_host_ptr, so what can be the issue ,if its the issue with stack / Heap size ,what should be its size .

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

542件の閲覧回数
ivadorazinova
NXP Employee
NXP Employee

Hi Rimi,

please, try to set heap and stack on higher value, because default values are really low.

HEAP_SIZE  = DEFINED(__heap_size__)  ? __heap_size__  : 0x400;

STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0800;

You  set these values for heap and stack at MK66FN2M0xxx18_flash.ld

Please see bellow:


K66.png

In case of any issue, please let me know.

Best Regards,

Iva

0 件の賞賛
返信

542件の閲覧回数
therealfreegeek
Contributor IV

For my K64 CDC project I used 0x600 for my stack and 0xFFFF for the heap and it worked ok, maybe overkill but I have plenty free memory.

0 件の賞賛
返信