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
boot from SD but run from flash
Re: boot from SD but run from flash
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)
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)