Cannot upload to Trinket M0

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
grubba
 
Posts: 3
Joined: Sun Dec 19, 2010 2:26 pm

Cannot upload to Trinket M0

Post by grubba »

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 267 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 267 times

User avatar
dastels
 
Posts: 15667
Joined: Tue Oct 20, 2015 3:22 pm

Re: Cannot upload to Trinket M0

Post by dastels »

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

Dave

User avatar
grubba
 
Posts: 3
Joined: Sun Dec 19, 2010 2:26 pm

Re: Cannot upload to Trinket M0

Post by grubba »

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

<...>
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

User avatar
grubba
 
Posts: 3
Joined: Sun Dec 19, 2010 2:26 pm

Re: Cannot upload to Trinket M0

Post by grubba »

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

Waiting for the new upload port..
It then proceeds to flash it:

Code: Select all

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.

User avatar
dastels
 
Posts: 15667
Joined: Tue Oct 20, 2015 3:22 pm

Re: Cannot upload to Trinket M0

Post by dastels »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”