BASE Lib
BaseLibs is a collection of fundamental C libraries integrated into FreeRTOS, offering essential functionalities like printf and memory management.
printf
This library is optimized for GAP, providing the capability to use printf functions seamlessly on GAP devices. Printf is pre-included and readily accessible by default when you include pmsis.h
.
Libc
Libc furnishes indispensable and practical basic C functions for efficient memory management, including:
free
malloc
calloc
exit
memcmp
memcpy
strcat
…
These functions meet the needs of the vast majority of applications. The library is lightweight and optimized. It is pre-included and readily accessible by default when you include pmsis.h
.
Extended baselibc
Extended baselibc enhances the default libc library by incorporating less common functions, such as:
memswap
qsort
isxdigit
islower
bsearch
assert
…
This extension can be used in scenarios requiring more advanced char* and memory manipulation.
It’s important to note that this library wasn’t specifically designed for GAP, potentially resulting in increased memory and core usage. When enabled, it consumes an additional 47KB of memory compared to the basic version, which only requires 8KB.
To integrate the extended libc library into your application, add CONFIG_LIB_BASELIBC=1
to your sdk.config file or select the option in the menuconfig under GAP_SDK -> Libs. Subsequently, include the headers assert.h, ctype.h, stdlib.h, string.h, or inttypes.h.