Pages: [1]   Go Down
Author Topic: Arduino Leonardo sketch size > 12kBytes too big  (Read 1067 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!
I have a problem with my Arduino Leonardo. If i want to upload a sketch
which is bigger than 12kBytes the RX led is always on and Windows says
"USB device isn't recognized". When the sketch size is under 12kBytes, e.g. 11,5 kBytes
the Arduino works very well without problems. The special Reset function (" hold the reset button while uploading ")
doesn't work and the Arduino Software doesn't report any errors or warnings!

Is there anyone who has the same problem or can help me to deal with it?

I'm using Windows 7 64bit and the Arduino Software Version 1.0.3
The Maximum sketch size of the Leonardo is 28672 Bytes


Thanks in advance ...


« Last Edit: January 22, 2013, 04:15:50 am by robin_de » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12286
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


How much SRAM does your > 12 KiB program use?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know. How can i check it out?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12286
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


http://playground.arduino.cc/Code/AvailableMemory
http://jeelabs.org/2011/05/22/atmega-memory-use/
http://www.faludi.com/examples/helpful-arduino-functions/

https://www.google.com/search?q=arduino+free+ram
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the Links!

I minimized my program code to a program size where my arduino works without problems and included the MemoryFree.h from your first Link.
On the Serial Monitor was written " freeMemory = 182". So i think that my RAM of the Arduino only had 182 Bytes free.
Is that enough RAM or can this small amount of free RAM leads to problems like i have mentioned in my first post ?

Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12286
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


You are welcome.

Is that enough RAM?

Maybe.  You have to determine the free space from the deepest stack depth (which can be extremely difficult).

Quote
Or can this small amount of free RAM leads to problems like i have mentioned in my first post ?

It can.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your support!

I will try to save some strings in the flash or eeprom memory!

If this not help i'll buy the Arduino Due because the SRAM of this Arduino Board will be big enough for my
application.

Logged

Pages: [1]   Go Up
Jump to: