Now what I am trying to do is when the Pyboard wakes up from sleep it runs the boot script on the flash memory which is fine. I then turn on a GPIO in that script which provides power to the attached SD card. I then want to mount that SD card and run the main.py file on that SD card. Is that possible?
I have tried the below code but it returns OSError: [Errno 19] ENODEV
Code: Select all
if pyb.SDCard().present():
os.mount(pyb.SDCard(), '/sd')
sys.path[1:1] = ['/sd', '/sd/lib'][code]
I am not entirely sure how the boot.py works but it seems that if the SD card is not present when that script first runs I can't mount the SD card afterwards? Is there a way around this issue? Thanks