Where are my Frozen Modules ??

The official PYBD running MicroPython, and its accessories.
Target audience: Users with a PYBD
Post Reply
User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Where are my Frozen Modules ??

Post by devnull » Sat Nov 02, 2019 3:30 am

All my clones, updates and builds are controlled by several bash scripts, during the build process one of the scripts creates symbolic links to the modules folder:

i.e ports/stm32/modules

Code: Select all

ls modules   
jsondb.py  sh.py  wget.py  wlan.py  www.py
These links are there as they should be, and the ports/stm32/build-PYBD_SF6/frozen_mpy contains a .mpy file for each of my frozen modules:

Code: Select all

frozen_mpy# ls 
dht.mpy  jsondb.mpy  lcd160cr.mpy  lcd160cr_test.mpy  onewire.mpy  sh.mpy  wget.mpy  wlan.mpy  www.mpy
However after flashing the firmware none of my modules are available at the REPL and only the standard modules are there.

Code: Select all

>>> help('modules')
__main__          math              ucryptolib        uselect
_onewire          micropython       uctypes           usocket
_webrepl          network           uerrno            ussl
builtins          onewire           uhashlib          ustruct
cmath             pyb               uheapq            utime
dht               stm               uio               utimeq
framebuf          sys               ujson             uwebsocket
gc                uarray            umachine          uzlib
lcd160cr          ubinascii         uos
lcd160cr_test     ubluetooth        urandom
lwip              ucollections      ure
Plus any modules on the filesystem
>>> 
Has something changed recently in how frozen modules are handled ???

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Where are my Frozen Modules ??

Post by pythoncoder » Sat Nov 02, 2019 7:03 am

Yes. Please read my attempt at explaining this - follow the link under fastbuild.
Peter Hinch
Index to my micropython libraries.

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

Re: Where are my Frozen Modules ??

Post by devnull » Sat Nov 02, 2019 11:21 am

Thanks Peter, that explains it very well, so it now uses a board-level manifest file instead of a device-level modules folder.

That now shifts the control down 1 level to the board instead of device.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Where are my Frozen Modules ??

Post by Roberthh » Sat Nov 02, 2019 11:32 am

You still can have the set of frozen modules at port level. That is the default. But using manifests also allow for board level control, and more, if you like.

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

Re: Where are my Frozen Modules ??

Post by devnull » Sat Nov 02, 2019 11:45 am

Hi Robert;

That does not seem to be the case, hence the first post ?!

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Where are my Frozen Modules ??

Post by Roberthh » Sat Nov 02, 2019 1:42 pm

Not this way, but:
if you want to keep your old structure, undefine FROZEN_MANIFEST and define FROZEN_MPY_DIR in your makefile.

If you want to have the new structure with on manifest file, just leave FROZEN_MANIFEST as it is. Then only manifest.py in the boards directory will be used.

After a bit of grumbling I accepted the new structure as improvement, since I can have sets of frozen files for different board variants, like Pyboard V1.1 and Pyboard D, or ESP32 with and without SPIRAM.

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

Re: Where are my Frozen Modules ??

Post by devnull » Sat Nov 02, 2019 11:38 pm

Hi Robert;

Thanks, how would you define that in GNUmakefile ?

What is the fastest way to keep it working as before ?

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

Re: Where are my Frozen Modules ??

Post by devnull » Sun Nov 03, 2019 12:57 am

OK, this does it in the make command, but how can I add this to GNUmakefile ?

Code: Select all

MAKE="make -j8 BOARD=PYBD_SF6 FROZEN_MANIFEST="" FROZEN_MPY_DIR=$UPYDIR/modules"

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

Re: Where are my Frozen Modules ??

Post by dhylands » Sun Nov 03, 2019 4:45 am

Creat a GNUmakefile which looks something like this:

Code: Select all

BOARD=PYBD_SF6
FROZEN_MANIFEST=""
FROZEN_MPY_DIR=$UPYDIR/modules"

include Makefile
and then just run

Code: Select all

make -j8
I normally add an $(info Executing GNUmakefile) or something to act as confirmation that my GNUmakefile is being used.

Post Reply