Releases: tinygo-org/tinygo
0.28.0
This release is packed with features! Here are some highlights:
- Much improved reflect support, which means that many packages that previously didn't properly work are now mostly or entirely supported.
- Added
//go:wasmimport
following upstream Go. This is the supported way to import functions, other ways (//export
and the like) may stop working in the future.
This release also added support for several new boards, most notably our very own Gopher Badge developed by @conejoninja.
There are also two significant breaking changes for baremetal targets like microcontrollers: the runtime will now panic when an interrupt does a heap allocation inside an interrupt or when an interrupt does a blocking operation like a channel send. These were never correct, but might have accidentally worked in practice. If you hit one of these issues, TinyGo will usually print the source location where the problem originates when you use the -monitor
parameter on tinygo flash
. The fix for heap allocations is to restructure the code to not need them (for example, by using global variables) and the fix for blocking operations is to make them non-blocking, for example for a channel send:
select {
case someChan <- value:
default:
}
Of course, there is a very long list of smaller fixes and improvements, see the full list below:
- general
- fix parallelism in the compiler on Windows by building LLVM with thread support
- support qemu-user debugging
- make target JSON msd-volume-name an array
- print source location when a panic happens in -monitor
test
: don't printok
for a successful compile-only
- compiler
builder
: remove non-ThinLTO build modebuilder
: fail earlier if Go is not availablebuilder
: improve-size=full
in a number of waysbuilder
: implement Nordic DFU file writer in Gocgo
: allowLDFLAGS: --export=...
compiler
: support recursive slice typescompiler
: zero struct padding during map operationscompiler
: add llvm.ident metadatacompiler
: removeunsafe.Pointer(uintptr(v) + idx)
optimization (useunsafe.Add
instead)compiler
: add debug info to//go:embed
data structures for better-size
outputcompiler
: add debug info to string constantscompiler
: fix a minor race conditioncompiler
: emit correct alignment in debug info for global variablescompiler
: correctly generate reflect data for local named typescompiler
: add alloc attributes toruntime.alloc
, reducing flash usage slightlycompiler
: for interface maps, use the original named type if availablecompiler
: implement most math/bits functions as LLVM intrinsicscompiler
: ensure all defers have been seen before creating rundefers
- standard library
internal/task
: disallow blocking inside an interruptmachine
: addCPUReset
machine/usb/hid
: add MediaKey supportmachine/usb/hid/joystick
: move joystick under HIDmachine/usb/hid/joystick
: allow joystick settings overridemachine/usb/hid/joystick
: handle case where we cannot find the correct HID descriptormachine/usb/hid/mouse
: add support for mouse back and forwardmachine/usb
: add ability to override default VID, PID, manufacturer name, and product namenet
: added missingTCPAddr
andUDPAddr
implementationsos
: add IsTimeout functionos
: fix resource leak in(*File).Close
os
: add(*File).Sync
os
: implement(*File).ReadDir
for wasios
: implement(*File).WriteAt
reflect
: make sure null bytes are supported in tagsreflect
: refactor this package to enable many new featuresreflect
: add map type methods:Elem
andKey
reflect
: add map methods:MapIndex
,MapRange
/MapIter
,SetMapIndex
,MakeMap
,MapKeys
reflect
: add slice methods:Append
,MakeSlice
,Slice
,Slice3
,Copy
,Bytes
,SetLen
reflect
: add misc methods:Zero
,Addr
,UnsafeAddr
,OverflowFloat
,OverflowInt
,OverflowUint
,SetBytes
,Convert
,CanInt
,CanFloat
,CanComplex
,Comparable
reflect
: add type methods:String
,PkgPath
,FieldByName
,FieldByIndex
,NumMethod
reflect
: add stubs forType.Method
,CanConvert
,ArrayOf
,StructOf
,MapOf
reflect
: add stubs for channel select routines/typesreflect
: allow nil rawType to call Kind()reflect
: ensure all ValueError panics have Kind fieldsreflect
: add support for named typesreflect
: improveValue.String()
reflect
: setIndex
andPkgPath
field inType.Field
reflect
:Type.AssignableTo
: you can assign anything tointerface{}
reflect
: add type check toValue.Field
reflect
: letTypeOf(nil)
return nilreflect
: moveStructField.Anonymous
field to match upstream locationreflect
: addUnsafePointer
for Func typesreflect
:MapIter.Next
needs to allocate new keys/values every timereflect
: fixIsNil
for interfacesreflect
: fixType.Name
to return an empty string for non-named typesreflect
: addVisibleFields
reflect
: properly handle embedded structsreflect
: make surePointerTo
works for named typesreflect
:Set
: convert non-interface to interfacereflect
:Set
: fix direction of assignment checkreflect
: support channel directionsreflect
: print struct tags in Type.String()reflect
: properly handle read-only valuesruntime
: allow custom-gc SetFinalizer and clarify KeepAliveruntime
: implement KeepAlive using inline assemblyruntime
: check for heap allocations inside interruptsruntime
: properly turn pointer into empty interface when hashingruntime
: improve map size hint usageruntime
: zero map key/value on deletion to so GC doesn't see themruntime
: print the address where a panic happenedruntime/debug
: stubSetGCPercent
,BuildInfo.Settings
runtime/metrics
: add this package as a stubsyscall
:Stat_t
timespec fields are Atimespec on darwinsyscall
: addTimespec.Unix()
for wasisyscall
: add fsync using libctesting
: support -test.counttesting
: make test output unbuffered when verbosetesting
: add -test.skiptesting
: move runtime.GC() call to runN to match upstreamtesting
: add -test.shuffle to order randomize test and benchmark order
- targets
arm64
: fix register save/restore to include vector registersattiny1616
: add support for this chipcortexm
: refactor EnableInterrupts and DisableInterrupts to avoidarm.AsmFull
cortexm
: enable functions in RAM for go & cgocortexm
: convert SystemStack fromAsmFull
to C inline assemblycortexm
: fix crash due to wrong stack size offsetnrf, samd21, stm32
: add flash APInrf
: fix memory issue in ADC readnrf
: new peripheral type for nrf528xx chipsnrf, rp2040
: implement target modenrf
: improve ADC and add oversampling, longer sample time, and reference voltagerp2040
: change calling order for device enumeration fix to do firstrp2040
: rtc delayed interruptrp2040
: provide better errors for invalid pins on I2C and SPIrp2040
: change uart to allow for a single pinrp2040
: implement Flash interfacerp2040
: remove SPIDataBits
propertyrp2040
: unify all linker scripts using LDFLAGSrp2040
: remove SPI deadline for improved performancerp2040
: use 4MHz as default frequency for SPIrp2040
: implement target moderp2040
: use DMA for send-only SPI transferssamd21
: rearrange switch case for get pin cfgsamd21
: fix issue with WS2812 driver by making pin accesses fastersamd51
: enable CMCC cache for greatly improved performancesamd21
: remove extra BK0RDY clearsamd51
: implement Flash interfacesamd51
: use correct SPI frequencysamd51
: remove extra BK0RDY clearsamd51
: fix ADC multisamplingwasi
: allow users to set theruntime_memhash_tsip
orruntime_memhash_fnv
build tagswasi
: setWASMTIME_BACKTRACE_DETAILS
when running in wasmtime.wasm
: implement the//go:wasmimport
directive
- boards
gameboy-advance
: switch to use register definitions in device/gbagameboy-advance
: rename display and make pointer receiversgopher-badge
: Added Gopher Badge supportlorae5
: add needed definition for UART2lorae5
: correct mapping for I2C bus, add pin mapping to enable powerpinetime
: update the target file (rename from pinetime-devkit0)qtpy
: fix bad pin assignmentwioterminal
: fix pin definition of BCM13xiao
: Pins D4 & D5 are I2C1. Use pins D2 & D3 for I2C0.xiao
: add DefaultUART
0.27.0
This release adds support for Go 1.20 and LLVM 15. In addition, it drops a dependency on the AVR and Xtensa toolchains, so you don't need to install avr-gcc
or xtensa-esp32-elf-ld
making TinyGo much easier to install. Instead, it uses the built-in LLVM linker instead.
Newly supported targets are windows/arm64 (or "Windows on ARM64"), Waveshare RP2040 Zero, Arduino Leonardo, Adafruit KB2040, Adafruit Feather M0 Express, Makerfabs ESP32C3SPI35, and Espressif ESP32-C3-DevKit-RUST-1. As usual, there are also a ton of smaller fixes and improvements.
Here is a detailed changelog for this release:
- general
- all: update musl
- all: remove "acm:"` prefix for USB vid/pid pair
- all: add support for LLVM 15
- all: use DWARF version 4
- all: add initial (incomplete) support for Go 1.20
- all: add
-gc=custom
option main
: print ldflags including ThinLTO flags with -xmain
: fix error message when a serial port can't be accessedmain
: add-timeout
flag to allow setting how long TinyGo will try looking for a MSD volume for flashingtest
: print PASS on pass when running standalone test binariestest
: fix printing of benchmark outputtest
: print package name when compilation failed (not just when the test failed)
- compiler
- refactor to support LLVM 15
builder
: print compiler commands while building a librarycompiler
: fix stack overflow when creating recursive pointer types (fix for LLVM 15+ only)compiler
: allow map keys and values of ≥256 bytescgo
: add support forC.float
andC.double
cgo
: support anonymous enums included in multiple Go filescgo
: add support for bitwise operatorsinterp
: add support for constant icmp instructionstransform
: fix memory corruption issues
- standard library
machine/usb
: remove allocs in USB ISRmachine/usb
: addPort()
and deprecateNew()
to have the API better match the singleton that is actually being returnedmachine/usb
: change HID usage-maximum to 0xFFmachine/usb
: add USB HID joystick supportmachine/usb
: change to not send before endpoint initializationnet
: implementPipe
os
: add stub foros.Chtimes
reflect
: stub outType.FieldByIndex
reflect
: addValue.IsZero
methodreflect
: fix bug in.Field
method when the field fits in a pointer but the parent doesn'truntime
: switch somepanic()
calls in the gc toruntimePanic()
for consistencyruntime
: add xorshift-based fastrand64runtime
: fix alignment for arm64, arm, xtensa, riscvruntime
: implement precise GCruntime/debug
: stubPrintStack
sync
: implement simple pooling insync.Pool
syscall
: stubbedSetuid
, Exec and friendssyscall
: add more stubs as needed for Go 1.20 supporttesting
: implementt.Setenv
unsafe
: add support for Go 1.20 slice/string functions
- targets
all
: do not set stack size per boardall
: update picolibc to v1.7.9atsame5x
: fix CAN extendedID handlingatsame5x
: reduce heap allocationavr
: drop GNU toolchain dependencyavr
: fix .data initialization for binaries over 64kBavr
: support ThinLTObaremetal
: implements callocdarwin
: fixsyscall.Open
on darwin/arm64darwin
: fix error withtinygo lldb
esp
: use LLVM Xtensa linker instead of Espressif toolchainesp
: use ThinLTO for Xtensaesp32c3
: add SPI supportlinux
: include muslgetpagesize
function in releasenrf51
: add ADC implementationnrf52840
: add PDM supportriscv
: add "target-abi" metadata flagrp2040
: remove mem allocation in GPIO ISRrp2040
: avoid allocating clock on heaprp2040
: add basic GPIO support for PIOrp2040
: fix USB interrupt issuerp2040
: fix RP2040-E5 USB erratastm32
: always set ADC pins to pullups floatingstm32f1
,stm32f4
: fix ADC by clearing the correct bit for rank after each readstm32wl
: Fix incomplete RNG initialisationstm32wlx
: change order for init so clock speeds are set before peripheral startwasi
: makes wasmtime "run" explicitwasm
: fix GC scanning of allocaswasm
: allow custom malloc implementationwasm
: remove-wasm-abi=
flag (use-target
instead)wasm
: fix scanning of the stackwasm
: fix panic when allocating 0 bytes using mallocwasm
: always run wasm-opt even with-scheduler=none
wasm
: avoid miscompile with ThinLTOwasm
: allow the emulator to expand{tmpDir}
wasm
: support ThinLTOwindows
: update mingw-w64 version to avoid linker warningwindows
: add ARM64 support
- boards
- Add Waveshare RP2040 Zero
- Add Arduino Leonardo support
- Add Adafruit KB2040
- Add Adafruit Feather M0 Express
- Add Makerfabs ESP32C3SPI35 TFT Touchscreen board
- Add Espressif ESP32-C3-DevKit-RUST-1 board
lgt92
: fix OpenOCD configurationxiao-rp2040
: fix D9 and D10 constantsxiao-rp2040
: add pin definitions
0.26.0
This is another TinyGo release with many small changes, including over 110 commits.
This release introduces two possible breaking changes:
-
The
machine
package has had some changes in the public API, to remove some unintentionally exported constants. It is likely that very little real-world code is affected by this change. -
WebAssembly files could previously import functions by leaving a Go function unimplemented, like so:
func add(a, b int) int
This worked by accident. With this release, this is no longer possible. Instead, functions will need to be imported explicitly to avoid a compiler error:
//export add func add(a, b int) int
(The
//export
may be confusing, we intend to add a less-confusing//go:wasm-import
directive in the future).
Here is a detailed changelog for this release:
- general
- remove support for LLVM 13
- remove calls to deprecated ioutil package
- move from
os.IsFoo
toerrors.Is(err, ErrFoo)
- fix for builds using an Android host
- make interp timeout configurable from command line
- ignore ports with VID/PID if there is no candidates
- drop support for Go 1.16 and Go 1.17
- update serial package to v1.3.5 for latest bugfixes
- remove GOARM from
tinygo info
- add flag for setting the goroutine stack size
- add serial port monitoring functionality
- compiler
cgo
: implement support for static functionscgo
: fix panic when FuncType.Results is nilcompiler
: add aliases foredwards25519/field.feMul
andfield.feSquare
compiler
: fix incorrect DWARF type in some generic parameterscompiler
: use LLVM math builtins everywherecompiler
: replace some math operation bodies with LLVM intrinsicscompiler
: replace math aliases with intrinsicscompiler
: fixunsafe.Sizeof
for chan and map valuescompileopts
: use tags parser from buildutilcompileopts
: use backticks for regexp to avoid extra escapescompileopts
: fail fast on duplicate values in target field slicescompileopts
: fix windows/arm target triplecompileopts
: improve error handling when loading target/*.jsoncompileopts
: add support for stlink-dap programmercompileopts
: do not complain about-no-debug
on MacOSgoenv
: supportGOOS=android
interp
: fix reading from external globalloader
: fix link error forcrypto/internal/boring/sig.StandardCrypto
- standard library
- rename assembly files to .S extension
machine
: add PWM peripheral comments to pinsmachine
: improve UARTParity slightlymachine
: do not export DFU_MAGIC_* constants on nrf52840machine
: renamePinInputPullUp
/PinInputPullDown
machine
: addKHz
,MHz
,GHz
constants, deprecateTWI_FREQ_*
constantsmachine
: remove level triggered pin interruptsmachine
: do not exposeRESET_MAGIC_VALUE
machine
: useNoPin
constant where appropriate (instead of0
for example)net
: sync net.go with Go 1.18 stdlibos
: addSyscallError.Timeout
os
: addErrProcessDone
errorreflect
: implementCanInterface
and fix stringIndex
runtime
: makeMemStats
available to leaking collectorruntime
: addMemStats.TotalAlloc
runtime
: addMemStats.Mallocs
andFrees
runtime
: add support fortime.NewTimer
andtime.NewTicker
runtime
: implementresetTimer
runtime
: ensure some headroom for the GC to runruntime
: make gc and scheduler asserts settable with build tagsruntime/pprof
: addWriteHeapProfile
runtime/pprof
:runtime/trace
: stub some additional functionssync
: implementMap.LoadAndDelete
syscall
: group WASI consts by purposesyscall
: add WASI{D,R}SYNC
,NONBLOCK
FD flagssyscall
: add ENOTCONN on darwintesting
: add support for -benchmem
- targets
- remove USB vid/pid pair of bootloader
esp32c3
: remove unusedUARTStopBits
constantsnrf
: implementGetRNG
functionnrf
:rp2040
: addmachine.ReadTemperature
nrf52
: cleanup s140v6 and s140v7 uf2 targetsrp2040
: implement semi-random RNG based on ROSC based on pico-sdkwasm
: add summary of wasm examples and fix callback bugwasm
: do not allow undefined symbols (--allow-undefined
)wasm
: make sure buffers returned bymalloc
are kept untilfree
is calledwindows
: save and restore xmm registers when switching goroutines
- boards
- add Pimoroni's Tufty2040
- add XIAO ESP32C3
- add Adafruit QT2040
- add Adafruit QT Py RP2040
esp32c3-12f
:matrixportal-m4
:p1am-100
: remove duplicate build tagshifive1-qemu
: remove this emulated boardwioterminal
: add UART3 for RTL8720DNxiao-ble
: fix usbpid
0.25.0
This release improves USB support with new support for the RP2040 and MIDI, improves support for generics, fixes some bugs on darwin/arm64, and adds 3 new boards: the Challenger RP2040 LoRa, the MCH2022 badge, and the XIAO RP2040
- command line
- change to ignore PortReset failures
- compiler
compiler
: darwin/arm64 is aarch64, not armcompiler
: don't clobber X18 and FP registers on darwin/arm64compiler
: fix issue with methods on generic structscompiler
: do not try to build generic functionscompiler
: fix type names for generic named structscompiler
: fix multiple defined function issue for generic functionscompiler
: implementunsafe.Alignof
andunsafe.Sizeof
for generic code
- standard library
machine
: add DTR and RTS to Serialer interfacemachine
: reorder pin definitions to improve pin list on tinygo.orgmachine/usb
: add support for MIDImachine/usb
: adjust buffer alignment (samd21, samd51, nrf52840)machine/usb/midi
: addNoteOn
,NoteOff
, andSendCC
methodsmachine/usb/midi
: add definition of MIDI note numberruntime
: add benchmarks for memhashruntime
: add support for printing slices via print/println
- targets
avr
: fix some apparent mistake in atmega1280/atmega2560 pin constantsesp32
: provide hardware pin constantsesp32
: fix WDT reset on the MCH2022 badgeesp32
: optimize SPI transmitesp32c3
: provide hardware pin constantsesp8266
: provide hardware pin constants likeGPIO2
nrf51
: define and useP0_xx
constantsnrf52840
,samd21
,samd51
: unify bootloader entry processnrf52840
,samd21
,samd51
: change usbSetup and sendZlp to publicnrf52840
,samd21
,samd51
: refactor handleStandardSetup and initEndpointnrf52840
,samd21
,samd51
: improve usb-device initializationnrf52840
,samd21
,samd51
: move usbcdc to machine/usb/cdcrp2040
: add usb serial vendor/product IDrp2040
: add support for usbrp2040
: change default for serial to usbrp2040
: add support formachine.EnterBootloader
rp2040
: turn off pullup/down when input type is not specifiedrp2040
: make picoprobe default openocd interfacesamd51
: add support forDAC1
samd51
: improve TRNGwasm
: stubruntime.buffered
,runtime.getchar
wasi
: make leveldb runtime hash the default
- boards
- add Challenger RP2040 LoRa
- add MCH2022 badge
- add XIAO RP2040
clue
: remove pinsD21
..D28
feather-rp2040
,macropad-rp2040
: fix qspi-flash settingsxiao-ble
: add support for flash-1200-bps-resetgopherbot
,gopherbot2
: add these aliases to simplify for newer users
0.25.0-beta1
This is a pre-release of TinyGo v0.25.0
You will need to install manually by downloading files from here. The beta versions are not available on Homebrew for macOS, nor for Scoop on Windows.
0.24.0
This release adds a few pretty major features to TinyGo: the embed
package, recover()
(for most non-wasm architectures), and generics. It also adds initial (incomplete) support for Go 1.19, which is still in beta. Apart from that, we have the usual assortment of new features and bug fixes and we add the Badger 2040 board.
One possible breaking change is that we will now use a few newer WebAssembly features. If this is a problem, let us know and we can add a new target without these newer features. We use them because it lowers the binary size of the .wasm
files.
Here is the complete changelog:
- command line
- remove support for go 1.15
- remove support for LLVM 11 and LLVM 12
- add initial Go 1.19 beta support
test
: fix package/... syntax
- compiler
- add support for the embed package
builder
: improve error message for "command not found"builder
: add support for ThinLTO on MacOS and Windowsbuilder
: free LLVM objects after use, to reduce memory leakingbuilder
: improve-no-debug
error messagescgo
: be more strict: CGo now requires every Go file to import the headers it needscompiler
: alignof(func) is 1 pointer, not 2compiler
: add support for type parameters (aka generics)compiler
: implementrecover()
built-in functioncompiler
: support atomic, volatile, and LLVM memcpy-like functions in defercompiler
: drop support for macos syscalls via inline assemblyinterp
: do not try to interpret past task.Pause()interp
: fix some buggy localValue handlinginterp
: do not unroll loopstransform
: fix MakeGCStackSlots that caused a possible GC bug on WebAssembly
- standard library
os
: enable os.Stdin for baremetal targetreflect
: addValue.UnsafePointer
methodruntime
: scan GC globals conservatively on Windows, MacOS, Linux and Nintendo Switchruntime
: add per-map hash seedsruntime
: handle nil map write panicsruntime
: add stronger hash functionssyscall
: implementGetpagesize
- targets
atmega2560
: support UART1-3 + example for uartavr
: use compiler-rt for improved float64 supportavr
: simplify timer-based timeavr
: fix race condition in stack writedarwin
: add support forGOARCH=arm64
(aka Apple Silicon)darwin
: support-size=short
and-size=full
flagrp2040
: replace sleep 'busy loop' with timer alarmrp2040
: align api forPortMaskSet
,PortMaskClear
rp2040
: fix GPIO interruptssamd21
,samd51
,nrf52840
: add support for USBHID (keyboard / mouse)wasm
: update wasi-libc versionwasm
: use newer WebAssembly features
- boards
- add Badger 2040
matrixportal-m4
: attach USB DP to the correct pinteensy40
: add I2C supportwioterminal
: fix I2C definition
0.23.0
This release adds support for the recently released Go 1.18, although not for all language features yet. We have also added support for LLVM 14 which is the latest release of the compiler framework. Lots of improvements to the runtime and standard library support, especially when running in WASM/WASI environments. Also a whole bunch of bugfixes and improvements to our hardware support, in particular for the RP2040 processor.
The following new boards have been added this release:
Here is the complete list of changes:
- command line
- add
-work
flag - add Go 1.18 support
- add LLVM 14 support
run
: add support for command-line parametersbuild
: calculate default output path if-o
is not specifiedbuild
: add JSON outputtest
: support multiple test binaries with-c
test
: support flags like-v
on all targets (including emulated firmware)
- add
- compiler
- add support for ThinLTO
- use compiler-rt from LLVM
builder
: prefer GNU build ID over Go build ID for cachingbuilder
: add support for cross compiling to Darwinbuilder
: support machine outlining pass in stacksize calculationbuilder
: disable asynchronous unwind tablescompileopts
: fix emulator configuration on non-amd64 Linux architecturescompiler
: move allocations > 256 bytes to the heapcompiler
: fix incorrectunsafe.Alignof
on some 32-bit architecturescompiler
: accept alias for slicecap
builtincompiler
: allow slices of empty structscompiler
: fix difference in aliases in interface methodscompiler
: makeRawSyscall
an alias forSyscall
compiler
: remove support for memory references inAsmFull
loader
: only add Clang header path for CGotransform
: fix poison value in heap-to-stack transform
- standard library
internal/fuzz
: add this package as a shimos
: implement readdir for darwin and linuxos
: addDirFS
, which is used by many programs to access readdir.os
: isWine: be compatible with older versions of wine, tooos
: implementRemoveAll
os
: Use auintptr
forNewFile
os
: add stubs forexec.ExitError
andProcessState.ExitCode
os
: export correct values forDevNull
for each OSos
: improve support forSignal
by fixing various bugsos
: implementFile.Fd
methodos
: implementUserHomeDir
os
: addexec.ProcessState
stubos
: implementPipe
for darwinos
: define stubErrDeadlineExceeded
reflect
: add stubs for more missing methodsreflect
: renamereflect.Ptr
toreflect.Pointer
reflect
: addValue.FieldByIndexErr
stubruntime
: fix various small GC bugsruntime
: use memzero for leaking collector instead of manually zeroing objectsruntime
: implementmemhash
runtime
: implementfastrand
runtime
: add stub fordebug.ReadBuildInfo
runtime
: add stub forNumCPU
runtime
: don't inlineruntime.alloc
with-gc=leaking
runtime
: addVersion
runtime
: add stubs forNumCgoCall
andNumGoroutine
runtime
: stub {Lock,Unlock}OSThread on Windowsruntime
: be able to deal with a very small heapsyscall
: makeEnviron
return a copy of the environmentsyscall
: implement getpagesize and munmapsyscall
:wasi
: defineMAP_SHARED
andPROT_READ
syscall
: stub mmap(), munmap(), MAP_SHARED, PROT_READ, SIGBUS, etc. on nonhosted targetssyscall
: darwin: more complete list of signalssyscall
:wasi
: more complete list of signalssyscall
: stubWaitStatus
syscall/js
: allow copyBytesTo(Go|JS) to useUint8ClampedArray
testing
: implementTempDir
testing
: nudge type TB closer to upstream; should be a no-op change.testing
: on baremetal platforms, use simpler test matcher
- targets
atsamd
: fix usbcdc initialization when-serial=uart
atsamd51
: allow higher frequency when using SPIesp
: support CGoesp32c3
: add support for input pinesp32c3
: add support for GPIO interruptsesp32c3
: add support to receive UART datarp2040
: fix PWM bug at high frequencyrp2040
: fix some minor I2C bugsrp2040
: fix incorrect inline assemblyrp2040
: fix spurious i2c STOP during write+read transactionrp2040
: improve ADC supportwasi
: remove--export-dynamic
linker flagwasm
: remove heap allocator from wasi-libc
- boards
circuitplay-bluefruit
: move pin mappings so board can be compiled for WASM use in Playgroundesp32-c3-12f
: add the ESP32-C3-12f Kitm5stamp-c3
: add pin setting of UARTmacropad-rp2040
: add the Adafruit MacroPad RP2040 boardnano-33-ble
: typo in LPS22HB peripheral definition and documentation (#2579)teensy41
: add the Teensy 4.1 boardteensy40
: add ADC supportteensy40
: add SPI supportthingplus-rp2040
: add the SparkFun Thing Plus RP2040 boardwioterminal
: add DefaultUARTwioterminal
: verify written data when flashing through OpenOCDxiao-ble
: add XIAO BLE nRF52840 support
0.22.0
This release contains significantly improved standard library support with many more packages passing all tests. Especially the os package was improved a lot with many functions added to match the standard Go os package. In addition, we upgraded LLVM to LLVM 13, improved the build cache (no tinygo clean
anymore), and of course we've made various other improvements and bug fixes.
We've added the following boards this release:
- blues wireless Swan
- M5Stack
- M5Stamp C3
- Seeed LoRa-E5 Development Kit
- ST Micro STM32F469 "Discovery"
- ST Micro "Nucleo" WL55JC
- The Things Industries Generic Node Sensor Edition
Here are the changes in detail:
- command line
- add asyncify to scheduler flag help
- support -run for tests
- remove FreeBSD target support
- add LLVM 12 and LLVM 13 support, use LLVM 13 by default
- add support for ARM64 MacOS
- improve help
- check /run/media as well as /media on Linux for non-debian-based distros
test
: set cmd.Dir even when running emulatorsinfo
: add JSON output using the-json
flag
- compiler
builder
: fix off-by-one in size calculationbuilder
: handle concurrent library header renamebuilder
: use flock to avoid double-compilesbuilder
: use build ID as cache keybuilder
: add -fno-stack-protector to musl buildbuilder
: update clang header search path to look in /usr/libbuilder
: explicitly disable unwind tables for ARMcgo
: add support forC.CString
and related functionscompiler
: fix ranging over maps with particular map typescompiler
: add correct debug location to init instructionscompiler
: fix emission of large object layoutscompiler
: work around AVR atomics bugscompiler
: predeclare runtime.trackPointerinterp
: work around AVR function pointers in globalsinterp
: run goroutine starts and checks at runtimeinterp
: always run atomic and volatile loads/stores at runtimeinterp
: bump timeout to 180 secondsinterp
: handle type assertions on nil interfacesloader
: elminate goroot cache inconsistencyloader
: respect $GOROOT when runninggo list
transform
: allocate the correct amount of bytes in an allocatransform
: remove switched func lowering
- standard library
crypto/rand
: show error if platform has no rngdevice/*
: add*_Msk
field for each bit field and avoid duplicatesdevice/*
: provide Set/Get for each register field described in the SVD filesinternal/task
: swap stack chain when switching goroutinesinternal/task
: remove-scheduler=coroutines
machine
: addDevice
string constantnet
: add bare Interface implementationnet
: add net.Buffersos
: stub out support for some featuresos
: obey TMPDIR on unix, TMP on Windows, etcos
: implementReadAt
,Mkdir
,Remove
,Stat
,Lstat
,CreateTemp
,MkdirAll
,Chdir
,Chmod
,Clearenv
,Unsetenv
,Setenv
,MkdirTemp
,Rename
,Seek
,ExpandEnv
,Symlink
,Readlink
os
: implementFile.Stat
os
: fixIsNotExist
on nonexistent pathos
: fix opening files on WASI in read-only modeos
: work around lack ofsyscall.seek
on 386 and armreflect
: make sure indirect pointers are handled correctlyruntime
: allow comparing interfacesruntime
: use LLVM intrinsic to read the stack pointerruntime
: strengthen hashmap hash function for structs and arraysruntime
: fix float/complex hashingruntime
: fix nil map dereferenceruntime
: add realloc implementation to GCsruntime
: handle negative sleep timesruntime
: correct GC scan boundsruntime
: remove extalloc GCrumtime
: implement__sync
libcalls as critical sections for most microcontrollersruntime
: add stubs forFunc.FileLine
andFrame.PC
sync
: fix concurrent read-lock on write-locked RWMutexsync
: add a package docsync
: add testssyscall
: add support forMmap
andMprotect
syscall
: fix array size for mmap slice creationsyscall
: enableGetwd
in wasitesting
: add a stub forCoverMode
testing
: support -bench option to run benchmarks matching the given pattern.testing
: support b.SetBytes(); implement sub-benchmarks.testing
: replace spaces with underscores in test/benchmark names, as upstream doestesting
: implement testing.Cleanuptesting
: allow filtering subbenchmarks with the-bench
flagtesting
: implement-benchtime
flagtesting
: print durationtesting
: allow filtering of subtests using-run
- targets
all
: change LLVM features to match vanilla Clangavr
: use interrupt-based timer which is much more accuratenrf
: fix races in I2Csamd51
: implement TRNG for randomnessstm32
: pull-up on I2C linesstm32
: fix timeout for i2c commsstm32f4
,stm32f103
: initial implementation for ADCstm32f4
,stm32f7
,stm32l0x2
,stm32l4
,stm32l5
,stm32wl
: TRNG implementation in crypto/randstm32wl
: add I2C supportwindows
: add support for the-size=
flagwasm
: add support fortinygo test
wasi
,wasm
: raise default stack size to 16 KiB
- boards
- add M5Stack
- add lorae5 (stm32wle) support
- add Generic Node Sensor Edition
- add STM32F469 Discovery
- add M5Stamp C3
- add Blues Wireless Swan
bluepill
: add definitions for ADC pinsstm32f4disco
: add definitions for ADC pinsstm32l552ze
: use supported stlink interfacemicrobit-v2
: add some pin definitions
0.21.0
This release brings many small changes to the TinyGo compiler toolchain. Some of the highlights are: support for building Windows binaries in TinyGo, improved goroutine support on WebAssembly using Asyncify, and many small fixes that together get 12 more standard library packages to pass the package tests. Of course, there is also a number of improvements for microcontrollers such as ESP32-C3 and the RP2040. And lastly, we've added support for the M5Stack Core2 board.
- command line
- drop support for LLVM 10
build
: drop support for LLVM targets in the -target flagbuild
: fix paths in error messages on Windowsbuild
: add -p flag to set parallelismlldb
: implementtinygo lldb
subcommandtest
: use emulator exit code instead of parsing test outputtest
: pass testing arguments to wasmtime
- compiler
- use -opt flag for optimization level in CFlags (-Os, etc)
builder
: improve accuracy of the -size=full flagbuilder
: hardcode some more frame sizes for _aeabi* functionsbuilder
: add support for -size= flag for WebAssemblycgo
: fix line/column reporting in syntax error messagescgo
: support function definitions in CGo headerscgo
: implement rudimentary C array decayingcgo
: add support for stdio in picolibc and wasi-libccgo
: run CGo parser per file, not per CGo fragmentcompiler
: fix unintentionally exported math functionscompiler
: properly implement div and rem operationscompiler
: add support for recursive function typescompiler
: add support for thego
keyword on interface methodscompiler
: add minsize attribute for -Ozcompiler
: add "target-cpu" and "target-features" attributescompiler
: fix indices into strings and arrayscompiler
: fix string compare functionsinterp
: simplify some code to avoid some errorsinterp
: support recursive globals (like linked lists) in globalsinterp
: support constant globalsinterp
: fix reverting of extractvalue/insertvalue with multiple indicestransform
: work around renamed return type after merging LLVM modules
- standard library
internal/bytealg
: fix indexing error in Compare()machine
: support Pin.Get() function when the pin is configured as outputnet
,syscall
: Reduce code duplication by switching to internal/itoa.os
: don't try to read executable path on baremetalos
: implement Getwdos
: add File.WriteString and File.WriteAtreflect
: fix type.Size() to account for struct paddingreflect
: don't construct an interface-in-interface valuereflect
: implement Value.Elem() for interface valuesreflect
: fix Value.Index() in a specific casereflect
: add support for DeepEqualruntime
: add another set of invalid unicode runes to encodeUTF8()runtime
: only initialize os.runtime_args when neededruntime
: only use CRLF on baremetal systems for printlnruntime/debug
: stubdebug.SetMaxStack
runtime/debug
: stubdebug.Stack
testing
: add a stub for t.Parallel()testing
: add support for -test.short flagtesting
: stub B.ReportAllocs()testing
: addtesting.Verbose
testing
: stubtesting.AllocsPerRun
- targets
- fix gen-device-svd to handle 64-bit values
- add CPU and Features property to all targets
- match LLVM triple to the one Clang uses
atsam
: simplify definition of SERCOM UART, I2C and SPI peripheralsatsam
: move I2S0 to machine fileesp32
: fix SPI configurationesp32c3
: add support for GDB debuggingesp32c3
: add support for CPU interruptsesp32c3
: use tasks scheduler by defaultfe310
: increase CPU frequency from 16MHz to 320MHzfe310
: add support for bit banging driverslinux
: build static binaries using musllinux
: reduce binary size by callingwrite
instead ofputchar
linux
: add support for GOARMriscv
: implement 32-bit atomic operationsriscv
: align the heap to 16 bytesriscv
: switch to tasks-based schedulerrp2040
: add CPUFrequency()rp2040
: improve I2C baud rate configurationrp2040
: add pin interrupt APIrp2040
: refactor PWM code and fix Period calculationstm32f103
: fix SPIstm32f103
: make SPI frequency selection more flexibleqemu
: signal correct exit code to QEMUwasi
: run C/C++ constructors at startupwasm
: ensure heapptr is alignedwasm
: update wasi-libc dependencywasm
: wasi: use asyncifywasm
: support-scheduler=none
windows
: add support for Windows (amd64 only for now)
- boards
feather-stm32f405
,feather-rp2040
: add I2C pin namesm5stack-core2
: add M5Stack Core2nano-33-ble
: SoftDevice s140v7 supportnano-33-ble
: add constants for more on-board pins
0.20.0
This release adds support for Go 1.17, fixes a bunch of compiler bugs (especially for WebAssembly), and adds support for a few new boards including boards based on the ESP32-C3 chip.
- command line
- add support for Go 1.17
- improve Go version detection
- add support for the Black Magic Probe (BMP)
- add a flag for creating cpu profiles
- compiler
builder:
list libraries at the end of the linker commandbuilder:
strip debug information at link time instead of at compile timebuilder:
add missing error check forioutil.TempFile()
builder:
simplify running of jobscompiler:
move LLVM math builtin support into the compilercompiler:
move math aliases from the runtime to the compilercompiler:
add aliases for many hashing packagescompiler:
add*ssa.MakeSlice
bounds testscompiler:
fix max possible slicecompiler:
add support for new language features of Go 1.17compiler:
fix equally named structs in different scopescompiler:
avoid zero-sized alloca in channel operationsinterp:
don't ignore array indices for untyped objectsinterp:
keep reverted package initializers in orderinterp:
fix bug in compiler-time/run-time package initializersloader:
fix panic in CGo files with syntax errorstransform:
improve GC stack slot pass to work around a bug
- standard library
crypto/rand
: switch toarc4random_buf
math:
fixmath.Max
andmath.Min
math/big
: fix undefined symbols errornet:
add MAC address implementationos:
implementos.Executable
os:
addSEEK_SET
,SEEK_CUR
, andSEEK_END
reflect:
add StructField.IsExported methodruntime:
reset heapptr to heapStart after preinit()runtime:
addsubsections_via_symbols
to assembly files on darwintesting:
add subset implementation of Benchmarktesting:
test testing package usingtinygo test
testing:
add support for the-test.v
flag
- targets
386:
bump minimum requirement to the Pentium 4arm:
switch to Thumb instruction set on ARMatsamd:
fix copy-paste error for atsamd21/51 calibTrim blockbaremetal
,wasm
: support command line params and environment variablescortexm:
fix stack overflow because of unaligned stacksesp32c3:
add support for the ESP32-C3 from Espressifnrf52840:
fix ram sizenxpmk66f18:
fix a suspicious bitwise operationrp2040:
add SPI supportrp2040:
add I2C supportrp2040:
add PWM implementationrp2040:
add openocd configurationstm32:
add support for PortMask* functions for WS2812 supportunix:
fix time base for time.Now()unix:
check for mmap error and act accordinglywasm:
override dlmalloc heap implementation from wasi-libcwasm:
align heap to 16 byteswasm:
add support for the crypto/rand package
- boards
- add
DefaultUART
to adafruit boards arduino-mkrwifi1010:
add board definition for Arduino MKR WiFi 1010arduino-mkrwifi1010:
fix pin definition ofNINA_RESETN
feather-nrf52:
fix pin definition of uartfeather-rp2040:
add pin name definitiongameboy-advance:
fix ROM headermdbt50qrx-uf2:
add Raytac MDBT50Q-RX Dongle with TinyUF2nano-rp2040:
defineNINA_SPI
and fix wifinina pinsteensy40:
enable hardware UART reconfiguration, fix receive watermark interrupt
- add