How to compile cexample

Hello I am trying to compile some c code into the firmware. the micropython src has /example/cexample and on stock micropython it can be included with make USER_C_MODULES=../../examples/usercmodule

If i build the openmv version it compiles but does not include the usercmodule. Any help in modifying the make or any other suggestion to include cexample in openmv micropython appreciated. thanks

Hi, this has been described before on the forum. It’s pretty detailed on what you need to do. I’d appreciate if you search for the previous answer.

Also, you may wish to take a look at how py_lcd.c is compiled into the firmware. If you search for py_lcd and similar strings in the repo using grep you should get an idea on what you have to do.

Thanks for the reply. That is perfect i was just going through code trying to figure out what to copy. lcd might do the trick. I’ll search the forum again too I didn’t see anything the first time through with the cexample. Love the project

Note, all the files to compile the module an our in our Makefiles. However, you have to add the module name in the micropython/ports/stm32/mpconfigport.h for it to be seen in MicroPython.