0

Cannot upload to Trinket M0
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Cannot upload to Trinket M0

by grubba on Fri Jul 23, 2021 5:34 pm

Tried everything I could think of. I run out of options.

* I've been programming these things for years
* I just "upgraded" (today) a Trinket ATtiny85 to a new Trinket M0
* Cables and everything else working with other microcontrollers
* Loaded proper board into the Arduino IDE
* Reset the board into bootloader mode (double click, RGB LED is green and red LED is pulsing)
* Serial port properly exposed and identified
* macOS 11.5

This should show everything is properly set:

Screen Shot 2021-07-23 at 5.03.28 PM.png
Screen Shot 2021-07-23 at 5.03.28 PM.png (571.03 KiB) Viewed 67 times


Get Board Info returns this:

Screen Shot 2021-07-23 at 5.17.25 PM.png
Screen Shot 2021-07-23 at 5.17.25 PM.png (145.44 KiB) Viewed 67 times
grubba
 
Posts: 3
Joined: Sun Dec 19, 2010 2:26 pm

Re: Cannot upload to Trinket M0

by dastels on Fri Jul 23, 2021 7:15 pm

Do you have both the Arduino SAMD board support package installed as well as the Adafruit SAMD package?

Dave

dastels
 
Posts: 7312
Joined: Tue Oct 20, 2015 3:22 pm

Re: Cannot upload to Trinket M0

by grubba on Fri Jul 23, 2021 11:37 pm

dastels wrote:Do you have both the Arduino SAMD board support package installed as well as the Adafruit SAMD package?


No, I usually don't use the Arduino IDE unless I'm experimenting with a new board (simpler that way). I installed it all from scratch. I also installed a new platformio environment where the adafruit_trinket_m0 is the only board. It seems to be having the same issue:

Code: Select all | TOGGLE FULL SIZE
<...>
Checking size .pio/build/adafruit_trinket_m0/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   8.1% (used 2640 bytes from 32768 bytes)
Flash: [          ]   4.1% (used 10840 bytes from 262144 bytes)
Configuring upload protocol...
AVAILABLE: atmel-ice, blackmagic, jlink, sam-ba
CURRENT: upload_protocol = sam-ba
Looking for upload port...
Auto-detected: /dev/cu.usbmodem101
Forcing reset using 1200bps open/close on port /dev/cu.usbmodem101
Waiting for the new upload port...
Uploading .pio/build/adafruit_trinket_m0/firmware.bin
No device found on cu.usbmodem101
*** [upload] Error 1
grubba
 
Posts: 3
Joined: Sun Dec 19, 2010 2:26 pm

Re: Cannot upload to Trinket M0

by grubba on Sat Jul 24, 2021 12:21 am

Found something. Resetting the board into bootloader mode doesn't seem to do anything. However, if I double click just when the code is trying to flash it, it works. That is, double click immediately after:

Code: Select all | TOGGLE FULL SIZE
Waiting for the new upload port..


It then proceeds to flash it:

Code: Select all | TOGGLE FULL SIZE
Uploading .pio/build/adafruit_trinket_m0/firmware.bin
Atmel SMART device 0x1001000a found
Erase flash
done in 0.847 seconds

Write 10840 bytes to flash (170 pages)

[===========                   ] 37% (64/170 pages)
[======================        ] 75% (128/170 pages)
[==============================] 100% (170/170 pages)
done in 0.075 seconds

Verify 10840 bytes of flash with checksum.
Verify successful
done in 0.014 seconds
CPU reset.
grubba
 
Posts: 3
Joined: Sun Dec 19, 2010 2:26 pm

Re: Cannot upload to Trinket M0

by dastels on Sat Jul 24, 2021 12:06 pm

My intent was that you should have both SAMD packages installed.

Ah yes, the magical reset dance will often to the trick. Also, make sure you don't have a terminal session open on the board's serial port. That will block uploading.

Dave

dastels
 
Posts: 7312
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.