Hello everyone,
Some of C&CPP command sets use malloc & free instructions. When you are using this libraries your applications wont be thread safe because malloc & free are not thread safe. This is very critical for memory management when using FreeRTOS.
You need to use pvPortMalloc & vPortFree functions if you want to run your applicaton as thread safe.
Here is a quick fix for you.
In your main.c file decleare below functions.
extern "C" {
extern void *malloc(size_t size);
extern void free(void *p);
extern void *realloc(void *p, size_t size);
}
void *malloc(size_t size) {
return pvPortMalloc(size);
}
void free(void *p) {
vPortFree(p);
}
Adding this code block to your main.c, free & malloc will be thread safe.
Best Regards.
Yagizhan Ugur