Micro tvm supported device

How to add your own microcontroller in micro tvm?

Generally you don’t need to integrate your microcontroller into TVM, but in fact you can use TVM to generate code for your microcontroller and integrate it in your project. This is a tutorial that shows how:


However, you could also integrate the support for your microcontroller in TVM to use features like host-driven execution, autotuning, etc. microTVM categorizes microcontrollers support based on their RTOS/platform.

Currently, we support Zephyr and Arduino in our supported platforms. So, if your microcontroller is supported with one of these platform, you only need to make sure your CPU architecture is part of the listed targets in microTVM. That’s pretty much it!

If you are using a different platform, it is also very straightforward to add that platform to TVM. We use a concept in microTVM called project_api which is used to bring support for each platform like Zephyr to TVM without adding the overhead dependencies to TVM. This is an example for Zephyr:

The main step to bring this support for a different platform is to implement microtvm_api_server.py for your platform and implement the main API calls like generate_project, build, flash and open_transport.

1 Like

Thanks mehrdadh, But I confused when I am generating code for my microcontroller following the mentioned link.

We define the target by passing the board name to tvm.target.target.micro. # If your board is not included in the supported models, you can define the target such as: # TARGET = tvm.target.Target(“c -keys=arm_cpu,cpu -mcpu=cortex-m4”) TARGET = tvm.target.target.micro(“stm32l4r5zi”)

But my board is still not present in target.py tvm.target.Target(“c -keys=arm_cpu,cpu -mcpu=cortex-m4”)

so how can i write this line when my cpu is riscv ad the accelartor is some xyz tvm.target.Target("c -keys=riscv_cpu, cpu-mpcu=xyz)?