0

Arduino UNO Ultimate GPS shield shield_sdlog fails
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Arduino UNO Ultimate GPS shield shield_sdlog fails

by pghbrad on Tue Dec 01, 2020 12:57 am

Hello,
I have an Ultimate GPS shield connected to a new Arduino UNO R3. When I load and run the shield_sdlog example, the output is simply:
Ultimate GPSlogger Shield
Couldnt create GPSLOG22.TXT

Note that I'm up to file number 22. An empty file does get created on the SD card each time it runs.
A number of the SD examples work fine such as: CardInfo, Datalogger, and ReadWrite.
Also, GPS examples seem to work fine like GPS_SoftwareSerial_Parsing as does the "direct" switch.
I have tried a few different SD cards, freshly formatted with SD Card Formatter to the same effect.
All of the header solder joints seem to test fine.

I notice the compile-time warning about "Low memory available, stability problems may occur" and wonder if the UNO is really up the task of GPS and SD logging.

Sincere thanks for any ideas.

pghbrad
 
Posts: 4
Joined: Tue Dec 01, 2020 12:10 am

Re: Arduino UNO Ultimate GPS shield shield_sdlog fails

by adafruit_support_bill on Tue Dec 01, 2020 7:13 am

The UNO has only 2K of SRAM. The Arduino system need about 500 bytes or so for general overhead & stack. The SD lib needs 512 bytes for the block buffer. Serial and Software Serial take 64 bytes each for ring buffers. Plus more for all the dynamically allocated variables. Not to mention all the memory needed for string processing.

So yes, the GPS + SD is really pushing the limit of the UNO.

https://learn.adafruit.com/memories-of- ... o-memories

adafruit_support_bill
 
Posts: 81583
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino UNO Ultimate GPS shield shield_sdlog fails

by pghbrad on Tue Dec 01, 2020 11:57 am

I can appreciate the limited amount of SRAM on the UNO (and that's a nice page to explain stack overflows), but the documentation implies that this will work.
https://learn.adafruit.com/adafruit-ult ... ger-shield : "This GPS shield works great with either UNO or Leonardo Arduinos and is designed to log data to an SD card."

Can anyone verify that this does work or has worked on an UNO? If it has worked in the past, are there any suggestions to "un-regress"?

Thanks!

pghbrad
 
Posts: 4
Joined: Tue Dec 01, 2020 12:10 am

Re: Arduino UNO Ultimate GPS shield shield_sdlog fails

by adafruit_support_bill on Tue Dec 01, 2020 12:50 pm

It has always been a tight fit on the UNO. And people typically start running into problems when adding functionality to the example sketch. But the example sketch was working at the time the guide was published.

It does look like there have been a number of additions to the GPS library over the years. It is possible that has pushed it over the limit.

Also, there are a number of SD libraries out there. Are you using the Adafruit branch or a different one?

adafruit_support_bill
 
Posts: 81583
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino UNO Ultimate GPS shield shield_sdlog fails

by pghbrad on Tue Dec 01, 2020 1:12 pm

I'm only loading the stock shield_sdlog example with no modifications.
I've tried with the stock Arduino SD library and with the Adafruit fork. The Adafruit fork used slightly more SRAM. The stock left 28 bytes free and the Adafruit left 18 bytes free.
I have also tried to trim all the debugging strings down, which got me to around 100 bytes free, but the result still didn't function.

pghbrad
 
Posts: 4
Joined: Tue Dec 01, 2020 12:10 am

Re: Arduino UNO Ultimate GPS shield shield_sdlog fails

by adafruit_support_bill on Tue Dec 01, 2020 2:03 pm

Even 100 bytes is not likely to work. Stack and heap requirements vary with the code. But much below 500 bytes typically spells trouble for programs of moderate complexity.

Looks like this is a known issue with recent versions of the SD library. Apparently the new functionality has outgrown some of the older AVR processors like the UNO.

Other users have successfully run using older versions of the library (11.3 or earlier). This is discussed in a thread here: viewtopic.php?f=31&t=163050#p802557

I will add a warning note to the guide.

adafruit_support_bill
 
Posts: 81583
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino UNO Ultimate GPS shield shield_sdlog fails

by pghbrad on Tue Dec 01, 2020 2:27 pm

I can verify that version 1.1.3 of the Adafruit GPS Library as suggested in the thread you pointed out works. It left 494 bytes free which still triggered the low memory warning, but the file was created on the SD card which contained logged data.

I agree that putting a note in the Overview and SD Logging sections of the tutorial would be helpful.

Thank you for your help!

pghbrad
 
Posts: 4
Joined: Tue Dec 01, 2020 12:10 am

Please be positive and constructive with your questions and comments.