[En-Nut-Discussion] System Restartting

Harald Kipp harald.kipp at egnite.de
Tue Sep 25 18:43:09 CEST 2012


Hi,

On 24.09.2012 10:47, Uwe Bonnes wrote:

>     Ayman> The second task print: Heap problem 813694976 Heap free bytes
>     Ayman> 813694976 largest Block 813760510
> 
> 
> Do you have an increadible amount of RAM on you system? More than 800 MByte?
> These numbers seem insane. There is something fishy. Try some of the
> examples in the example directory and add the heapcheck there. Are the
> numbers sensible there?

Indeed, that's quite much RAM for an Ethernut 1. :-)

Less experienced developers (sorry Ayman, hope you don't mind) always
run into the same problem. They are creating a lot of fancy code and
then start testing and debugging. If you have one of these high-tech
debuggers with real-time tracing, dump analysis, backtracing or what
else, this may work. If you stick to bare-metal tools, you have two options:

1. Become more experienced before writing that big stuff.
2. Go slowly step by step. Test each part before moving on.

I assume, I'm quite experienced with embedded systems and specifically
with Nut/OS, so I can also create a lot of code within short time. But
there are areas, which I'm not experienced in or which are really mind
boggling for me. In that case I often create the routines on a PC first,
where testing and debugging is much more convenient. For example, the
uHTTP library was created this way. The cool thing about Nut/OS is, that
only a few changes are required to move C code from PC OS to the
embedded target.

I'm almost sure, that Ayman's bug will be easily discovered as a buffer
overflow or bad pointer when trying it on a PC.

Regards,

Harald





More information about the En-Nut-Discussion mailing list