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

3776 коммитов

Автор SHA1 Сообщение Дата
Softonik
5cc0ba40b6 init_go: убрано отключение watchdog'a 2024-03-25 13:09:53 +03:00
Softonik
32025cd2e6 Добавлен Magefile.go 2024-03-24 04:14:50 +03:00
Softonik
f0b9f51481 Удалено неиспользуемое tinygo_scanCurrentStack 2024-03-24 04:12:36 +03:00
Softonik
3fe4d0f1c5 Работает!
Внутри процесса FreeRTOS
Heap и стек выделяются динамически и передаются в init_go()
Потом работают функции, требующие heap
Работает и GC! Когда память заканчивается - очистка и всё по-новой!
call_start_cpu0 переименован, чтобы не мешать основной прошивке
malloc/free убраны для того же
GC/scanstack требует текущий указатель стека, но выход в асм почему-то не работает.
Зато простая специальная функция делает это.
bss не инициализируется - т.к. это уже делает основная прошивка.
2024-03-24 03:24:56 +03:00
sago35
7c34f7704e goenv: update to new v0.32.0 development version 2024-03-04 19:29:26 +01:00
Randy Reddig
377415a6c3 runtime: add Frame.Entry field
This enables compatibility with golang.org/x/tools/internal/pkgbits.

https://github.com/golang/tools/blob/master/internal/pkgbits/frames_go17.go
2024-03-02 21:17:34 +01:00
deadprogram
1e13c6d18f syscall: add wasm_unknown to some additional files so it can compile more code
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-03-02 20:49:56 +01:00
deadprogram
14121f4b0e all: update for 0.31.1
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-28 13:22:23 +01:00
deadprogram
7768195835 net: update to latest main
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-28 13:22:23 +01:00
deadprogram
c095b7e9c4 build: only use GHA cache for docker dev builds, ignore the previous saved build-context
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-28 08:57:35 +01:00
Ayke van Laethem
1f6d34d995 interp: make getelementptr offsets signed
getelementptr offsets are signed, not unsigned. Yet they were used as
unsigned integers in interp.
Somehow this worked most of the time, until finally there was some code
that did a getelementptr with a negative index.
2024-02-27 15:16:38 +01:00
Ayke van Laethem
9951eb9990 interp: return a proper error message when indexing out of range
This helps debug issues inside interp.
2024-02-27 15:16:38 +01:00
deadprogram
c8f77d26a8 docker: update final build stage to go1.22
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-27 11:57:37 +01:00
Ayke van Laethem
8eaa9bd8d0 ci: fix binaryen build
Disable the googletest dependency so that we can avoid that submodule
dependency.
2024-02-26 15:30:41 +01:00
Ayke van Laethem
6061f3db92 all: version 0.31.0 2024-02-26 09:37:39 +01:00
Akshay Pai
410aa0e0d8 Stub CallSlice for Value 2024-02-25 14:45:50 +01:00
deadprogram
c66836cf3a targets: add support for Thumby
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-23 14:00:57 +01:00
Ayke van Laethem
ca9211b582 main: make ports subcommand more verbose
By listing column headers and printing a message when no ports are
found, it should be a bit easier to use.
2024-02-23 08:37:26 +01:00
Ayke van Laethem
cb7d470ba4 main: change monitor -info to ports
I believe this provides a better UX.
2024-02-23 08:37:26 +01:00
Ayke van Laethem
5baee9a8ee ci: switch to Go 1.22 2024-02-20 21:58:09 +01:00
Ayke van Laethem
c47f52b546 Dockerfile: reduce size of resulting image
This reduces the size of the Docker image from 13GB to 1.71GB, and
should therefore make CI of the drivers package much faster. It should
hopefully also avoid the out-of-space problem we currently have when
building the smoke tests for the drivers repo.

 This size reduction is done by using multistage builds and only copying
 the necessary files in the final stage.
2024-02-20 21:00:22 +01:00
Ayke van Laethem
a2588d8db3 compileopts: remove workaround for LLVM 16
This workaround is no longer needed now that we've switched to LLVM 17
where this bug has been fixed upstream:
https://github.com/espressif/llvm-project/pull/84
2024-02-19 23:29:44 +01:00
Ayke van Laethem
f529b6071d interp: do not register runtime timers during interp
The runtime hasn't been initialized yet so this leads to problems.

This fixes https://github.com/tinygo-org/tinygo/issues/4123.
2024-02-19 22:17:19 +01:00
Ayke van Laethem
5557e97888 device: update SVD files
This updates lib/cmsis-svd, pulling in the updates to the Espressif SVD
files here:
https://github.com/cmsis-svd/cmsis-svd-data/pull/3

This is needed for wifi/BLE support on the ESP32-C3 (the older SVD files
were missing some necessary interrupts).
2024-02-19 19:10:21 +01:00
Ayke van Laethem
d04b07fa8b compileopts: always enable CGo
CGo is needed for the rp2040 and for macOS (GOOS=darwin), without it
these targets just won't work. And there really isn't a benefit from
disabling CGo: we don't need any external linkers for example.

This avoids a somewhat common issue of people having CGO_ENABLED=0
somewhere in their environment and not understanding why things don't
work. See for example: https://github.com/tinygo-org/tinygo/issues/3450
2024-02-19 17:53:36 +01:00
Ayke van Laethem
7486277012 all: make TinyGo code usable with "big Go" CGo
I managed to get CGo sort-of working in VSCode (meaning that it will
typecheck code in the IDE itself) using a few crude hacks, but it
requires a few minor changes to the TinyGo standard library.

I intend to eventually add this support in the TinyGo extension for
VSCode directly, but for now I've manually updated .vscode/settings.json
to get IDE support. In any case, it would be nice to have this for when
I hopefully add this to the TinyGo extension eventually.
2024-02-19 15:49:36 +01:00
deadprogram
36d60b8349 targets/wasm_unknown: remove _start to _initialize to match WASI
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-17 10:18:00 +01:00
deadprogram
c55191283b builder: add 'wasm-unknown' to list of targets for clang features verification
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-17 10:18:00 +01:00
deadprogram
ad30085b93 targets/wasm_unknown: use proper defaults for GC
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-17 10:18:00 +01:00
deadprogram
e9ca41735a make: add smoketest for wasm-unknown target
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-15 17:54:18 +01:00
deadprogram
df1f83f4e1 examples: add example for use with wasm-unknown target
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-15 17:54:18 +01:00
deadprogram
5879d785a9 target/wasm_unknown: remove bulk memory and use imported memory for extreme tinyness
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-15 17:54:18 +01:00
deadprogram
186018abeb runtime, targets: some WIP on wasm unknown in part from PR #3072
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-15 17:54:18 +01:00
BCG
828b9614c2
nrf52840: generic board support (#4121)
machine/nrf52840: generic board support
2024-02-12 10:37:19 +01:00
Xudong Zheng
f5e933cd4d machine/rp2040: set XOSC startup delay multiplier
XOSC requires additional time to stablize on certain RP2040 boards.

Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2024-02-11 11:59:54 +01:00
Ayke van Laethem
0952b1b984 compileopts: set 'purego' build tag by default
This is needed for various crypto libraries.
2024-02-11 10:43:28 +01:00
Ayke van Laethem
ed55f56d85 ci: update from Node.js 16 to Node.js 18
Node.js 16 is no longer supported, so we can drop support for it as
well.

This also means updating a whole lot of GitHub Actions versions, because
they were updated to work on Node.js 20 instead. For most actions this
should be a relatively small change, but the upload-aftifact action has
had some major changes (which should generally improve things a lot).
2024-02-11 09:43:22 +01:00
Ayke van Laethem
edb8766aab esp32: switch over to the official SVD file 2024-02-09 16:12:21 +01:00
deadprogram
413bb55e2c build: remove more files from host on Docker build to avoid running out of disk space
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-07 07:31:54 +01:00
Ayke van Laethem
0db1a4bec1 gi: add macOS ARM64 builder
This means we can finally release native arm64 builds of TinyGo on
macOS!

Also update from macOS 11 to macOS 12, because macOS 11 is not supported
anymore.
2024-02-05 20:43:43 +01:00
Damian Gryski
2867da164d Allow larger systems to have a larger max stack alloc
Fixes #3331
2024-01-31 17:51:55 +01:00
Elias Naur
7b8ae2d6b6 flake.nix: explicitly add libcxx as dependency
Without this change, my tinygo builds crash with

SIGSEGV: segmentation violation
PC=0x10884f87c m=16 sigcode=2
signal arrived during cgo execution

goroutine 378 [syscall]:
runtime.cgocall(0x100631e44, 0x1401755be88)
	/nix/store/4hf287252ilsdf2w36mfm8fa0rvbf33w-go-1.21.4/share/go/src/runtime/cgocall.go:157 +0x44 fp=0x1401755be50 sp=0x1401755be10 pc=0x1002a5084
tinygo.org/x/go-llvm._Cfunc_LLVMGoWriteThinLTOBitcodeToMemoryBuffer(0x123614160)
	_cgo_gotypes.go:6078 +0x34 fp=0x1401755be80 sp=0x1401755be50 pc=0x1004b66b4
...

and reports using LLVM 16:

$ tinygo version
tinygo version 0.31.0-dev darwin/arm64 (using go version go1.21.4 and LLVM version 16.0.6)

I don't know why libcxx-16 is being included, but explicitly specifying
llvmPackages_17.libcxx fixes the crash and version skew.
2024-01-31 14:56:16 +01:00
Damian Gryski
5b8127fd4e reflect: move indirect values into interface when setting interfaces
Fixes #4040
2024-01-31 13:48:02 +01:00
=
cc3e785692 Remove unused value 2024-01-29 16:23:35 +01:00
BCG
0ea5cfc8fe rp2040: add definition for machine.PinToggle 2024-01-29 12:38:06 +01:00
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