Memory Tab

The Memory tab contains the parameters to create the memory allocation and memory release for MQX.

In Memory Allocation, _mem_alloc_system is the MQX function that allocates memory for a device. It returns a void pointer and receives an integer.

If a function receives more than one parameter, for example, an integer flag, type the parameters in the Prototype Parameters box as int, int.

Also, add an actual parameter to the memory allocation function, and select Size of HAL Structure sizeof() . Internally, Processor Expert will resolve it as the size of the HAL structure defined in the LDD component.

Figure 1. Memory Tab



Memory deallocation allocates _mem_free as the function name, receives one parameter (a void pointer) and returns nothing (void).

The RTOS component will generate code to check if the memory allocation failed. If it fails, the Init() function returns NULL as an indication of a failure in initialization.