Embedded Go as a toolchain, Pi Pico 2, Nintendo 64
It’s been a while since the last post on this blog. This doesn’t mean, however, that nothing has happened with the Embedded Go during this time. We have stable but rather slow progress.
Embedded Go 1.24
The Go 1.24 was merged into Embedded Go with all its language changes. Yes, as I’m writing these words the Go 1.25 has just been released, but Embedded Go is always a little behind.
Embedded Go as a toolchain
The big thing is the new release model. As Embedded Go has become an installable Go toolchain, we have moved away from binary releases. Now you can easily add Embedded Go to your Go compiler using only two commands:
go install github.com/embeddedgo/dl/go1.24.5-embedded@latest
go1.24.5-embedded download
Then set the GOTOOLCHAIN environment variable to go1.24.5-embedded. The most convenient place to set it is the go.env file which can be used as a per project configuration. With the configuration in file you have to set GOENV instead of GOTOOLCHAIN before use the go
command. You can avoid setting GOENV by using egtool build
instead of go build
if you just want to build your project (egtool will simply call go build
with the GOENV set to the path of the found go.env).
New tool: egtool
We have new tool that makes programming embedded targets much convenient. The egtool replaced emgo. It’s much cleaner and can do much more.
$ go install github.com/embeddedgo/tools/egtool@latest
$ egtool
Usage:
egtool COMMAND [ARGUMENTS]
Available commands:
bin convert an ELF file to a binary image
build run `go build` with GOENV set to the found go.env file
hex convert an ELF file to the Intel HEX format
imxmbr generate the MBR file for the I.MX RT106x microcontrollers
isrnames generate IRQ handler linknames according the imported irq package
load load the program / memory range stored in a file onto the device
uf2 convert an ELF file to the UF2 format
The most useful egtool command is load which currently supports RPi Pico 2, Teensy 4.x and STM32 microcontrollers connected via USB.
Pi Pico 2
We gained support for the wonderfull Raspberry Pi RP2350 microcontroller. Its both ARM cores will provide power to your goroutines. The number of supported peripherals is still modest (DMA, GPIO, IOMUX, SPI, UART) but this MCU will definitely be our workhorse due to its availability and features, so expect more in the near future.
Nintendo 64
Timur Çelik did a great job adding support for the Nintendo 64 CPU. What surprised me is that the MIPS64 from 1996 is supported by GOARCH=mips64 with very minimal changes.
The new toolchain based release model is also heavily influenced by Timur. He also did a lot to clean up and improve many aspects of Embedded Go.
If you are interested in the N64 homebrew development take a look at the github.com/clktmr/n64 repository.
The real N64 consoles are still quite cheap, still quite capable. They are also very easy to work with because they are the last cartridge based systems. There are easily available cartridges for programmes like SummerCart64 or PicoCart64. You can also work with an N64 emulator but the real hardware is what the Embedded Go is for.
Michał Derkacz