Is there any additional libraries or flags that have to put in the make file or whatever else needed to make this very basic C functionality to work?
I tried both
But always got:
D:\WICED-Studio-6.2\SDK\20719-B1_Bluetooth\WICED/../apps/w191/spp1/spp.c:517: undefined reference to `sprintf'
Tracking it back to declaration in stdio.h I've got:
int _EXFUN(sprintf, (char *__restrict, const char *__restrict, ...)
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
P.S. Same story is and with stdlib.h and malloc() and free():
D:\WICED-Studio-6.2\SDK\20719-B1_Bluetooth\WICED/../apps/w191/spp1/spp.c:520: undefined reference to `malloc'
D:\WICED-Studio-6.2\SDK\20719-B1_Bluetooth\WICED/../apps/w191/spp1/spp.c:521: undefined reference to `free'
The sprintf, malloc and free functions are not implemented in CYW20719B1 firmware.
However, instead of sprintf, you can use snprintf in following way:
snprintf(name, sizeof(name), "Try-%d", a);
WICED_BT_TRACE ("%s", name);
For malloc, free operations, you can use WICED APIs. Please refer wiced_memory.h for more details.