Openmv build error with STM32Cube.AI

In 1.6 Step 4 - Compile↑ from
AI:How to add AI model to OpenMV ecosystem - stm32mcu

gives this error
make[1]: *** No rule to make target ‘/home/g…/openmv_workspace/openmv/src/build/micropython/modstm_qstr.h’, needed by ‘/home/g…/openmv_workspace/openmv/src/build/micropython/genhdr/qstrdefs.generated.h’. Stop.
omv/ports/stm32/ recipe for target ‘FIRMWARE_OBJS’ failed
make: *** [FIRMWARE_OBJS] Error 2

What am I doing wrong?

Thank you

You need to add the TARGET=OPENMV4 or etc. line to the make.

Thanks for your answer

It does not work. That I had tried.
g…@ubuntu:~/openmv_workspace/openmv/src$ make TARGET=OPENMV4 CUBEAI=1
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
make[1]: *** No rule to make target ‘/home/g…/openmv_workspace/openmv/src/build/micropython/modstm_qstr.h’, needed by ‘/home/g…/openmv_workspace/openmv/src/build/micropython/genhdr/qstrdefs.generated.h’. Stop.
omv/ports/stm32/ recipe for target ‘FIRMWARE_OBJS’ failed
make: *** [FIRMWARE_OBJS] Error 2

The file “modstm_qstr.h” does not exist, and “/mpy-cross make”, works ok

Is this tutorial very old?

Thank you

Yeah, we don’t maintain that ST code. You should email the person who committed it.

I think it’s about him, I can’t find the mail in the ST forum

So, do you recommend me to use TFLite?

I already have STM32Cube.IA running, for some models that don’t use cameras. And the TFLite core uses more memory and is less efficient, but i don’t know which is better with micropython.

micropython is new to me… What do you recommend?

Yes, use Edge Impulse. It’s the only solution that just works.

CUBEAI build was working the last time I checked, I made sure to maintain it, but it’s not easy to build. If I remember correctly you need to get the right cubeai version, a newer one or something like that, but that error doesn’t seem related to cubeai… Can you build the firmware without CUBEAI=1 first ? See

I tried it without CUBEAI=1 and it didn’t work.

So, if I have a .tflite, I can’t test it with OpenMV?

I have made models in TFLite and I need to embed this firmware in an STM32H7 environment. And I thought to use OpenMV to test the models that have a camera. And for this Edge impulse makes things more difficult for me, the expert mode is very complicated.

I didn’t buy the B-CAMS-OMV module and I bought an OpenMV for the FLiR camera… Please, can you help me.


Follow this…

I also have an issue with the CUBEAI, however the error I get is “execvp: arm-none-eabi-as: Permission denied”.

Also I have a tflite model, is there a way to use tflite to make predictions on array in openmv? What I see in the documentation is the tf.classify function which seems to be for only images. If not, how can I make the cube AI work?


Hi, we can add support for arrays in OpenMV. This is not hard. Please make a bug ticket for it.

I get is “execvp: arm-none-eabi-as: Permission denied”.

Also unrelated to CUBE.AI, seems to be an issue with your toolchain. I’d suggest that you get the basic firmware build working first before trying to build with CUBE.AI enabled. We have very detailed documentation on building firmware, I suggest you start there.

So I was able to build successfully without the cube.AI and follwing your documentation, however following the tutorial and trying to build with cube.AI in the directory they gave I get this error. How do I fix this

Ah yes that macro changed recently, just change the last line in this file stm32cubeai/py_st_nn.c from



MP_REGISTER_MODULE(MP_QSTR_nn_st, nn_st_module);

I’ll commit that fix later.

Thanks, that fixed it…but it seems that also only makes predictions on images?

Hi, please how long will it take for this feature to be available

I don’t know what it does really, STM contributed it, we’re just trying to maintain it.

Ok, do you know how long it will take for openmv to support making predictions on array, I tried with the cubeAI library but seems to only suport for images.

Hi, I have list of other things that are higher priority for me than this right now. I will mark it as a new feature that’s wanted but I can’t give an estimate.