what should be the value of stack and heap for K66

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

what should be the value of stack and heap for K66

605 Views
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 .

Labels (1)
0 Kudos
Reply
2 Replies

444 Views
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 Kudos
Reply

444 Views
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 Kudos
Reply