[En-Nut-Discussion] Problem with app rs232d.
Paulo da Silva
psilva at opensoftware-br.com
Sun Jun 3 20:07:42 CEST 2007
Hi Ernst!
I follow your sugestion, and put the code:
char dummy[3200];
memset(dummy,0,3200);
1 - Inside StreamCopy, the result was: The application accept the telnet
connection but when you try to send one char, application crashs.
2 - Inside Thread receive or main function, the result was: Application does
not accept telnet, because it crashs.
This error is very stranges because with this variable declared as global
and memset into StreamCopy, the telnet connects and I have data flow betwin
ethernet and rs232, but depends on amount of data the application to crashs,
I did a several tests and when I send 5000bytes I can close and open a
telnet to application without a problem, but when I sen 100.000bytes, when I
close and open a telnet and try to send only ane char applications crashs,
so I think this is an ethernut problem? I cannot use all internal memory? I
know that stack use internal memory,so what I must to do to bypass this
situation, because when I insert a new module to compile with my application
avr-gcc tells me that the use of internal memory grow, I try to tell avr-gcc
to use external memory putting this linker option: LDFLAGS
+= -Wl,-section-start=data=0x801100 , but I had no success, I read that this
option tells linker to use memory from 0x1100 to put data,so stack space may
be preserved, but this does not work.
regards
Paulo
----- Original Message -----
From: "Ernst Stippl" <ernst at stippl.org>
To: "'Ethernut User Chat (English)'" <en-nut-discussion at egnite.de>
Sent: Sunday, June 03, 2007 3:53 AM
Subject: Re: [En-Nut-Discussion] Problem with app rs232d.
Hi Paulo!
This sounds a bit like a possible stack overflow problem. Where did you
define the 3200 byte variable?
- global
- within thread "Receiver"
- within "main"
- elsewhere
Try move the 3200 byte variable around between these to see how the
behaviour changes....
regards
ernst
-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Paulo da Silva
Gesendet: Samstag, 02. Juni 2007 05:33
An: Ethernut User Chat (English)
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 a variable with size 3200bytes, 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
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.472 / Virus Database: 269.8.7/829 - Release Date: 02.06.2007
17:26
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion
More information about the En-Nut-Discussion
mailing list