No File System After Build

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

No File System After Build

Post by devnull » Tue Dec 24, 2019 12:44 am

I've not used the ESP32 for several months and just built 1.12 for it and flashed it.

But it appears that there's no file system:

REPL

Code: Select all

MPY: soft reboot
could not find module '_boot.py'
MicroPython v1.12-5-g42e45bd69 on 2019-12-24; ESP32 module with ESP32
Type "help()" for more information.

>>> help('modules')
__main__          freesans20        uarray            urandom
_onewire          gc                ubinascii         ure
_thread           glcdfont          ubluetooth        uselect
_webrepl          hx711             ucollections      usocket
btree             jsondb            ucryptolib        ussl
builtins          machine           uctypes           ustruct
cmath             math              uerrno            utime
esp               micropython       uhashlib          utimeq
esp32             network           uhashlib          uwebsocket
fapac24           sh                uheapq            uzlib
flashbdev         sys               uio               wget
font10            tt14              ujson             wlan
font6             tt24              umqtt_simple      www
framebuf          tt32              uos
Plus any modules on the filesystem
>>> 

>>> import os
>>> os.listdir()
[]
>>> os.mkdir('lib')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 17] EEXIST
>>> os.mkdir('test')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 17] EEXIST
RSHELL

Code: Select all

/Volumes/dev/uPython/flash> cp test/moziot/moziot.py /pyboard; repl ~ import moziot
timed out or error in transfer to remote
Entering REPL. Use Control-X to exit.
repl_serial_to_stdout dev = <rshell.main.DeviceSerial object at 0x105284048>
alse
>
Have I missed something ???

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: No File System After Build

Post by devnull » Tue Dec 24, 2019 1:46 am

I think this is the key:

Code: Select all

could not find module '_boot.py'
I have just reverted back to November build f2ecfe8 and the problem does not exist.

I have added MICROPY_VFS_FAT=1 to my make command.
Last edited by devnull on Tue Dec 24, 2019 1:58 am, edited 1 time in total.

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: No File System After Build

Post by devnull » Tue Dec 24, 2019 1:57 am

OK, this is somehow related to the new method for defining overrides (viewtopic.php?f=2&t=7433) as when I re-build the f2ecfe8 file using the new method overrides, it has the problem, but when I flash using the old file built in November the problem is not there.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: No File System After Build

Post by jimmo » Tue Dec 24, 2019 2:25 am

The esp32 port uses python code to initialise the block device and filesystem (this is in _boot.py and other code in esp32/modules). Is it possible you're setting FROZEN_MANIFEST (or otherwise override the module freezing process) in a way that's preventing these modules from being frozen?

(Note this is different to stm32 where there are no "required" frozen modules)

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: No File System After Build

Post by jimmo » Tue Dec 24, 2019 2:29 am

Look at for example how the tinypico manifest (esp32/boards/TINYPICO/manifest.py) inherits from the base one.

(The ability to inherit/extend manifests was one of the main reasons for manifests -- on ports where you need to extend the set of frozen modules rather than just provide your own, the single directory approach didn't work very well)

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: No File System After Build

Post by devnull » Tue Dec 24, 2019 2:59 am

Thats very strange, I added an update before @jimmo posted but it does not seem to be updated !

anyway, the problem is caused by having a custom manifest file, and there are some files in the modules folder that are needed:

So this needs to be added to your custom frozen manifest file:

Code: Select all

freeze('$(PORT_DIR)/modules')

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: No File System After Build

Post by devnull » Tue Dec 24, 2019 3:04 am

How can I add a new path to the build so that I can also use it in related files line PORT_DIR

Code: Select all

freeze('$(PORT_DIR)/modules')
How can I add a new path i.e MY_DIR

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: No File System After Build

Post by devnull » Tue Dec 24, 2019 3:08 am

Look at for example how the tinypico manifest (esp32/boards/TINYPICO/manifest.py) inherits from the base one.
@jimmo Thanks, I just added that to the Build Secrets Post

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: No File System After Build

Post by jimmo » Tue Dec 24, 2019 3:40 am

devnull wrote:
Tue Dec 24, 2019 3:04 am
How can I add a new path to the build so that I can also use it in related files line PORT_DIR
I think it sounds like you want to add a new variable? Not currently supported.

But any path is relative to the current python file, so for the most part just using relative paths should work.

However if you have thoughts about how defining variables should work then please raise a bug. I'm not sure if it's possible to bring in any arbitrary makefile variable, but certainly environment variables?

(Although right now if you want to access env vars, nothing stops you using os.getenv in the manifest script).

Post Reply