We're using S5D9/D5 devices with SSP 1.60 and e2studio 7.3.0 and our project uses ThreadX.
It seems standard malloc/free routines are not thread safe and when called from multiple threads, heap is corrupted sooner or later. I tried to define __malloc_lock() and __malloc_unlock() routines to disable/enable interrupts just for the sake of test and problems disappeared. However, I'm not sure if it is sufficient and also disabling interrups is an overkill (I'd use mutex if it is a right way). I tried to search docs and found virtually nothing regarding this subject which probably means I'm missing something because it is really important thing.
- what is correct and supported way to handle it?
- can you point me to the right documentation?
- should we use a big ThreadX byte pool instead of standard heap?
- also, why SSP doesn't handle it internally? Or does it?
In reply to Renesas Karol: