Trouble with SD Card
Re: Trouble with SD Card
If you plug in the SD card while PYBoard is running, it will not be recognized. You have to reboot PyBoard, e.g. with Ctrl-D. or pushing the reset button.
-
- Posts: 7
- Joined: Mon Jun 20, 2016 9:23 am
Re: Trouble with SD Card
But if I reset the board, system will boot from SD Card. So, I need to put my code into SD Card. I don't want this. In my project, user will be able to insert or remove SD Card while board is running. The user/operator might delete the code file. Is there any way to protect boot.py and main.py files?
Re: Trouble with SD Card
You could have a second SD card connected with SPI.
Re: Trouble with SD Card
What you're describing is expected behaviour.
MicroPython only checks if the sdcard is present during bootup, so at powerup time, or soft-reboot (perhaps using Control-D).
I tried your steps and I get the exact same behaviour. If I power on the board and then insert the sdcard then it won't be detected. If I press Control-D then it will be detected.
Similarly, once it's been detected, if you remove it and repeat the os.listdir('/') it will still be reported.
MicroPython only checks if the sdcard is present during bootup, so at powerup time, or soft-reboot (perhaps using Control-D).
I tried your steps and I get the exact same behaviour. If I power on the board and then insert the sdcard then it won't be detected. If I press Control-D then it will be detected.
Similarly, once it's been detected, if you remove it and repeat the os.listdir('/') it will still be reported.
Re: Trouble with SD Card
You can have a boot.py on the sdcard which just executes the boot.py from /flash. See: http://forum.micropython.org/viewtopic.php?f=2&t=865ahmet_cihan wrote:But if I reset the board, system will boot from SD Card. So, I need to put my code into SD Card. I don't want this. In my project, user will be able to insert or remove SD Card while board is running. The user/operator might delete the code file. Is there any way to protect boot.py and main.py files?
-
- Posts: 7
- Joined: Mon Jun 20, 2016 9:23 am
Re: Trouble with SD Card
Thank you Dave. That will solve my problem.
Re: Trouble with SD Card
Hi,
I am trying to get my pyboard 1.1 to boot from a Sandisk 16Gb sd card. It is single partition. formatted fat32 according to gparted. Micropython v1.10.
The pyboard does not recognize this to boot from. There is a boot.py on the sd card.
Should this work?
8-Dale
I am trying to get my pyboard 1.1 to boot from a Sandisk 16Gb sd card. It is single partition. formatted fat32 according to gparted. Micropython v1.10.
The pyboard does not recognize this to boot from. There is a boot.py on the sd card.
Should this work?
8-Dale