Safe Mode always shows Internal Flash even with an SD Card

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
Markus Gritsch
Posts: 41
Joined: Fri May 16, 2014 9:04 pm

Safe Mode always shows Internal Flash even with an SD Card

Post by Markus Gritsch » Sat May 17, 2014 6:17 pm

When I use the pyboard with an SD card and activate the HID mode in the boot.py on the SD card, then there is no way to switch back to MSC mode. When booting into safe mode, the pyboard shows the internal flash as mass storage device, regardless if there is an SD card inserted or not.

Wouldn't it make more sense to show the SD card (if present) when safe mode is activated?

Should I open an Issue for that?

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Safe Mode always shows Internal Flash even with an SD Ca

Post by pfalcon » Sat May 17, 2014 8:45 pm

Would it be a safe mode then?
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

User avatar
Markus Gritsch
Posts: 41
Joined: Fri May 16, 2014 9:04 pm

Re: Safe Mode always shows Internal Flash even with an SD Ca

Post by Markus Gritsch » Sat May 17, 2014 8:53 pm

Well, IMO yes. Safe mode does not execute boot.py and main.py but just show a drive to the computer. Why do you consider it not safe to show the SD filesystem on the PC?

fma
Posts: 164
Joined: Wed Jan 01, 2014 5:38 pm
Location: France

Re: Safe Mode always shows Internal Flash even with an SD Ca

Post by fma » Sat May 17, 2014 9:28 pm

As you can remove the SD card to edit files externally, there is less interrest to show it in safe mode...
Frédéric

User avatar
Markus Gritsch
Posts: 41
Joined: Fri May 16, 2014 9:04 pm

Re: Safe Mode always shows Internal Flash even with an SD Ca

Post by Markus Gritsch » Sun May 18, 2014 5:48 am

But since you can remove the SD card it would equally work to show its content when it is inserted and show the internal flash when it is not inserted. Using a card reader every time to get out of HID mode is quite inconvenient.

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: Safe Mode always shows Internal Flash even with an SD Ca

Post by Damien » Tue Aug 12, 2014 10:56 am

I agree with Markus that it would make sense to show the SD card to the PC as the mass storage device, even in "safe mode". "Safe mode" would then mean: boot up as normal but don't execute any scripts. "Safe mode" was intended primarily so you can edit boot.py if you put something wrong in, or want to change, boot.py. So it makes sense that you can change boot.py on the SD card in safe mode.

The idea with having the SD card inserted is that it can completely (and transparently) replace the local flash storage. That is, you can put a set of boot.py, main.py, and other scripts on an SD card, and all pyboards would work the same with that SD card insterted, irrespective of what they have on the internal flash. The natural extension of this is that "safe mode" also treats the SD card as the replacement of the internal flash.

And anyway, as pointed out by Markus, you can just remove the SD card if you need to access boot.py on the flash. If you have physical access to the switches to enter safe mode, you also have access to take out the SD card.

Post Reply