Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Safe Mode and no Bootloader on Metro M4
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Safe Mode and no Bootloader on Metro M4

by RumiTheIsotope on Wed Mar 18, 2020 2:49 pm

Things were going well with my Metro M4 project when I suddenly started having file system problems - most everything disappeared from the CircuitPy drive. Then I couldn't see the CircuitPy drive at all.

Since then, I've been trying to wipe the system and start over. I followed these directions for wiping:

>>> import storage
>>> storage.erase_filesystem()

That restored my CircuitPy drive with an empty lib folder and a few other things. However, I cannot get the bootloader drive to show. When I double-click the reset button, I get a "USB device not recognized" error in Windows 7. If I single-click the reset button, I get back to the CircuitPy drive. I was trying to re-copy the UF2 file but I can't get the bootloader drive to show up in to do that.

If I put some code on the CircuitPy drive and try to run it as it is now, I get the message that it is in safe mode.

I don't know how to get the Bootloader drive to come back or how to get it out of safe mode.

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Re: Safe Mode and no Bootloader on Metro M4

by RumiTheIsotope on Thu Mar 19, 2020 1:48 pm

Update: I got the boot partition to reappear and recopied the UF2 file to it. The DC Jack switch was "on" (jack was not being used). Once I switched it to "off" then the double-click of the reset button brought up the boot partition.

However, I am still stuck in safe mode. Here's the message that I get:

Running in safe mode! Not running saved code.

You are in safe mode: something unanticipated happened.
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.


Is there something that I can do to get it out of this mode? Writing new code and replacing code.py with it makes no difference.

Thanks.

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Re: Safe Mode and no Bootloader on Metro M4

by RumiTheIsotope on Thu Mar 19, 2020 1:54 pm

I should add that nothing is physically connected to the board at this time. It is just stuck in safe mode.

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Re: Safe Mode and no Bootloader on Metro M4

by tannewt on Fri Mar 20, 2020 1:58 pm

What version of CircuitPython did you copy over? What is in your code.py?

Glad you managed to get into the bootloader!

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

Re: Safe Mode and no Bootloader on Metro M4

by RumiTheIsotope on Sat Mar 21, 2020 2:23 pm

Thank you for your response.

I'm using CircuitPython 5.0 and made sure to use the libraries associated with 5.0

There's no code on the board right as it ignores anything I put on there. Right now code.py is just print("test") and it refuses to run it.

Abbreviated story: I had built a prototype and it worked for several days without any problems. Every single I/O pin on the board is used except for D13. 13 input switches, 8 digital outputs that control a media player, two pins that control an adafruit dotstar LED disk, and one analog output pin. Handed it over to a licensed electrician to build the wiring harnesses and do the final installation (it is part of a museum exhibit). The failure occurred during the installation process. I am speculating that perhaps two wires became shorted somewhere along the way to cause it to go into safe mode. Now the board sits bare, unattached to anything, with no code. But it stays in safe mode.

My previous experience with safe mode is that a reset usually starts normal operation again. But not this time.

I could post the original code if you think it would actually help.

Thanks!

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Re: Safe Mode and no Bootloader on Metro M4

by tannewt on Sun Mar 22, 2020 7:32 pm

Please post a picture of board so we can look for any damage.

Do you have a JLink? If you can get into the debugger then we can see when we're entering safe mode.

A copy of the CIRCUITPY contents would be good too.

I'm a bit surprised that it is hard faulting into safe mode. If it was damaged I'd expect the safe mode to be caused by a brown out failure.

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

Re: Safe Mode and no Bootloader on Metro M4

by RumiTheIsotope on Tue Mar 24, 2020 10:17 am

Well the board finally stopped communicating through the USB interface. We gave up on it and are now using a spare board that we had. I unfortunately do not have a debugger. I examined the board for any signs of damage through a magnifying lens but did not see anything obvious. But I'm guessing that there probably was physical damage of some kind. Thank you for your suggestions though.

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Please be positive and constructive with your questions and comments.