Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Memory allocations in uC-OS

Status
Not open for further replies.

codetrickster

Newbie level 3
Joined
Jan 8, 2014
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Chennai, India
Activity points
41
I have a message packet as below:
dest|src|length|payload
I need to allocate memory for this message packet.
Please suggest best way to allocate memory for this packet dynamically or static using uC-OS III.
 

Pack the message into a struct. Usual rule of thumb while using any kind of RTOS is to avoid dynamic allocations as much as possible. You could create a static array of a particular size depending on your application and have a set of minimal memory management routines based off of this array - this would mean that creating a new packet would essentially be indexing into a particular location into the static 'packet' array and using this pre-allocated storage space.

Hope that helps..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top