Memory Management
Posted: Thu Feb 02, 2012 3:19 am
Hi Giovanni,
The more I work with chibiOS the more I appreciate the code and doc consistency, and of course the responsive support. 2.3.4 now runs correctly on top of a core DFU section so we can update chibiOS directly over USB.
My next issue is understanding memory management: I see the docs on Heaps, Memory Pools, Dynamic Threads and Memory Streams. We are porting a subset of our scripting language (PiXCL) that (in Windows) create a series of linked lists, and also needs to store lists of icons and bitmaps.
Q1. Do the memory management (excluding Memory Stream) functions work on RAM only, or Flash as well?
Q2: There is no chHeap compacter function. I can see a situation where RAM gets quite fragmented, and compaction would be of benefit. Do you see this as not being necessary, adding complexity or something else?
Q3: The PiXCL interpreter linked list objects are the same size for each list. Do you recommend creating a set of Memory Pools for this?
Q4. The Memory Streams msObjectInit function can create RAM or ROM objects. Does ROM equate to Flash?
Q5: Our DFU, chibiOS, and PiXCL will all be in Flash. Some of the PiXCL lists are static once created, and could be resident in Flash with no problem. If I write some Flash memory management code, would this be considered modifying the kernel (hence disclosable) or my work, hence non-disclosable?
The more I work with chibiOS the more I appreciate the code and doc consistency, and of course the responsive support. 2.3.4 now runs correctly on top of a core DFU section so we can update chibiOS directly over USB.
My next issue is understanding memory management: I see the docs on Heaps, Memory Pools, Dynamic Threads and Memory Streams. We are porting a subset of our scripting language (PiXCL) that (in Windows) create a series of linked lists, and also needs to store lists of icons and bitmaps.
Q1. Do the memory management (excluding Memory Stream) functions work on RAM only, or Flash as well?
Q2: There is no chHeap compacter function. I can see a situation where RAM gets quite fragmented, and compaction would be of benefit. Do you see this as not being necessary, adding complexity or something else?
Q3: The PiXCL interpreter linked list objects are the same size for each list. Do you recommend creating a set of Memory Pools for this?
Q4. The Memory Streams msObjectInit function can create RAM or ROM objects. Does ROM equate to Flash?
Q5: Our DFU, chibiOS, and PiXCL will all be in Flash. Some of the PiXCL lists are static once created, and could be resident in Flash with no problem. If I write some Flash memory management code, would this be considered modifying the kernel (hence disclosable) or my work, hence non-disclosable?