OPENMV H7+ build error

Hello!

I followed the Linux installation instructions from this guide. Instead of cloning the main repository, I used my forked repo with git clone --recursive. I made no other changes apart from removing the models in src/lib/tflm/models and replacing them with my own.

When building the firmware for the board H7+ with TARGET=OPENMV4P, I encountered the following error:
openmv-/src/build/micropython/pins_OPENMV4P.c:1532:44: error: ‘pin_A15’ undeclared here (not in a function); did you mean ‘pin_A10’?
1532 | { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_PTR(pin_A15) },

openmv-/src/micropython/py/obj.h:348:24: note: in definition of macro ‘MP_ROM_PTR’
348 | #define MP_ROM_PTR(p) (p)

openmv-/src/build/micropython/pins_OPENMV4P.c:1545:44: error: ‘pin_D11’ undeclared here (not in a function); did you mean ‘pin_B11’?
1545 | { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(pin_D11) }

openmv-/src/micropython/py/obj.h:348:24: note: in definition of macro ‘MP_ROM_PTR’
348 | #define MP_ROM_PTR(p) (p)

openmv-/src/build/micropython/pins_OPENMV4P.c:1549:43: error: ‘pin_G3’ undeclared here (not in a function); did you mean ‘pin_A3’?
1549 | { MP_ROM_QSTR(MP_QSTR_G3), MP_ROM_PTR(pin_G3) },
openmv-/src/micropython/py/obj.h:348:24: note: in definition of macro ‘MP_ROM_PTR’
348 | #define MP_ROM_PTR(p) (p)

openmv-/src/build/micropython/pins_OPENMV4P.c:1550:43: error: ‘pin_G7’ undeclared here (not in a function); did you mean ‘pin_A0’?
1550 | { MP_ROM_QSTR(MP_QSTR_G7), MP_ROM_PTR(pin_G7) },
openmv-/src/micropython/py/obj.h:348:24: note: in definition of macro ‘MP_ROM_PTR’
348 | #define MP_ROM_PTR(p) (p)

Are these pins supposed to be declared for this board?
How can I resolve this issue?
Thank you for your assistance!

Hi, did you cd into src/micropython/mpy-cross and then make that before you built the firmware?

When in doubt, follow the automated build script steps: openmv/.github/workflows/firmware.yml at master · openmv/openmv

openmv/tools/client.py at master · openmv/openmv

Hello, yes, initially, I removed all .tflite and .txt files from the src/lib/tflm/models folder but kept the index.csv file since I was receiving following error.
openmv-/src/…/tools/tflite2c.py", line 84, in main

  • with open(os.path.join(args.input, “index.csv”), ‘r’) as file:*
    FileNotFoundError: [Errno 2] No such file or directory: ‘models/index.csv’
    FileNotFoundError: [Errno 2] No such file or directory: ‘models/index.csv’

After ensuring the index.csv file was present, I added my model and executed the following commands:
make -j$(nproc) -C src/micropython/mpy-cross

  • make -j$(nproc) TARGET=OPENMV4P*
    Despite these steps, I am still encountering the same issue of pins undeclared. I tried forcing Make to rebuild with -B switch as well.
    make -j$(nproc) -C src/micropython/mpy-cross -B
    same issue.

I’m not exactly sure what the error is. Please make sure you’ve setup everything like the github workflow does. I haven’t run into this particular error before. So, I don’t know what’s exactly wrong. However, the CI is not broken. So, if you follow exactly what it is doing and make sure your machine is setup like how it sets up the github runner then you should be able to compile.

After adding my models to the index.csv file (formatted similarly to the existing models), the errors disappeared, and the build was successful. The models were correctly added to the src/lib/tflm/models folder.