STM Where are the frozen modules place

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
DJShadow1966
Posts: 56
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

STM Where are the frozen modules place

Post by DJShadow1966 » Wed Oct 16, 2019 7:40 pm

Hello

Since the latest release I am having issues with trying to find where the .py files go to include them with the firmware.

Mike

DJShadow1966
Posts: 56
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: STM Where are the frozen modules place

Post by DJShadow1966 » Wed Oct 16, 2019 9:14 pm

Hello

Managed to work it out after a lot of digging in the code had to add :- FROZEN_MPY_DIR="/home/sysadmin/modules" to get them to add.

Regards Mike

DJShadow1966
Posts: 56
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: STM Where are the frozen modules place

Post by DJShadow1966 » Thu Oct 17, 2019 6:54 am

Hello

Got mostly fix but with the build command I get the follow :-

Code: Select all


make BOARD=BLACK_F407VE MICROPY_PY_THREAD=1 FROZEN_MPY_DIR="/home/sysadmin/modules"

LINK build-BLACK_F407VE/firmware.elf
build-BLACK_F407VE/build-BLACK_F407VE/frozen_mpy.o:(.rodata.mp_frozen_mpy_content+0x0): multiple definition of `mp_frozen_mpy_content'
build-BLACK_F407VE/build-BLACK_F407VE/frozen_content.o:(.rodata.mp_frozen_mpy_content+0x0): first defined here
arm-none-eabi-ld: Warning: size of symbol `mp_frozen_mpy_content' changed from 16 in build-BLACK_F407VE/build-BLACK_F407VE/frozen_content.o to 104 in build-BLACK_F407VE/build-BLACK_F407VE/frozen_mpy.o
build-BLACK_F407VE/build-BLACK_F407VE/frozen_mpy.o:(.rodata.mp_frozen_mpy_names+0x0): multiple definition of `mp_frozen_mpy_names'
build-BLACK_F407VE/build-BLACK_F407VE/frozen_content.o:(.rodata.mp_frozen_mpy_names+0x0): first defined here
arm-none-eabi-ld: Warning: size of symbol `mp_frozen_mpy_names' changed from 49 in build-BLACK_F407VE/build-BLACK_F407VE/frozen_content.o to 283 in build-BLACK_F407VE/build-BLACK_F407VE/frozen_mpy.o
build-BLACK_F407VE/build-BLACK_F407VE/frozen_mpy.o:(.rodata.mp_qstr_frozen_const_pool+0x0): multiple definition of `mp_qstr_frozen_const_pool'
build-BLACK_F407VE/build-BLACK_F407VE/frozen_content.o:(.rodata.mp_qstr_frozen_const_pool+0x0): first defined here
arm-none-eabi-ld: Warning: size of symbol `mp_qstr_frozen_const_pool' changed from 632 in build-BLACK_F407VE/build-BLACK_F407VE/frozen_content.o to 3268 in build-BLACK_F407VE/build-BLACK_F407VE/frozen_mpy.o
Makefile:563: recipe for target 'build-BLACK_F407VE/firmware.elf' failed
make: *** [build-BLACK_F407VE/firmware.elf] Error 1
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
LINK build-BLACK_F407VE/firmware.elf
   text    data     bss     dec     hex filename
 443872      96   80236  524204   7ffac build-BLACK_F407VE/firmware.elf
The build has created the firmware files, is this anything to worry about ?
Regards Mike

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

manifest.py: how to use it?

Post by pythoncoder » Thu Oct 17, 2019 7:17 am

Are you sure it's creating firmware.dfu and firmware.elf? Because it isn't here.

The latest build has changed the way that frozen files are specified. It now uses a 'manifest.py' file in stm32/boards. I haven't yet figured out the implications of this but it's broken my build script. Perhaps @jimmo can advise?
Peter Hinch

DJShadow1966
Posts: 56
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: STM Where are the frozen modules place

Post by DJShadow1966 » Thu Oct 17, 2019 7:36 am

Hello

Yeah the files are in the build folder with the lastest time stamp.

Regards Mike

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

Re: STM Where are the frozen modules place

Post by Roberthh » Thu Oct 17, 2019 8:21 am

If both the manifest.py file and the old FROZEN_MPY_DIR are used, you get into that trouble. You have to set either one to an empty string. So set either

FROZEN_MPY_DIR =

or

FROZEN_MANIFEST =

In your specific makefile: GNUmakefile or makefile

I had a nice afternoon yesterday to figure out how to deal with the manifest files. I cannot see that using the manifest files is really an improvement. It is just different. In either mode you can have board-specific or application-specific frozen file sets.

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

The answer!

Post by pythoncoder » Thu Oct 17, 2019 5:48 pm

Thank you Robert. That's saved me a lot of time. :D

It would be good if @jimmo or @Damien explained the merits of the manifest. If you and I are puzzled, my guess is that we're not alone. It's a shame when hard work goes into developing new features which remain unused, either because users don't know they exist or because they don't understand their purpose or usage.
Peter Hinch

DJShadow1966
Posts: 56
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: STM Where are the frozen modules place

Post by DJShadow1966 » Thu Oct 17, 2019 8:56 pm

Hello

Managed to get it all sorted used the boards/manifest.py path as all I had to do is add the file path and the module, I like this of doing it. Just one module will not compile hay ho will look at it when I get a chance.

Mike

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

Re: STM Where are the frozen modules place

Post by jimmo » Fri Oct 18, 2019 3:13 am

Roberthh wrote:
Thu Oct 17, 2019 8:21 am
If both the manifest.py file and the old FROZEN_MPY_DIR are used, you get into that trouble. You have to set either one to an empty string.
Yep, this is what is causing the error shown. I think we should add a check to the makefile to ensure that if FROZEN_MANIFEST is set, that neither FROZEN_MPY_DIR nor FROZEN_DIR are set. Will do.
Roberthh wrote:
Thu Oct 17, 2019 8:21 am
I had a nice afternoon yesterday to figure out how to deal with the manifest files. I cannot see that using the manifest files is really an improvement. It is just different. In either mode you can have board-specific or application-specific frozen file sets.
The idea here is to provide a way to "nest" the configurations. i.e. before the manifests, there wasn't a nice way to customize frozen modules on ESP32 without also symlinking or copying all the files from ports/esp32/modules into your board-specific or app-specific modules directory.

(The same was true on STM32, but at least the board boots if you don't include stm32/modules, which just has some drivers that most people aren't using, whereas ESP32 and ESP8266 require these modules).

I agree though, this feature could use some documentation and I would really like to remove FROZEN_MPY_DIR and FROZEN_DIR, but I think we'll break too many people's config.

That said, we should definitely error out on the case described above, and probably add a deprecation warning if FROZEN_MPY_DIR or FROZEN_DIR are set.

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

Re: STM Where are the frozen modules place

Post by jimmo » Fri Oct 18, 2019 1:44 pm

https://github.com/micropython/micropython/pull/5230 for the things I suggested in the previous post.

Post Reply