[En-Nut-Discussion] no source in debugger solved, next step

Klaus Kloos klaus.kloos at gmx.de
Tue Oct 4 21:45:45 CEST 2011


Hello Harald

Many thanks for your help.
'show stopper' is the right name, after the small change it runs and its a really cool show.....

Is it better to work with the version 4.10?

I have tested the ftp-server (4.8.9) with few success.
Im able to create a folder (so mmc access is working) but even a list fails.

On the other side most things Ive tried work like charm. Telnet, RS232, Treads, Mutex, ....
Great project.

Greetings Klaus

Am 04.10.2011 um 12:54 schrieb Harald Kipp:

> Hi Klaus,
> 
> On 02.10.2011 22:27, Klaus Kloos wrote:
> 
>> [4] Connected, 1444 bytes free
>> 
>> [4] Low mem
>> 
>> [4] Low mem
> 
> The provided http sample is a bit overdone. Over the years, more and
> more demo code had been added to it. Most real applications will not
> need all the implemented features.
> 
> I just tried a short compile/link test with Nut/OS 4.10 and debugging
> enabled. It turns out, that 12k static RAM is already required before
> the application starts.
> 
> The debug version of the code requires more stack space. For this, the
> Configurator simply defines
> 
> NUT_THREAD_STACK_MULT=3
> 
> So every thread's stack space reservation is multiplied by 3. Probably
> this could be lowered. And then there is a bug in httpserv.c itself,
> defining
> 
> #define HTTPD_SERVICE_STACK ((1024 * NUT_THREAD_STACK_MULT) +
> NUT_THREAD_STACK_ADD)
> 
> and
> 
> NutThreadCreate(thname, Service, (void *) (uptr_t) i,
>    (HTTPD_SERVICE_STACK * NUT_THREAD_STACK_MULT) + NUT_THREAD_STACK_ADD);
> 
> which actually reserves 9k stack (3 * 3 * 1024) for each of the 4 server
> threads. Together with statically allocated RAM space, we are nearly at
> 50k. The CPU has 64k RAM only.
> 
> This has been fixed in 4.10, but not yet in 4.8. I haven't been aware,
> that this is a show stopper for the SAM7X-EK when running debug code.
> 
> Changing the line to
> 
> NutThreadCreate(thname, Service, (void *) (uintptr_t) i,
> HTTPD_SERVICE_STACK);
> 
> should help in a first step.
> 
> When compiling without debugging info, a lot more RAM is available.
> Furthermore, you can build Nut/OS libs _without_ and your application
> code _with_ debugging info to debug application code only.
> 
> Regards,
> 
> Harald
> 
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Ingenieurbüro Kloos
Soft+Hardware Entwicklung
Haus Heyden Strasse 111
52134 Herzogenrath
Tel.: 02407/918376
Handy.: 0176/20925123









More information about the En-Nut-Discussion mailing list