Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade tinygo to v29.0.0 #6

Closed
wants to merge 65 commits into from

Conversation

rockwotj
Copy link

  • goenv: update to new v0.29.0 development version
  • ci: rename release-double-zipped to something more useful
  • os: define ErrNoDeadline
  • reflect: use .key() instead of a type assert
  • ci: update Node.js from version 14 to version 16
  • wasm: remove i64 workaround, use BigInt instead
  • example: simplify pininterrupt
  • nrf: wait for stop condition after reading from the I2C bus
  • machine/usb/hid,joystick: fix hidreport (3) (machine/usb/hid,joystick: fix hidreport (3) tinygo-org/tinygo#3802)
  • reflect: remove unecessary heap allocations
  • reflect: Add FieldByNameFunc
  • docker: update clang to version 15
  • reflect: fix iterating over maps with interface{} keys
  • compiler,reflect: NumMethods reports exported methods only
  • compiler: update .ll test output
  • example: adjust time offset
  • rp2040: add missing suffix to CMD_READ_STATUS
  • machine/macropad_rp2040: add machine.BUTTON
  • main: improve detection of filesystems
  • modules: add submodule for Renesas SVD file mirror repo
  • tools/gen-device-svd: small changes needed for Renesas MCUs
  • make: add make task to generate Renesas device wrappers
  • machine/samd51: fix i2cTimeout was decreasing due to cache activation
  • reflect: implement Value.Grow
  • wasi: allow zero inodes when reading directories
  • main: use go env instead of doing all detection manually
  • reflect: add SetZero
  • machine/rp2040: wait for 1000 us after flash reset to avoid issues with busy USB bus
  • machine.UART refactor (machine.UART refactor tinygo-org/tinygo#3832)
  • nrf: add I2C timeout
  • rp2040:add NoPin support
  • sync: add implementation from upstream Go for OnceFunc, OnceValue, and OnceValues
  • avr: pin change interrupt
  • wasm: fix functions exported through //export
  • compiler: add compiler-rt and wasm symbols to table
  • compiler: add compiler-rt to wasm.json
  • machine/usb: remove usbDescriptorConfig
  • machine/usb: allow USB Endpoint settings to be changed externally
  • machine/usb: refactor endpoint configuration
  • machine/usb/hid: add RxHandler interface
  • machine/usb/hid: rename Handler() to TxHandler()
  • testing: add Testing function
  • all: Go 1.21 support
  • compiler: add min and max builtin support
  • compiler: implement clear builtin for slices
  • compiler: implement clear builtin for maps
  • compiler: improve panic message when a runtime call is unavailable
  • board: add AKIZUKI DENSHI AE-RP2040
  • all: use https for renesas submodule dev: on clean systems, git submodule update --init can have authn issues tinygo-org/tinygo#3856
  • Add support for HID Keyboard LEDs
  • builder: update message for max supported Go version
  • build: switch GH actions builds to use Go 1.21 final release
  • docker: use Go 1.21 for Docker dev container build
  • modules: update to go-serial package v1.6.0
  • rp2040: move flash related functions into separate file from C imports for correct LSP. Fixes gopls does not work for machine.Flash in rp2040 tinygo-org/tinygo#3852
  • main: add target JSON file in tinygo info output
  • loader: merge go.env file which is now required starting in Go 1.21 to correctly get required packages
  • samd51,rp2040,nrf528xx,stm32: implement watchdog
  • wasm: add support for GOOS=wasip1
  • adding new uf2 target for PCA10056 (adding new uf2 target for PCA10056 tinygo-org/tinygo#3765)
  • make: add task to check NodeJS version before running tests
  • nRF52: set SPI TX/RX lengths even data is empty. Fixes nRF52xxx spi.TX and empty parameter causes invalid operation tinygo-org/tinygo#3868 (nRF52: set SPI TX/RX lengths even data is empty. Fixes #3868 tinygo-org/tinygo#3877)
  • all: update version for 0.29 release
  • docs: update CHANGELOG for release 0.29

sago35 and others added 30 commits June 16, 2023 11:36
The Linux artifacts have clear names (linux-amd64-double-zipped etc),
but the MacOS and Windows ones didn't. This patch renames these artifact
names to be more readable, especially when downloading the artifacts.
This should be ever so slightly more efficient.
Node.js 14 is not maintained anymore, so we can drop support for it.
Browsers previously didn't support the WebAssembly i64 type, so we had
to work around that limitation by converting the LLVM i64 type to
something else. Some people used a pair of i32 values, but we used a
pointer to a stack allocated i64.

Now however, all major browsers and Node.js do support WebAssembly
BigInt integration so that i64 values can be passed back and forth
between WebAssembly and JavaScript easily. Therefore, I think the time
has come to drop support for this workaround.

For more information: https://v8.dev/features/wasm-bigint (note that
TinyGo has used a slightly different way of passing i64 values between
JS and Wasm).

For information on browser support: https://webassembly.org/roadmap/
Found while working on the PineTime. For some reason it still kind of
works in most cases, but I was hitting this issue when interacting with
two different I2C devices (the touch sensor and the BMA421).
* machine/usb/hid,joystick: fix hidreport (3) and handling of logical, usage, and physical minimum/maximum values
This adds FieldByNameFunc, which some libraries like reflect2 need.

For my usecase I could also just stub FieldByNameFunc to panic, but
figured that it would work OK to just make it work. I'm not sure if
the overhead to FieldByName using a closure is acceptable.

Signed-off-by: Tyler Rockwood <[email protected]>
This is a rewrite of how filesystems are detected. Specifically, it
fixes an issue on Linux where the location of the FAT filesystem can
vary between distributions (for example, we supported most distros by
checking two different paths, but NixOS uses a different path): it now
uses the data in /proc/mounts instead which should be universal.
This was added in Go 1.20 and becomes necessary for encoding/json in Go
1.21.
This replaces our own manual detection of various variables (GOROOT,
GOPATH, Go version) with a simple call to `go env`.

If the `go` command is not found:

    error: could not find 'go' command: executable file not found in $PATH

If the Go version is too old:

    error: requires go version 1.18 through 1.20, got go1.17

If the Go tool itself outputs an error (using GOROOT=foobar here):

    go: cannot find GOROOT directory: foobar

This does break the case where `go` wasn't available in $PATH but we
would detect it anyway (via some hardcoded OS-dependent paths). I'm not
sure we want to fix that: I think it's better to tell users "make sure
`go version` prints the right value" than to do some automagic detection
of Go binary locations.
This was added in Go 1.20 and is required by encoding/json starting with
Go 1.21.
* add gosched calls to UART

* add UART.flush() stubs for all supported architectures

* add comment un uart.go on flush functionality

* uart.writeByte as base of UART usage

* fix NXP having duplicate WriteByte

* fix writeByte not returning error on some platforms

* add flush method for fe310 device

* check for error in WriteByte call to writeByte
This commit adds I2C timeouts for nrf51 and nrf52 (but not yet for
others like nrf52840).

Tested on the PineTime, where I now got a timeout instead of hanging and
resetting due to a watchdog reset.
sago35 and others added 28 commits August 2, 2023 09:16
This is new in Go 1.21.
This should not happen under normal circumstances. It can still happen
when there is a mismatch between TinyGo version and the associated
runtime, or while developing the compiler package.
It looks like this on my system, for example:

    {
      "target": {
        "llvm-target": "aarch64-unknown-linux",
        "cpu": "generic",
        "features": "+neon",
        "goos": "linux",
        "goarch": "arm64",
        "build-tags": [
          "linux",
          "arm64"
        ],
        "gc": "precise",
        "scheduler": "tasks",
        "linker": "ld.lld",
        "rtlib": "compiler-rt",
        "libc": "musl",
        "default-stack-size": 65536,
        "ldflags": [
          "--gc-sections"
        ],
        "extra-files": [
          "src/runtime/asm_arm64.S",
          "src/internal/task/task_stack_arm64.S"
        ],
        "gdb": [
          "gdb"
        ],
        "flash-1200-bps-reset": "false"
      },
      "goroot": "/home/ayke/.cache/tinygo/goroot-23c311bcaa05f188affa3c42310aba343acc82562d5e5f04dea9d5b79ac35f7e",
      "goos": "linux",
      "goarch": "arm64",
      "goarm": "6",
      ...
    }

This can be very useful while working on the automatically generated
target object for example (in my case, GOOS=wasip1).
…o correctly get required packages

Signed-off-by: deadprogram <[email protected]>
This adds true GOOS=wasip1 support in addition to our existing
-target=wasi support. The old support for WASI isn't removed, but should
be treated as deprecated and will likely be removed eventually to reduce
the test burden.
targets: adding new uf2 target for PCA10056
tinygo-org#3877)

machine/hrf: Set SPI TX/RX lengths even data is empty. Fixes tinygo-org#3868
@CLAassistant
Copy link

CLAassistant commented Aug 25, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 16 committers have signed the CLA.

✅ rockwotj
❌ aykevl
❌ svrakitin
❌ ysoldak
❌ soypat
❌ radkomih
❌ sago35
❌ deadprogram
❌ Unrud
❌ charlie-haley
❌ kenbell
❌ jpconstantineau
❌ achille-roussel
❌ oxplot
❌ perttierkkila
❌ dgryski
You have signed the CLA already but the status is still pending? Let us recheck it.

@rockwotj rockwotj closed this Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nRF52xxx spi.TX and empty parameter causes invalid operation gopls does not work for machine.Flash in rp2040