Граф коммитов

3731 коммит

Автор SHA1 Сообщение Дата
Ayke van Laethem
70f1a5429a esp32c3: update linker script to support binary blobs
To be able to link with the binary blobs that provide wifi and BLE, the
linker script needs a few tweaks.
2024-01-27 14:11:09 +01:00
Ayke van Laethem
2fb2113168 esp32c3: add more ROM functions
These functions are used by the binary blobs that implement wifi/BLE on
the ESP32-C3. While this is a lot of lines of linker script, I think
it's a good idea to add them here (instead of in a separate library)
because they're part of the ESP32-C3 hardware.
2024-01-27 14:11:09 +01:00
soypat
cb39611389 sync: implement trylock 2024-01-26 14:30:06 +01:00
Elias Naur
45764325b4 targets: add motor control pin definitions for MKS Nano V3x boards
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2024-01-23 21:04:22 +01:00
Elias Naur
bb66232164 targets: add support for the MKS Robin Nano V3.x
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2024-01-23 21:04:22 +01:00
Daniel Esteban
9679e7f1cc fix typo 2024-01-23 16:52:37 +01:00
Ayke van Laethem
6cdfc298cf all: switch to LLVM 17 by default 2024-01-20 10:50:42 +01:00
Ayke van Laethem
9a4bfd0e96 ci: fix sizediff error when changing the LLVM version 2024-01-20 10:50:42 +01:00
Ayke van Laethem
ee3106be98 reflect: update to Go 1.22 semantics
The IsZero function was changed slightly in Go 1.22, so we'll need to
update it.

While this could in theory break existing programs that rely on the old
behavior, they'd also break with the imminent Go 1.22 release so I don't
think this is a real problem.
2024-01-20 08:53:49 +01:00
Ayke van Laethem
57f49af726 loader: make sure Go version is plumbed through
This fixes the new loop variable behavior in Go 1.22.

Specifically:
  * The compiler (actually, the x/tools/go/ssa package) now correctly
    picks up the Go version.
  * If a module doesn't specify the Go version, the current Go version
    (from the `go` tool and standard library) is used. This fixes
    `go run`.
  * The tests in testdata/ that use a separate directory are now
    actually run in that directory. This makes it possible to use a
    go.mod file there.
  * There is a test to make sure old Go modules still work with the old
    Go behavior, even on a newer Go version.
2024-01-19 21:23:58 +01:00
Ayke van Laethem
38a80b45d3
all: support Go 1.22
This adds initial support for Go 1.22. Not all new features are
supported yet.
2024-01-19 13:51:40 +01:00
Ayke van Laethem
e9003e2deb
runtime: add runtime.rand function
This function is needed for Go 1.22, and is used from various packages
like math/rand.

When there is no random number generator available, it falls back to a
static sequence of numbers. I think this is fine, because as far as I
can see it is only used for non-cryptographic needs.
2024-01-19 13:46:27 +01:00
Ayke van Laethem
204659bdcd
reflect: add TypeFor[T]
This function was added in Go 1.22. See:
42d2dfb430
2024-01-19 13:46:27 +01:00
Ayke van Laethem
08ca1d13d0
loader: enforce Go language version in the type checker
This means for example that ranging over integers will only work when
setting the Go version to go1.22 or later in the go.mod file.
2024-01-19 13:46:27 +01:00
Ayke van Laethem
53db436a7d
cgo: add file AST for fake C file locations
This is needed for the type checker, otherwise it doesn't know which Go
version it should use for type checking.
2024-01-18 20:19:15 +01:00
Ayke van Laethem
0ad15551c8
compiler: update golang.org/x/tools/go/ssa package
This update includes support for the new range loops over integers.
2024-01-18 19:51:52 +01:00
Ayke van Laethem
afd65e224a
bytealg: update to Go 1.22
A few non-generic functions like HashStrBytes have been kept for
backwards compatibility, so this package should continue to work with
older Go versions (as long as they support generics).
2024-01-17 13:39:57 +01:00
deadprogram
5f50c3b60b machine/samd51: add UART hardware flow control support
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-17 12:41:15 +01:00
deadprogram
8858d49989 targets: add ninafw tag to Arduino mkrwifi1010 and Adafruit Matrix Portal M4 for drivers netlink support
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-15 19:34:05 -05:00
deadprogram
cf39d8b2c8 targets: add ninafw pins and settings to Adafruit PyBadge board with AirLift Featherwing
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-15 19:34:05 -05:00
deadprogram
d92a31b440 targets: add ninafw pins and settings to Adafruit Metro M4 Airlift board
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-15 19:34:05 -05:00
deadprogram
9c77a38358 build: use llvm-17 base image correctly for faster docker dev builds
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-12 19:23:33 +01:00
Ayke van Laethem
d0445d6f83 cgo: fix calling CGo callback inside generic function
The package of the generic function might not be set, so we have to call
Origin() for it.

Found while porting mcufont to TinyGo.
2024-01-12 14:54:42 +01:00
BCG
a40b11f535 Adding additional build tag for boards with ninafw 2024-01-07 16:06:16 +01:00
deadprogram
8c90f4facf machine/pyportal: add needed values to board file for ninafw BLE support
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-06 22:46:47 +01:00
deadprogram
c7c9a76af5 build: add step to build LLVM 17 base image
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-05 21:13:30 +01:00
Ayke van Laethem
6984af43a0 all: statically link to LLVM 17 instead of LLVM 16
We can now finally do it, now that Espressif has updated their fork.
2024-01-05 21:13:30 +01:00
deadprogram
81c56c3ab8 machine, targets: ninafw support for arduino-nano33 and nano-rp2040 boards
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-05 19:04:12 +01:00
deadprogram
3d9a1ca22a machine/samd21: add hardware flow control for UART
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-05 17:56:45 +01:00
deadprogram
c2083014b3 targets: add ninafw tag to nano-rp2040 for ninafw BLE support
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-03 23:28:28 -05:00
Scott Feldman
603a81f194 expose UART4 on wioterminal board
The right-hand grove port on the wioterminal can be used as UART, using
D0/D1 pins.  The pins D0/D1 are tied to SERCOM4, so this patch exposes a
UART4 for sercom4 access.

  RX = A0/D0 = PB08/SERCOM4.0 (port 4 pad 0)
  TX = A1/D1 = PB09/SERCOM4.1 (port 4 pad 1)

Tested with Lora E5 UART.

  uart : = machine.UART4
  tx := machine.D0
  rx := machine.D1

Note: must also cross Tx/Rx wires in grove cable.  See
https://www.lucadentella.it/en/2022/01/29/wio-terminal-porta-grove-di-destra-e-moduli-uart/
2023-12-31 10:54:11 +01:00
Elias Naur
cfc32794a7 os/user: add bare-bones implementation of the os/user package
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2023-12-30 10:56:23 +01:00
Elias Naur
1d9c53d00e nix: upgrade to NixOS 23.11
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2023-12-24 16:32:16 +01:00
Ayke van Laethem
8d2a07b927 main: add -serial=rtt support 2023-12-23 08:14:35 -05:00
deadprogram
ffe6dfd21b machine/nano-rp2040: add UART1 and correct mappings for NINA via UART.
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-20 16:51:21 -05:00
deadprogram
cf21380264 machine/serial, rp2040: add support for hardware flow control
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-20 16:48:12 -05:00
deadprogram
534b3b0c0b net: update to latest main branch with accept fix
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-19 08:16:40 +01:00
deadprogram
ceeb233ff6 build: another try to handle python unlink/link due to homebrew
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-18 20:23:19 +01:00
deadprogram
de3f0af829 build: fix for macos homebrew as discussed in https://github.com/Homebrew/brew/issues/15621
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-17 21:26:23 +01:00
Scott Feldman
a511f18c64
stub out more types/funcs to compile against golang.org/x/net/internal/socket (#4037)
* stub out more types/funcs to compile against golang.org/x/net/internal/socket

These are changes need to compile github.com/domainr/dnsr/ with TinyGo.
See issue https://github.com/tinygo-org/net/issues/14.

These change are mostly to fix missing symbols in src/crypto/tls and
src/net.  Missing types and functions are cut-and-pasted from go1.21.4.
Functions are stubbed out returning errors.New("not implemented").

DNRS is compiled by running tinygo test:

   sfeldma@nuc:~/work/dnsr$ tinygo test -target=wasi

With this patch, and a corresponding patch for tinygo-org/net to fixup
src/net, you should get a clean compile.
2023-12-17 15:32:53 +01:00
deadprogram
731bd5cd1b net: update to latest main branch with TCPListener
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-09 12:11:04 +01:00
deadprogram
4acf59546e modules: update net submodule to latest commit with http Client Transport interface
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-09 09:48:29 +01:00
deadprogram
2ee4d9aaa1 builder/picolib: add needed file for compiling math functions with error support.
Thanks to @aykevl for actually finding and providing this fix, I really just
reported the problem and tested the fix.

Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-09 07:47:27 +01:00
deadprogram
b58b7c59ae runtime: stub out Breakpoint() function
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-08 21:10:26 +01:00
deadprogram
e14b6a7009 lib/cmsis-svd: change to new repo location for the SVD files
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-07 14:38:36 +01:00
deadprogram
a1a2d1ab81 modules: switch to main branch of net submodule
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-06 13:11:44 +01:00
Scott Feldman
07591178cd move syscall constants for networking into net space to avoid windows build issue 2023-12-06 13:11:44 +01:00
Scott Feldman
43bdc888dd move IPPROTO_TLS to netdev to avoid src/syscall dependency 2023-12-06 13:11:44 +01:00
Scott Feldman
4229e670ce Add network device driver model, netdev
This PR adds a network device driver model called netdev. There will be a companion PR for TinyGo drivers to update the netdev drivers and network examples. This PR covers the core "net" package.

An RFC for the work is here: #tinygo-org/drivers#487. Some things have changed from the RFC, but nothing major.

The "net" package is a partial port of Go's "net" package, version 1.19.3. The src/net/README file has details on what is modified from Go's "net" package.

Most "net" features are working as they would in normal Go. TCP/UDP/TLS protocol support is there. As well as HTTP client and server support. Standard Go network packages such as golang.org/x/net/websockets and Paho MQTT client work as-is. Other packages are likely to work as-is.

Testing results are here (https://docs.google.com/spreadsheets/d/e/2PACX-1vT0cCjBvwXf9HJf6aJV2Sw198F2ief02gmbMV0sQocKT4y4RpfKv3dh6Jyew8lQW64FouZ8GwA2yjxI/pubhtml?gid=1013173032&single=true).
2023-12-06 13:11:44 +01:00
deadprogram
76a7ad2a3e modules: add tinygo net package as submodule
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-06 13:11:44 +01:00