etherten memory problem ?

The EtherTen combines an Uno-equivalent Arduino-compatible board and Wiznet-based Ethernet support, along with a microSD card slot and Power-over-Ethernet support. [Product page]
Post Reply
davidw
Posts:5
Joined:Mon Jan 23, 2012 9:47 am
etherten memory problem ?

Post by davidw » Mon Jul 30, 2012 1:43 am

I've been working on a problem which seems to be related to the maximum size of a sketch.

When my sketch gets somewhere near 19.5K in size as reported by the Arduino compiler 1.0.1 (1.0 is the same) the etherten seems to have a problem. Serial out chars are incorrect (rubbish usually). If the code gets even bigger the whole thing just hangs. I have fiddled around with this for a couple of days thinking it was my code but fine tuning the sketch by deleting non essential code (mostly Serial.print lines) and reducing char strings to a bare minimum I can get it to reliably run. I have shifted new sections of code in and out during testing and everything seems to point to a memory problem of some kind.

My next step is to try it on another etherten board to see if the problem is the sketch or maybe pin pointing it to the hardware (memory ?).

Any advice or anyone experiencing a similar problem ? :?

bfisher
Posts:7
Joined:Thu Jul 26, 2012 6:19 am

Re: etherten memory problem ?

Post by bfisher » Mon Jul 30, 2012 7:27 pm

What type of libraries are you using? I am having a similar problem with the serial monitor, though I never thought it might be related to code size.

davidw
Posts:5
Joined:Mon Jan 23, 2012 9:47 am

Re: etherten memory problem ?

Post by davidw » Tue Jul 31, 2012 3:53 am

using standard libraries only.

spi
eeprom
wire
ethernet

using i2c for ds3232 RTC chip and mcp23017 IO expansion chip
using ethernet
using eeprom read and write feature

After testing last night I was able to get good operation with code size up around 26K so I think I was on the wrong track with a memory hardware issue being the cause. All I did was cut and paste in successively longer bits of code containing Serial.println lines. Maybe there was something in the Serial.println lines I deleted in my attempt to reduce code size. I saw another posting that mentioned problems when trying to print successive "!" chars. I did have a Serial.println("==========================="); line that I deleted but I haven't tested that theory yet.

Anyway, with it all working now the heat is off. Still would be interested if anyone else strikes a similar problem at any stage. David.

CodeStorm
Posts:8
Joined:Sun Aug 05, 2012 12:17 pm

Re: etherten memory problem ?

Post by CodeStorm » Sun Aug 05, 2012 1:02 pm

Hi all, I have just purchased my EtherTen about a month ago and have been racking my brain over a simillar issue. The sketch is around 23k and works fine. I use a menu system utilizing the LiquidCrystal.h library which works happily. If I add extra menu items (purely by increasing a couple of arrays by several bytes and adding half a dozen extra lines of code, suddenly DHCP crashes and sometimes the EtherTen doesn't seem to boot at all. If I leave out the DHCP call, everything else functions perfectly. I've read somewhere that the 32k limit can be reached by a sketch that falls a fair way short due to memory being used dynamically within functions. I have given up trying to find a bug in my code and the DHCP failure occurs before any of the menu code (including the additional lines that trigger it) has been executed anyway.
I have the following includes:
EEPROM.h
avr/eeprom.h
SPI.h
Ethernet.h
EthernetUdp.h

Has anyone encountered a simillar situation? Am I correct in assuming that complex tasks such as DHCP requests could fail due to lack of memory in a 23k sketch?

bfisher
Posts:7
Joined:Thu Jul 26, 2012 6:19 am

Re: etherten memory problem ?

Post by bfisher » Thu Aug 16, 2012 5:57 am

Has anyone gotten any more information or found out why this is happening? I'm still hanging with no idea how to fix this.

Post Reply