
Embedded
TinyGo -gc=conservative vs -gc=leaking vs -gc=none for Firmware
Compare the TinyGo -gc=conservative, -gc=leaking and -gc=none garbage collector settings, what each costs, and which one fits a given firmware.
6 min read
Tag
5 posts

Compare the TinyGo -gc=conservative, -gc=leaking and -gc=none garbage collector settings, what each costs, and which one fits a given firmware.

Attach a handler to a pin edge with machine.Pin.SetInterrupt in TinyGo 0.37, keep the handler short with atomics, and debounce a button in the main loop.

Configure machine.I2C0 in TinyGo, scan the bus, read a chip ID register by hand, then read a BME280 with the tinygo.org/x/drivers package.

Install TinyGo 0.37, write a Go blinky for the Raspberry Pi Pico, put the board in BOOTSEL mode and flash it with tinygo flash -target=pico.

Compare TinyGo, Zig and Ada for microcontroller firmware: toolchains, blinky programs, memory models, interrupts, C interop and when to choose each.