Micro not loading sketch and/or sketch not running properly

by norlander on Wed Oct 30, 2013 11:10 am

The attached sketch is not loading properly or running properly.

Sometimes the sketch just won't load; geets stuck in "loading..." mode. Sometimes the sketch will run, but not have audio.

This may be a noob question, but I think I have run into something that is unique to the Micro. I can't find anything wrong logically with the code, albiet it may not be elegant or efficient. I am pretty sure the code is OK, as I can comment code out sections and have it run correctly. Then move the commented out code to another spot and comment out other code and it will still run; example in commenting in/out parts of the switch/case statement.

Is there some fundamental thing I am missing in how I have written the code? Is it too big? does it have too many Serial statements? Are the interrupts for SD Card audio hapening too quickly?

I just don't quite understand the problem.

In the attached, version 7 works fine and version 8 doesn't.

thank you
Krist
Attachments
sketchs.zip
sample sketches
(6.66 KiB) Downloaded 3 times
norlander
 
Posts: 19
Joined: Tue Oct 15, 2013 10:53 am

Re: Micro not loading sketch and/or sketch not running prope

by adafruit_support_mike on Wed Oct 30, 2013 1:49 pm

The only two significant differences between version 7 and version 8 are the name of the file ('gday.mp3' -> 'watching.mp3') and the phrase it's supposed to say (5 -> 7).

The `sayPhrase()` function seems to be input-agnostic, so I'd guess the problem lies in the file 'watching.mp3'. First of all, try replacing it with a renamed copy of 'gday.mp3' and see if it's the name or the data that's causing the trouble.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 9008
Joined: Thu Feb 11, 2010 1:51 pm

Re: Micro not loading sketch and/or sketch not running prope

by norlander on Wed Oct 30, 2013 7:01 pm

That is exactly my frustration. I did that and verified it isn't the files or the name. I have been able to make all the files work. I did this by commenting and uncommenting sections of the switch/case. each case works as coded, but errors occur when whole switch/case is active. I didn't see anything in the logic of the code and println statements confirmed the logic flow is correct. But, I am obviously missing something. That is why I was concerned about sketch max size, baud rate, interrupt conflicts, serial ports, or something like that that is more behind the scenes of the code logic.
norlander
 
Posts: 19
Joined: Tue Oct 15, 2013 10:53 am

Re: Micro not loading sketch and/or sketch not running prope

by norlander on Wed Oct 30, 2013 7:04 pm

current immediate problem is Micro will not load a sketch. gets stuck in "uploading..." even on a simple blink sketch.
norlander
 
Posts: 19
Joined: Tue Oct 15, 2013 10:53 am

Re: Micro not loading sketch and/or sketch not running prope

by norlander on Wed Oct 30, 2013 7:29 pm

got Micro to load again. took several attempts at pushing reset button during compile/load sequence. verified, version 7 is working without problem still. got version 8 to run with hardcoded case select. going back to using random case select causes problems during load and/or runtime if I am able to get it to load.

just don't know why that would make a difference.
norlander
 
Posts: 19
Joined: Tue Oct 15, 2013 10:53 am

Re: Micro not loading sketch and/or sketch not running prope

by adafruit_support_mike on Thu Oct 31, 2013 1:38 am

It's possible that you're running into a memory issue. Try removing as many Serial.print()s as you can and see if that helps.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 9008
Joined: Thu Feb 11, 2010 1:51 pm

Re: Micro not loading sketch and/or sketch not running prope

by norlander on Wed May 28, 2014 12:57 am

that was the solution that fixed my problem. thank you.
norlander
 
Posts: 19
Joined: Tue Oct 15, 2013 10:53 am