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?
Safe Mode always shows Internal Flash even with an SD Card
- Markus Gritsch
- Posts: 41
- Joined: Fri May 16, 2014 9:04 pm
Re: Safe Mode always shows Internal Flash even with an SD Ca
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/
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/
- Markus Gritsch
- Posts: 41
- Joined: Fri May 16, 2014 9:04 pm
Re: Safe Mode always shows Internal Flash even with an SD Ca
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?
Re: Safe Mode always shows Internal Flash even with an SD Ca
As you can remove the SD card to edit files externally, there is less interrest to show it in safe mode...
Frédéric
- Markus Gritsch
- Posts: 41
- Joined: Fri May 16, 2014 9:04 pm
Re: Safe Mode always shows Internal Flash even with an SD Ca
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.
Re: Safe Mode always shows Internal Flash even with an SD Ca
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.
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.