Page 1 of 1

PC vs Embedded Development

Posted: Fri Jul 08, 2011 3:54 pm
by Alessandro
Hi Giovanni!
I just started to use ChibiOS, and I think that this is a good product. Thanks for your work! ;)
A feature that I like very much is the possibility to enterely develop and debug my app on the PC,
and then crosscompile it directly for my target board, with only minimal retouches (except lld drivers :) ).
At the moment I'm facing a RAM memory problem... If I allocate 512 bytes for a static thread on the PC (Windows XP - MinGW compiler),
in reality the macro WORKING_AREA allocates about 12KB!!! The problem is that the total ram memory of my target board is about 12KB!
So, I can't really evaluate if the total ram occupied by the thread (or other instruments) is compatible with the target board.

Do you think it is possible to emulate better the hardware on the PC (ram footprint, execution, debugging, ...),
in order to avoid very boring waste of time in debugging directly over the hardware?
Can you give me some hints?

Thank you very much,
Regards,
Alessandro

Re: PC vs Embedded Development

Posted: Fri Jul 08, 2011 5:45 pm
by Giovanni
Hi,

If you declare a working area of 512 bytes it is 512 bytes on all platforms but the system adds the required platform-specific overhead. On the simulator the large overhead is represented by the stack waste done by PC compilers (they optimize for speed and RAM is a nearly unlimited resource) and the C library.

You cannot evaluate the RAM usage on target by simply looking at the simulator, it is not meant to be an accurate simulation of a target, it is just a port of the OS in a simulated environment.

About debugging on target, it is not much different that debugging in the simulator IMO, it will also get better when the debugging plug-in for Eclipse will be released, there is a thread about this in the other forum.

Giovanni