Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Issue Flashing Bootloader to Metro Express
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Issue Flashing Bootloader to Metro Express

by dtlepley on Mon Aug 28, 2017 1:34 pm

Hello,

I attempted to compile a custom version of the UF2 bootloader (changed volume label) and flash it to a Metro Express with a Segger J-Link and have encountered some issues.

1) The resulting output from the compilation was a .bin and .elf file which I attempted to flash using Atmel Studio and I got this message:

Step 1 Error.png
Step 1 Error.png (59.16 KiB) Viewed 343 times


2) Assuming that the issue was a result of my custom bootloader, I then attempted to flash the standard Zero bootloader, just to confirm my theory. This resulted in the similar error message.

Step 2 Error.png
Step 2 Error.png (53.96 KiB) Viewed 343 times


Questions:
1) Any idea what may be causing this issue?

2) Is flashing the resulting .elf file a mistake? Should it be a .hex?

3) Where can I find the stock MetroExpress bootloader so that I can attempt to flash my board back to factory settings?

Thanks,
Dave

dtlepley
 
Posts: 8
Joined: Sat Aug 26, 2017 1:48 pm

Re: Issue Flashing Bootloader to Metro Express

by tannewt on Mon Aug 28, 2017 2:41 pm

Hi Dave,
I can't help you with Atmel Studio. I usually use the GCC toolchain from command line. I usually load with GDB.

Here is an elf and bin file that I just built from the repo.
~Scott
Attachments
uf2-bootloader-1.23.0.zip
(82.97 KiB) Downloaded 27 times

tannewt
 
Posts: 1845
Joined: Thu Oct 06, 2016 8:48 pm

Re: Issue Flashing Bootloader to Metro Express

by dtlepley on Mon Aug 28, 2017 4:13 pm

Hello Scott,

I fumbled my way through Cygwin to build my custom version of the bootloader, and seem to have BIN and ELF files. Any insight on how to get my J-Link working to program it through the command line would be helpful.

-Dave

dtlepley
 
Posts: 8
Joined: Sat Aug 26, 2017 1:48 pm

Re: Issue Flashing Bootloader to Metro Express

by tannewt on Mon Aug 28, 2017 4:18 pm

I've got just the guide for you! https://learn.adafruit.com/debugging-th ... b/overview

The example is CircuitPython but the process is the same for the bootloader. Good luck!

tannewt
 
Posts: 1845
Joined: Thu Oct 06, 2016 8:48 pm

Re: Issue Flashing Bootloader to Metro Express

by dtlepley on Tue Aug 29, 2017 11:08 am

Hello Scott,

Made some progress with your tutorial, but still cant seem to successfully flash the bootloader. In the process of attempting it, I now have a second dead Metro Express! Below is the output from the command line when I attempted per the tutorial.

GDB Attempt 1 - page 1.png
GDB Attempt 1 - page 1.png (24.36 KiB) Viewed 283 times


GDB Attempt 1 - page 2.png
GDB Attempt 1 - page 2.png (29.7 KiB) Viewed 283 times


Any idea what could be causing this? Could some of the flash be locked? Also, at one point I did seem to load bootloader code on the board yesterday but it almost seemed to continuously watchdog, that could be related or not... Basically you could see the board LEDs toggle and Windows repeatedly "ding" as if new hardware had been plugged in...

Again, appreciate all the help.

-Dave

dtlepley
 
Posts: 8
Joined: Sat Aug 26, 2017 1:48 pm

Re: Issue Flashing Bootloader to Metro Express

by tannewt on Tue Aug 29, 2017 12:49 pm

I don't know why you got the first error.

You are right that the bootloader is protected. Theres a good blog post here on how to unlock it.

I'd recommend powering the Metro through the barrel jack and leaving it disconnected on USB until you want to test USB. I've uploaded misbehaving USB code and had the whole bus chug. Breaking in the debugger will also hang the USB bus.

I haven't seen repeated watchdog stuff. Have you changed anything in the bootloader yet?

Cheers,
Scott

tannewt
 
Posts: 1845
Joined: Thu Oct 06, 2016 8:48 pm

Re: Issue Flashing Bootloader to Metro Express

by dtlepley on Tue Aug 29, 2017 5:33 pm

Success restoring the original boot loader with other D.C. power and following the flash unlock from that post. I will report back success on custom boot loader. Thanks!

-Dave

dtlepley
 
Posts: 8
Joined: Sat Aug 26, 2017 1:48 pm

Re: Issue Flashing Bootloader to Metro Express

by tannewt on Tue Aug 29, 2017 7:23 pm

Yay! I'm glad it worked.

tannewt
 
Posts: 1845
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.