Memory allocation using malloc/calloc problem in USB Stack

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Memory allocation using malloc/calloc problem in USB Stack

2,162 次查看
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.

标签 (1)
0 项奖励
回复
1 回复

1,716 次查看
bobpaddock
Senior Contributor IV

Check that the linker script allocates any heap memory.

Also see this discussion:

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

0 项奖励
回复