Other Parts Discussed in Thread: SYSBIOS
hello, I'm developing an application using SDK 5.20.00.52, derived from project_zero. I need to allocate some memory to send a custom event handled by the processApplicationMessage function. If I call ICall_malloc with more than 3 bytes argument, it fails (returns NULL).
Tha malloc should allocate the pData field for an object of type
typedef struct
{
uint8_t event;
void *pData;
} pzMsg_t;
that is then enqueued using Util_enqueueMsg. If I ask for 3 bytes or less everything works, if my pData object is larger than 3 bytes the ICall_malloc fails.
ICall_malloc is called from an hwi (UART interrupt) but I don't think this is relevant. The heap should be configured as autosize (if I correctly understand the cfg settings) and memory allocation chart says SRAM is 17%, so I don't understand why I cannot allocate more than 3 bytes. When I call the relevant code the application is responding to a UART interrupt (keypress from terminal) while a cyclic routine is called every 1ms by an interrupt issued by sensor controller. Such routine uses some static data structures so no heap is involved, and memory usage is very low (total 17% as said above).
Thanks
Fabio Mannino