Frozen Modules based on board

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
seemefirst@gamil.com
Posts: 15
Joined: Mon Jul 08, 2019 9:15 pm

Frozen Modules based on board

Post by seemefirst@gamil.com » Wed Sep 25, 2019 6:05 pm

Hello,

I was wondering if there is a way to include frozen files based on board. I am doing this on stm32 port. My understanding is that anything put in the ../ports/stm32/modules folder will be packed as frozen regardless of what board is compiled for. For example is there anyway to set the path for frozen modules in the board related configuration file/folder?

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

Re: Frozen Modules based on board

Post by dhylands » Wed Sep 25, 2019 8:03 pm

When you build your firmware image you can do:

Code: Select all

make BOARD=SOMEBOARD FROZEN_MPY_DIR=/path/to/some/directory
and this will override the use of the modules subdirectory.

seemefirst@gamil.com
Posts: 15
Joined: Mon Jul 08, 2019 9:15 pm

Re: Frozen Modules based on board

Post by seemefirst@gamil.com » Wed Sep 25, 2019 8:12 pm

Great Thanks,

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

Re: Frozen Modules based on board

Post by jimmo » Wed Sep 25, 2019 10:53 pm

You can also put FROZEN_MPY_DIR in your board-specific mpconfigboard.mk

This works well on STM32 because the default frozen modules are not required for board functioning, but on ESP32 you can't override the default ones. If you're interested, see https://github.com/micropython/micropython/pull/5084 for some early steps towards a future direction for additional board-level configuration of included resources.

Post Reply