New M0 Adalogger not flashing (bossac, openocd)

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Jwdb
 
Posts: 3
Joined: Wed Oct 30, 2019 10:29 am

New M0 Adalogger not flashing (bossac, openocd)

Post by Jwdb »

I've been using M0 Adaloggers for a while now, successfully programming them via bossac or openocd + arm-gdb (developing in rust, so no Arduino environment). However, the most recent one I've purchased comes with the new UF2 bootloader and doesn't appear to be supported by bossac 1.9.1. I can connect to it via openocd (FT232H board) and query the flash information, but arm-gdb fails to flash the chip with error "Error erasing flash with vFlashErase packet". I have another M0, probably 2 years old, where the same openocd flash procedure works without complaint.

Does this have anything to do with the new bootloader, or is there something else going on with the board?

- Jw
$ bossac -p /dev/ttyACM0 -d -i
Set binary mode
version()=V#
Connected at 921600 baud
readWord(addr=0)=0x30303077
readWord(addr=0xe000ed00)=0x30303030
readWord(addr=0x400e0740)=0x23342c30
readWord(addr=0x400e0744)=0x30304577

Device unsupported
$ bossac -V
Basic Open Source SAM-BA Application (BOSSA) Version 1.9.1-8-g8202074
Flash programmer for Atmel SAM devices.
Copyright (c) 2011-2018 ShumaTech (http://www.shumatech.com)

User avatar
Jwdb
 
Posts: 3
Joined: Wed Oct 30, 2019 10:29 am

Re: New M0 Adalogger not flashing (bossac, openocd)

Post by Jwdb »

Also possibly related: reading the user dword at 0x804000, the value on my good board is fffffc5dd8e0c7ff, but on the new one is ffff005dd800c772. What stands out to me is that the reserved BOD12 bits are all zero. Could this also be the source of the issue, that the calibration is wrong and the cpu is constantly resetting itself?

Edit: scratch that last thought, as the device does show up properly as a disk drive when I plug it in, indicating the UF2 bootloader is running.

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: New M0 Adalogger not flashing (bossac, openocd)

Post by adafruit_support_mike »

Hmm.. our board support packages use bossac 1.8.0-48-gb176eee.

For the sake of comparison, try that version and see if it makes any difference.

User avatar
Jwdb
 
Posts: 3
Joined: Wed Oct 30, 2019 10:29 am

Re: New M0 Adalogger not flashing (bossac, openocd)

Post by Jwdb »

Will give it a shot, but I'll have to reflash the bootloader first. I found that the gdb/openocd vFlashErase error was due to the bootloader region being locked, and I've unlocked and erased it in the meantime.

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

Return to “Feather - Adafruit's lightweight platform”