Page 1 of 1

STM Where are the frozen modules place

Posted: Wed Oct 16, 2019 7:40 pm
by DJShadow1966
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

Re: STM Where are the frozen modules place

Posted: Wed Oct 16, 2019 9:14 pm
by DJShadow1966
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

Re: STM Where are the frozen modules place

Posted: Thu Oct 17, 2019 6:54 am
by DJShadow1966
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

manifest.py: how to use it?

Posted: Thu Oct 17, 2019 7:17 am
by pythoncoder
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?

Re: STM Where are the frozen modules place

Posted: Thu Oct 17, 2019 7:36 am
by DJShadow1966
Hello

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

Regards Mike

Re: STM Where are the frozen modules place

Posted: Thu Oct 17, 2019 8:21 am
by Roberthh
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.

The answer!

Posted: Thu Oct 17, 2019 5:48 pm
by pythoncoder
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.

Re: STM Where are the frozen modules place

Posted: Thu Oct 17, 2019 8:56 pm
by DJShadow1966
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

Re: STM Where are the frozen modules place

Posted: Fri Oct 18, 2019 3:13 am
by jimmo
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.

Re: STM Where are the frozen modules place

Posted: Fri Oct 18, 2019 1:44 pm
by jimmo
https://github.com/micropython/micropython/pull/5230 for the things I suggested in the previous post.