[En-Nut-Discussion] System Restartting

Ayman Hendawy ayman.hendawy at gmail.com
Wed Oct 10 21:51:34 CEST 2012


Dear Harald,

If you remember my problem that my board keep restarting after 10min of
power on, finally after couple of days of working and commenting many lines
of my code in order to catch the problem, do you know what cause the
problem, you will never expect it!,
The problem is excess using of "puts(" ");" function in my code, I get used
to use puts(); as a debugging method printing strings on serial terminal,
do you have an explanation for these strange case, I noticed in some
examples, always using puts_P(); instead, I think in my case when using
puts();, of course the strings will be saved in RAM, but in case of using
puts_P(); all the strings will be on ROM, which is save for RAM and keep it
clear, what is your opinion?

I just want to share knowledge.

Thanks

Thanks
On Tue, Sep 25, 2012 at 6:43 PM, Harald Kipp <harald.kipp at egnite.de> wrote:

> 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
>
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>



-- 
Best regards

Ayman Hendawy
Embedded system engineer

Cairo,Egypt

Phone: +20110406659


More information about the En-Nut-Discussion mailing list