[En-Nut-Discussion] Problem with app rs232d.

Dusan Ferbas dferbas at etech.cz
Wed Jun 6 08:14:43 CEST 2007


Hi Paolo,

in both cases, you are overwriting memory out of thread limits (other 
thread stacks, other variables).

When you require such a large data memory I always recommend to 
allocate from heap.

---------
If you declared in Receiver thread, than this thread has 512 bytes 
for everything - stack & local variables.
Defined in nut\app\rs232d\rs232d.c, look for NutThreadCreate("xmit", 
Receiver, &cd, 512);

Main is also a thread and it is created in nut\arch\avr\os\nutinit.c, 
look for NutThreadCreate("main", main, 0, NUT_THREAD_MAINSTACK);

NUT_THREAD_MAINSTACK is defined in nut\conf\ethernut13g.conf and has 
value of 768.

----
Both values are far below 3200.

Dusan

==============================
At 23:40 4.6.2007, you wrote:
>Date: Mon, 4 Jun 2007 18:40:05 -0300
>Subject: Re: [En-Nut-Discussion] Problem with app rs232d.
>
>Hi Ernst,
>
>Do you can open and close the telnet to your board after send a several
>megabytes with no hang of the system?
>
>Yes I run the configurator for verfion 1.3g.
>Yeas I have no problem with Http, ftp, and etc...!
>
>My application is using http with 2 threads, ftp with 3 threads and syslog.
>I also start NutSNTPGetTime to have a date and time, NutRegisterDiscovery
>too.
>
>The only problem is when I use the code from rs232d, I can open homepages
>together ftp, with no problem, everthing works, but the rs232d code as I say
>before, hangs in that situation.
>To eliminate a possible  error in my application I return to run only the
>original rs232d to see the error and it happens.
>
>regards
>
>Paulo
>
>[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Paulo da Silva
>Gesendet: Samstag, 02. Juni 2007 05:33
>Betreff: [En-Nut-Discussion] Problem with app rs232d.
>
>Hi all,
>
>
>I have an application that use the code from application rs232d, and I have
>an error, fisrtly I thought that my application could have a bug, so I
>compile only the rs232d application and tested with it and I had the same
>error.
>The error is:
>  I open a terminal in PC to connet to rs232 of my board, and a telnet to
>tcp/ip port 23 of this board runnig nut-os, then I send a big file from one
>terminal to another at the same time.The file is sent in both directions
>with no problem, but if I close the PC telnet and open it again the nut-os
>crashs in one situation that I describe below:
>When I compile the application rs232d avr-gcc tell me that I used 733bytes
>of data memory, in this situation everything works good, I can close and
>open the PC telnet a several times with no problem, data goes from one
>terminal to another, but when I declare <bold><underlined :-)>a 
>variable with size 3200 bytes</underlined :-)></bold>, and
>send the file as I described above, I got an error, when I close the PC
>telnet and open it again the nut-os crashs.
>I declare this variable to see if the problem was memory, because my full
>application has http, syslog, so the compiler tells me about 3200 bytes
>used, so the problem seems to be that nut-os internal memory must be not
>used for it run rs232d application.Is this true? Why it does not use the
>external memory if internal has ended?
>
>My system is version is Ethernut 1.3G compatible, I have 64kbytes of
>external ram.
>Ethernuyt version 4.2.1 and avr-gcc version  3.4.6.
>
>Please may somebody help-me, about this problem?
>
>Thank you in advance.
>
>Paulo


Dusan Ferbas
www.etech.cz  




More information about the En-Nut-Discussion mailing list