
Is it possible to call boot.py from the internal flash with an SD card inserted?
Thanks in advance.
Chris
Code: Select all
import boot
Code: Select all
execfile('/flash/boot.py')
Code: Select all
execfile('/flash/boot.py')
I tried that but it didn't seem to do anything. I had /flash/boot.py with:blmorris wrote:I think that putting 'import boot' at the beginning of 'main.py' on your SD card will also work - /flash is on the import search path.
Code: Select all
import pyb
def boot_func():
print("Executing internal /flash/boot.py")
Code: Select all
Micro Python v1.3.10-103-g12d6d77 on 2015-02-26; PYBv1.0 with STM32F405RG
Type "help()" for more information.
>>> boot_func()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'boot_func' is not defined
>>> import boot
>>> boot_func()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'boot_func' is not defined
>>>