Home › Forums › Sparkfun MP3 Shield Library Support Forum › FilePlayer.ino Compiles but will not upload
Tagged: Bootloader
- This topic has 10 replies, 2 voices, and was last updated 8 years, 4 months ago by Michael P. Flaga.
-
AuthorPosts
-
July 5, 2016 at 3:41 pm #3548AnonymousInactive
Hello, I am using Windows Home 10 (64 bit), Arduino IDE 1.6.0, and good com drivers (verified as I can upload a bunch of other sketches). My problem is that I can not upload the FilePlayer.ino to my Arduino Uno.
When I compile the FilePlayer.ino it does so cleanly.
Sketch uses 30,048 bytes (93%) of program storage space. Maximum is 32,256 bytes.
Global variables use 987 bytes (48%) of dynamic memory, leaving 1,061 bytes for local variables. Maximum is 2,048 bytes.
When I go to verify/compile and upload I get the following message:
Sketch uses 30,048 bytes (93%) of program storage space. Maximum is 32,256 bytes.
Global variables use 987 bytes (48%) of dynamic memory, leaving 1,061 bytes for local variables. Maximum is 2,048 bytes.
avrdude: stk500_recv(): programmer is not responding
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
Your MP3Shield_Library_Demo.ino works fantastically, and I would stick with it, but I need to be able play more than just nine mp3 tracks. I have two projects that I am trying to complete, one requires about 20-30 tracks, and the other will be filled up to about 250 tracks.
July 6, 2016 at 8:14 am #3549Michael P. FlagaMemberhmm,
The symptom as described is a bit odd and not really coherent. The issue is that down loading has really nothing to do with compiling. I don’t have a Uno at hand this moment, to completely verify your statement.
However, something does come to mind; The more recent versions of SdFat Lib have deprecated a command used in the FilePlayer.ino, and such will fail to compile. The SFEMP3 repo has 20131225 inside it, which will compile.
Is it possible that your compile/verify environment is not the same as your compile/upload?
I may be able to find an Uno later today.
I would mention that I have never seen “<em style=”margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 13px; vertical-align: baseline; color: #9e9e9e; font-family: Arial; line-height: 19px; background: #fbfbfb;”>avrdude: stk500_recv(): programmer is not responding<span style=”line-height: 1.5;”>” as a result of source code. Rather the AVRDUDE not finding the serial port. Under File/Preferences check the Show Verbose output during compile and upload. You will likely see the debug of Avrdude sending out the poll messages. </span>
One thing can be that the Serial Port is busy or already in use. Another parent instance of Arduino may have it. Note that children from the same instance share it. But if the IDE is ran a 2nd time this can readily happen.
July 6, 2016 at 6:41 pm #3550AnonymousInactiveIf it helps, here is the information that is repeated back when I ask for verbose output in compilation & upload.
Using library SPI in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
Using library SdFat in folder: C:\Program Files (x86)\Arduino\libraries\SdFat (legacy)
Using library SFEMP3Shield in folder: C:\Program Files (x86)\Arduino\libraries\SFEMP3Shield (legacy)
C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10600 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI -IC:\Program Files (x86)\Arduino\libraries\SdFat -IC:\Program Files (x86)\Arduino\libraries\SFEMP3Shield C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\FilePlayer.cpp -o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\FilePlayer.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SPI\SPI.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\istream.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\MinimumSerial.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\ostream.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\Sd2Card.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdBaseFile.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdBaseFilePrint.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdFat.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdFatErrorPrint.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdFatUtil.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdFile.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdSpiArduino.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdSpiAVR.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdSpiMK20DX128.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdSpiSAM3X.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdStream.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdVolume.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SFEMP3Shield\SFEMP3Shield.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\hooks.c.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\WInterrupts.c.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\wiring.c.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\wiring_analog.c.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\wiring_digital.c.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\wiring_pulse.c.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\wiring_shift.c.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\abi.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\CDC.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\HardwareSerial.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\HardwareSerial0.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\HardwareSerial1.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\HardwareSerial2.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\HardwareSerial3.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\HID.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\IPAddress.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\main.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\new.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\Print.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\Stream.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\Tone.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\USBCore.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\WMath.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\WString.cpp.o
Using previously compiled file: C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\core.a
C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avr-gcc -w -Os -Wl,–gc-sections -mmcu=atmega328p -o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp/FilePlayer.cpp.elf C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\FilePlayer.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SPI\SPI.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\istream.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\MinimumSerial.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\ostream.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\Sd2Card.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdBaseFile.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdBaseFilePrint.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdFat.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdFatErrorPrint.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdFatUtil.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdFile.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdSpiArduino.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdSpiAVR.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdSpiMK20DX128.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdSpiSAM3X.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdStream.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SdFat\SdVolume.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp\SFEMP3Shield\SFEMP3Shield.cpp.o C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp/core.a -LC:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp -lm
C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avr-objcopy -O ihex -j .eeprom –set-section-flags=.eeprom=alloc,load –no-change-warnings –change-section-lma .eeprom=0 C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp/FilePlayer.cpp.elf C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp/FilePlayer.cpp.eep
C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avr-objcopy -O ihex -R .eeprom C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp/FilePlayer.cpp.elf C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp/FilePlayer.cpp.hex
Sketch uses 30,048 bytes (93%) of program storage space. Maximum is 32,256 bytes.
Global variables use 987 bytes (48%) of dynamic memory, leaving 1,061 bytes for local variables. Maximum is 2,048 bytes.
C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM5 -b115200 -D -Uflash:w:C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp/FilePlayer.cpp.hex:i
avrdude: Version 6.0.1, compiled on Apr 3 2014 at 23:12:16
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is “C:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf”
Using Port : COM5
Using Programmer : arduino
Overriding Baud Rate : 115200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
———– —- —– —– —- —— —— —- —— —– —– ———
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 3.3
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: reading input file “C:\Users\Tom\AppData\Local\Temp\build2301078848211232830.tmp/FilePlayer.cpp.hex”
avrdude: writing flash (30048 bytes):
Writing | ###############################################avrdude: stk500_recv(): programmer is not responding
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
July 6, 2016 at 7:06 pm #3552Michael P. FlagaMemberOk, it starts and get most of the way. or at least a big chunk. I suspect your UNO has some bad flash sector near the end. Or possibly a power issue. The key point is that it is starting then becoming not responsive. Try it on another PC, or use a powered HUB, or with the +12Vdc connected. Or try another Uno.
I have on a few occasions worn out my Flash, I test nearly every line of code and that means re-flashing the chip a huge amount. The Flash program memory only can be flashed 10,000 times. That sounds like a lot. But when I get going I flash it nearly 100 times a night for months on end and such have had some just die at some points of the flashing.
That usually yields a verify error. Here it is just loosing sync. So it may be a power issue over time or a bad version of bootloader.
hard to tell.
July 6, 2016 at 11:43 pm #3553AnonymousInactiveI would be shocked if this board has been flashed 100 times in total! It won’t be until maybe Monday that I could try out another Uno. In trying my ASUS laptop with only the Uno plugged into USB (fully charged and running on AC Power) it came up with the same issues.
Next week I’ll take my Uno down to my local Hacker Space and see if someone has a Pocket Programmer just to see if rebuilding the boot loader helps.
July 7, 2016 at 11:47 am #3554Michael P. FlagaMemberI got good news and bad news;
I went and got an UNO and SFEMP3 shield over lunch. So the good news is that it worked for me, from a fresh pull of the repo. It compiled, loaded, verified, ran. The menu’s worked and even played a file. I am using WIN7, Arduino IDE 1.6.7 and it compiled FilePlayer.ino using SdFatLib 20131225
Bad news is that I don’t know why yours is failing. I suspect it is not to do with the code itself. And still suspect some bad program space. I see the MP3Shield_Library_Demo.ino has a image size of 28164 bytes and the FilePlayer.ino has a size of 30016 bytes, some 1800 bytes larger. Or power on the Uno, perhaps there is local power issue with the supply to the 16U2. However, as you have not stated the COM port is not disappearing, then that is unlikely. So more likely an issue with the 328 itself. Either bootloader or power or bad flash.
July 9, 2016 at 12:30 am #3555AnonymousInactiveMichael, thank you for your guidance! Tonight I came home from work and decided to wire up one of Nano boards that I just got in the mail and thankfully FilePlayer.ino works pretty much as intended.
Presently I have 17 tracks loaded onto the SD Card, track001.mp3 to track017.mp3. When the Nano comes boots up it shows the directory list a little out of order. Is there a way to correct this?
Here is what it looks like on my screen:
Received command: l
Music Files Found :
00001: TRACK017.mp3
00002: TRACK001.mp3
00003: TRACK002.mp3
00004: TRACK003.mp3
00005: TRACK004.mp3
00006: TRACK005.mp3
00007: TRACK006.mp3
00008: TRACK007.mp3
00009: TRACK008.mp3
00010: TRACK009.mp3
00011: TRACK010.mp3
00012: TRACK011.mp3
00013: TRACK012.mp3
00014: TRACK013.mp3
00015: TRACK014.mp3
00016: TRACK015.mp3
00017: <span style=”line-height: 1.5;”>TRACK016</span><span style=”line-height: 1.5;”>.mp3
</span>Enter Index of File to play
Time since last command: 2.25
Enter s,1-9,+,-,>,<,f,F,d,i,p,t,S,b,m,e,r,R,g,k,O,o,D,V,B,C,T,E,M:,l,h :July 24, 2016 at 4:00 am #3558AnonymousInactiveToday was eventful, I took an old Core2Duo laptop out of the closet, formatted it down and installed Windows 7 fresh. Then installed Arduino 1.0.5-r2, and tried to upload the FilePlayer sketch to my UNOs, and still no joy. As you brought up, my com ports are stable, so I’ll go with the 328P chip needing to be replaced. I’ll order up a couple from Sparkfun or Adafruit next week.
I was able to find a generic OSEPP UNO R3 Plus from Fry’s Electronics in my travels today. It did take the FilePlayer code, and all is well. The track list is still as listed in my previous post. I’ll delete all of the files, set up the permanent ones on a pc hard drive, and then copy them over to the micro-SD at the same time, maybe that will make a difference. Otherwise, I’ll learn to deal with that curve-ball.
Just wanted to thank you again for your help!
July 24, 2016 at 1:14 pm #3559Michael P. FlagaMemberI thought I had responded earlier, about the ordering. The ATmega328 only has a few K of RAM. That is not enough to do a lot, noting the SdFat uses a huge chunk of that, leaving less. Take into consideration the above example directory dump is 220 bytes, to display the names of the 17 files is a 1/4K. Given that a Directory can have thousands of files, there is just not enough RAM to store all that and then sort it.
Rather the routine I implemented is typical for small micros, in that it operates ONE LINE at a TIME. printing that lines description and then reusing the RAM buffer for the next line. Where the selection is actually by its Offset in the list. Where the list is reproducibly presented by the SdCard. And the SdFAT lib function for dumping the Directory Listing is simply dumping the FAT, in the order it was created. Hence it is not sorted. So that it has infinite scalability.
Good Luck.
July 26, 2016 at 2:33 am #3560AnonymousInactiveSolved!! It was the Bootloader!
I followed the directions on https://www.arduino.cc/en/Tutorial/ArduinoISP and my two half dead UNOs are now up and running again. They both accepted the FilePlayer.ino file. Thank you!
July 26, 2016 at 11:55 am #3561Michael P. FlagaMemberI am glad to hear you solved it. Kudo’s for re-flashing the bootloader.
-
AuthorPosts
- You must be logged in to reply to this topic.