mocleiri / tensorflow-micropython-examples

A custom micropython firmware integrating tensorflow lite for microcontrollers and ulab to implement the tensorflow micro examples.
MIT License
170 stars 79 forks source link

Add Circuitpython compatibility #27

Open mocleiri opened 2 years ago

mocleiri commented 2 years ago

We should be able to copy the code from ulab which also has circuitpython support. It looks like you need to clone circuit python and then add a two links like this:

micropython-modules/microlite -> extmod/microlite micropython-modules/audio_frontend -> extmod/audio_frontend

It would be similiar to this: https://github.com/v923z/micropython-ulab/blob/1d9670096f093eae0a27437943dca088a27cc378/build-cp.sh#L41

We can try to use the version of ulab in circuit python but if that is a problem we can also make a symbolic link from:

micropython-ulab -> extmod/ulab

mocleiri commented 2 years ago

We could implement a unix port build like ulab does but probably we would need to wait for #28 to be implemented before we could target an actual device as that will reduce the firmware size by allowing us to select less operators.

mocleiri commented 2 years ago

There are problems with the Nucleo H743ZI2 Micropython port.

I do have it building but need to build the CI for it and also get the esp32 port working with the new structure which builds tensorflow directly within the micropython submodule.

Once I have esp32 working again I should be able to proceed with the CircuitPython port which would probably have the same issues (board resetting when tflite model is loaded).

Or I may first try to get the rp2040 port working or the teensy4 which are the other circuit python compatible boards I have.

mocleiri commented 2 years ago

The rp2 port works. I should add esp32s2 support and then move forward with the circuitpython integration work.