Unable to compile my module into firmware

Hello guys,

I am trying to get my customized module compiled into the firmware, but failed. The main.py response module “hello” not found.

Source code of hello.py
def say():
print(“Hello!”)

Steps:

  1. git clone the latest openmv.
  2. put hello.py into openmv/scripts/libraries/
  3. cd to openmv/src
  4. execute: make TARGET=OPENMV4P -j6
  5. copy build/bin/* into local folder ~/.config/OpenMV/qtcreator/firmware/OPENMV4P/
  6. open openmv ide, and click the label of ‘Firmware Version’ to flash it.
  7. enter the following code into IDE
    import hello
    hello.say()
  8. and the IDE said no module named “hello”.

I checked twice for the md5 of the output firmware files, one the hello.py exists, and another I removed it. The md5 of binary files are the same, which inferring that the hello.py is not take effect.

Anything I got missed?

Yeah, don’t overwrite the IDE’s firmware in it’s config folder with your own…

Instead, use the Tools->Run Bootloader feature to select the firmware.bin file in the output bin directory…

You should never modify the IDE’s .config folder.

Otherwise your steps look right.

Thanks for guiding the proper approach of flashing the firmware.

The tricky question is, no matter whether I put the hello.py in openmv/scripts/libraries/ or not, the md5 of compiled firmware always the same. It should not be that, since I’ve made some changed (adding the new hello module) for the firmware, the output firmware.bin shouldn’t be exactly the same.

Ibrahim changed this, You have to use a manifest:

1 Like

Thanks Kwabena! By adding my module into the manifest file and compiled again, IT WORKS!!!