boot from SD but run from flash

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
JimTal001
Posts: 176
Joined: Thu Jul 30, 2015 4:59 pm

boot from SD but run from flash

Post by JimTal001 » Thu May 26, 2016 5:40 pm

Currently, my data logger boots from SD card, runs a python script on the SD card and logs to SD card. I would like to change this to where the python script resides on internal flash but still logs on the SD card.

Assuming this is possible.
Is this how to point to an internal flash python script from the SD card's boot.py
pyb.main('/flash/datalogger.py') <---------- is this correct ?

And, in the script I would need to point to the SD card to log data, like:
mylogFile = "/sd/logs/data.txt" <-------------- is this correct ?

Finally, assuming no USB or serial connection, is it best to define the SD card as follows in the boot.py:
pyb.usb_mode('MSC')


Thanks
Jim

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: boot from SD but run from flash

Post by dhylands » Thu May 26, 2016 7:21 pm

Your paths look right to me.

I normally run with pyb.usb_mode('CDC') which just enables the usb-serial port.

If you really want to disable that you can use: pyb.usb_mode(None)

Post Reply