µC/LIB Memory Heap Configuration
µC/IPerf is using µC/LIB to allocated internal data such as OS objects (semaphore, mutex) and its application buffer. µC/IPerf internal tasks stack is also allocated using µC/LIB. Therefore µC/LIB memory module must be configured properly for µC/IPerf. If the heap size is not configured large enough, an error will be returned during the initialization.
Since the needed heap size is related to the module configuration (iperf_cfg.h
), it’s not possible to provide an exact formula to calculate it. Thus to optimize the heap size, you should try different heap size until no error is returned. A good starting point will be plan a heap size at least a little bit greater than the sum of IPERF_CFG_BUF_LEN and IPERF_OS_CFG_TASK_STK_SIZE.
Note: The memory module must be initialized by the application prior to calling IPerf_Init()
. We recommend initializing the memory module before calling starting the RTOS, or near the top of the startup task.
Please refer to section µC/LIB Documentation for more details on the µC/LIB module and its configuration.