Microcontroller Targets

TinyGo was designed to run on microcontrollers, but the Go language wasn’t. This means there are a few challenges to writing Go code for microcontrollers.

Microcontrollers have very little RAM and execute code directly from flash. Also, constant globals are generally put in flash whenever possible. The Go language itself heavily relies on garbage collection so care must be taken to avoid dynamic memory allocation.


ARM Cortex-M processors are well supported. There is support for multiple chips and the backend appears to be stable. In fact, it uses the same underlying technology (LLVM) as the proprietary ARM compiler for code generation.


The AVR backend of LLVM is still experimental so you may encounter bugs.


Support to run TinyGo directly on the ESP8266/ESP32 chips should be possible once the needed support is added to LLVM. See the TinyGo FAQ for details.