0

Arduino IDE loses PyGame after a couple of reloads.
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Arduino IDE loses PyGame after a couple of reloads.

by zencuke2 on Mon Sep 09, 2019 2:47 pm

Last weekend I started to actively code my PGame but ran into problems. I'm programming from a recent MacBook Pro (Thunderbolt USB-C) and started in Arduino. I tried the PyGame demo arcada_pygames_test. I made a copy and started playing, mostly changing the GUI lock and feel, i.e. colors and locations of various boxes and objects. First I wanted to understand the GFX calls. After a couple of downloads the IDE it started to have problems downloading. There were various errors and I'm sorry I didn't record them. Some combination of resest, double reset and power cyclling (nice switch) solved the problem for a while. Sometimes Arduino could load first time and sometimes not. It slowly degraded until double reset was always required. Then it stopped working altogether. Nothing worked. Double reset turned the row of LEDs all red but never showed the graphic I usually associate with boot mode. Single reset runs my last downoaded code which gives me confidence that the basic board works.

Two questions:

    The first question is an immediate one. Is there a lower level reset/boot reload/magic sequence I can do to cllear this and get me working again.
    Second: Is there documentation of the reset sequence for the various Adafruit boards? I thought I saw once but I can't find it.

Thanks,

-zencuke (aka steve morris)

PS
I have a second PyGame but until I figure out this one I am reluctant until I figure out what's wronge with this one. These are not chep boards.

PPS.
I have an older pre USB-C Macintosh I could dig out and experiment with if any thinks this would be helpful.

PPPS. Oops. I quit and restarted Arduino IDE several times but just realized as I mentally worked through the possibilities that I never restarted the Mac. I should have done that before asking for help. I'll try that when I get home.

zencuke2
 
Posts: 232
Joined: Sun Feb 15, 2015 2:40 pm

Re: Arduino IDE loses PyGame after a couple of reloads.

by zencuke2 on Mon Sep 09, 2019 9:58 pm

    *OK I rebooted the Macintosh. Same error. (See below. I recorded it this time.)
    * I then switched back to the original arcada_pygames_test to eliminate my changes from the mix. Same error. I'm out of ideas.
    * BTW: The red led blinks away about 2-3 beats peer second. It does that whether it is in boot mode or is running my last download.
    * No surprise. I no longer see the additional port either in the port menu list or with my trusty port finder 'ls -1 /dev/cu*'. I used to see this device.

Unless this can be fixed I now have a useless PyGamer board. The other is almost as useless because I'm afraid to touch it.

I heard someone say once in these forums that it is not a good idea to reply to your own post because Adafruit support people look for unanswered posts and might miss you if you answer yourself. I hope that isn't true. It seemed a little silly but... I thought it would save time to add the extra data points.

-steve

Error message below.

Arduino: 1.8.9 (Mac OS X), Board: "Adafruit PyGamer M4 Express (SAMD51), Enabled, 120 MHz (standard), Small (-Os) (standard), 50 MHz (standard), Arduino, Off"

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/smorris/Library/Arduino15/packages -hardware /Users/smorris/Dropbox/Arduino/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/smorris/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -

...

/dev/cu.MALS, /dev/cu.SOC, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.MALS, /dev/tty.SOC, } => {}
PORTS {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.MALS, /dev/cu.SOC, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.MALS, /dev/tty.SOC, } / {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.MALS, /dev/cu.SOC, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.MALS, /dev/tty.SOC, } => {}
Couldn't find a Board on the selected port. Check that you have the correct port selected. If it is correct, try pressing the board's reset button after initiating the upload.

zencuke2
 
Posts: 232
Joined: Sun Feb 15, 2015 2:40 pm

Re: Arduino IDE loses PyGame after a couple of reloads.

by zencuke2 on Mon Sep 09, 2019 10:20 pm

I take it back. The other PyGame is also dead the same way with the same symptoms. I forgot that I switched them in desperatiom Sunday trying to get some code written.

So I am out two pygame boards
    Adafruit PyGamer Starter KitAdafruit PyGamer Starter Kit PID: 4277$59.95 2 $119.90
    Adafruit Perma-Proto Half-sized Breadboard PCB - SingleAdafruit Perma-Proto Half-sized Breadboard PCB - Single PID: 1609$4.501 (1 FREE)$0.00
    SUBTOTAL$119.90
    UPS GROUND$10.15
    TAX$7.49
    TOTAL$137.54

[/list]

zencuke2
 
Posts: 232
Joined: Sun Feb 15, 2015 2:40 pm

Re: Arduino IDE loses PyGame after a couple of reloads.

by zencuke2 on Mon Sep 09, 2019 11:47 pm

I powered everything down and disconnected everything. Then I started over. Reconnect the Dock to the Mac, the PyGame to the docking station. /dev/cu.usbmodem2101 is back. Tried to download. Sigh!

PORTS {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.MALS, /dev/cu.SOC, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.MALS, /dev/tty.SOC, } / {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.MALS, /dev/cu.SOC, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.MALS, /dev/tty.SOC, } => {}
PORTS {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.MALS, /dev/cu.SOC, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.MALS, /dev/tty.SOC, } / {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.MALS, /dev/cu.SOC, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.MALS, /dev/tty.SOC, } => {}
PORTS {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.MALS, /dev/cu.SOC, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.MALS, /dev/tty.SOC, } / {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.MALS, /dev/cu.SOC, /dev/cu.usbmodem2101, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.MALS, /dev/tty.SOC, /dev/tty.usbmodem2101, } => {/dev/cu.usbmodem2101, /dev/tty.usbmodem2101, }
Found upload port: /dev/cu.usbmodem2101
/Users/smorris/Library/Arduino15/packages/arduino/tools/bossac/1.8.0-48-gb176eee/bossac -i -d --port=cu.usbmodem2101 -U -i --offset=0x4000 -w -v /var/folders/2t/6dql8wfs4hg3fycv7zhbhn880000gn/T/arduino_build_320013/arcada_pygamer_test.ino.bin -R
No device found on cu.usbmodem2101
Set binary mode
An error occurred while uploading the sketch

zencuke2
 
Posts: 232
Joined: Sun Feb 15, 2015 2:40 pm

Re: Arduino IDE loses PyGame after a couple of reloads.

by zencuke2 on Tue Sep 10, 2019 12:24 am

however double reset works again. Yeah! We're back to the error mode where double reset is required every download. I tried 4 times. Download from download button fails with above error, double reset, download works. Statistically significant I think. Probability of hitting an 8 event sequence at random is low. My PyGame is a double reset device noiw.

Annoying but much better than completely dead. I can do double reset forever if it keeps working that way, even if I need to power down and reseat USB and Thunderbolt cables every hour or so.

Hmm. Why does the battery flicker between 4.06-4.19 if there is no battery connected. Sorry. Unimportant and off point. There is probably a good reason.

Hmm2: I just downloaded my own code instead of the demo and it downloaded twice without a double reset. So much for my "statistically significant" arguement.

-steve

zencuke2
 
Posts: 232
Joined: Sun Feb 15, 2015 2:40 pm

Please be positive and constructive with your questions and comments.