Memory allocation using malloc/calloc problem in USB Stack

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

Memory allocation using malloc/calloc problem in USB Stack

1,249 Views
vikashkumar
Contributor I

Hi,

I'm working on USB host integration. In usb_khci_preinit() function i'm trying to allocate memory at run time using malloc.

I tried with  OS_Mem_alloc_zero(sizeof(usb_khci_host_state_struct_t)); function as well as int *p=malloc(10);.

In both cases i got return value is 0. It means i unable to allocate memory.

I need some help to solve this problem.

Labels (1)
0 Kudos
1 Reply

803 Views
bobpaddock
Senior Contributor III

Check that the linker script allocates any heap memory.

Also see this discussion:

https://community.nxp.com/thread/441637 

0 Kudos