cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

C SDK in 64K RAM ?

stickell
1-Newbie

C SDK in 64K RAM ?

I'm porting a C Edge application to a bare-metal microcontroller platform with around 64K RAM, and hitting problems with malloc running out of memory, although the stack gets through the API connection ok. Running the same code on linux, the heap high-water mark seems to settle around 140K, and since many of the malloc requests are around 16 bytes there's obviously a significant memory manager overhead, so the actual memory in use may not be way off the available limit - but can't really do without a mem manager ! Interestingly the newlib embedded malloc performs somewhat worse than the linux version, getting rapidly fragmented with lots of small blocks, however this version could be replaced if necessary.

Has anyone managed to run on a similarly limited platform with more than a trivial application, or found a way to reduce the malloc activity without changing core TW functions ? As this Thing has more than 100 properties, we could look at avoiding the Primitive_CreateFrom calls every time a property is changed, but need to keep the code portable.

0 REPLIES 0
Top Tags