* pinout yamls removed
* machine: implement default UART pin configuration for Embedfire boards
* flash command moved to chip level so VS Code plugin can select bare chip
* machine: add support for alternate pin mode configuration
* add build targets for embedfire on py32
* add support for embedfire target in GNUmakefile for py32
* lib/py32-svd: remove duplicate DBGMCU.IDCODE CODE field
Update submodule to fix duplicate SetIDCODE/GetIDCODE method
declarations in the generated py32f002bxx.go device file.
* update subproject commit reference in py32-svd
* refactor: update CPU frequency handling in machine and runtime packages
* refactor: replace ConfigureUARTPin function with direct pin configuration in UART setup
* SetAltFunc documentation for GPIO pin alternate functions
* refactor: improve UART write and flush error handling with timeout
* machine/py32: generalize UART driver to any USART
Add a per-instance setup func to the UART type so the driver is no longer
hardwired to USART1. DefaultUART stays USART1; add UART2 (USART2) in a
separately build-tagged file since py32f002x parts lack USART2. RX IRQ
handlers reference runtime-assigned vars to break the init cycle, and setup
is assigned in the var initializer so it runs before InitSerial.
Add the py32f003_32k_4k target (32K flash / 4K RAM).
* Add canonical PY32F002, F003, and F030 density targets
Use CMSIS/pyocd device names for target files and build tags. Add all F003 and F030 densities plus F002A/B, correct F002B to 24K flash and its own startup file, fix the F030x8 pyocd target, and update Embedfire inheritance.
* Add targets for all PY32 CMSIS devices
* Support all PY32 register layout variants
* machine/py32: use generated register definitions
* machine/py32: fix alternate-function documentation
* machine/py32: report the configured CPU frequency
* machine/py32: use unsafe.Add for GPIO ports
* machine/py32: bound and yield UART polling
* machine/py32: configure UART pins from UARTConfig
* build: use the current PY32 SVD repository URL
* test: cover PY32 UART register layouts
* machine/py32: restore dynamic CPU frequency tracking
* machine/py32: share the USART TX-ready bit
* targets/py32: scale system stacks with RAM
* machine/py32: keep clock state internal
* targets/py32: normalize generated metadata
* machine/py32: normalize GPIO configuration
* machine/py32: fix T020 UART setup
* machine/py32: reduce clock variant files
* machine/py32: clean up UART variants
* machine/py32: decouple UART clock capability
* lib/py32-svd: use organization repository
* runtime/py32: name 24MHz HSI encodings
* machine/py32: derive startup clock from capability
* machine/py32: use generated USART clock mask
* machine/py32: name T020 8-bit UART mode
* ci: include PY32 in sharded smoke tests
* runtime: remove PY32 HSI frequency workaround
GitHub org. The git server for git.musl-libc.org is having troubles,
and it also seems like a safer bet to have our own mirror just in case.
Signed-off-by: deadprogram <ron@hybridgroup.com>
This adds support for the well-known Boehm GC. It's significantly faster
than our own naive GC and could be used as an alternative on bigger
systems.
In the future, this GC might also be supported on WebAssembly with some
extra work. Right now it's Linux only (though Windows/MacOS shouldn't be
too difficult to add).
- add internal/wasm-tools/go.mod file to depend on wasm-tools-go
- copy package cm into src/internal/cm
- remove wasm-tools-go "vendor" submodule
internal/tools: fix typo
go.{mod,sum}, internal/tools: add wit-bindgen-go to tools
GNUmakefile: use go run for wit-bindgen-go
GNUmakefile: add tools target to go:generate tools binaries in internal/tools
GNUmakefile: add .PHONY for lint and spell
GNUmakefile, internal/cm: vendor package cm into internal/cm
go.{mod,sum}: update wasm-tools-go to v0.1.4
internal/wasi: use internal/cm package
remove submodule src/vendor/github.com/ydnar/wasm-tools-go
GNUmakefile: add comment documenting what wasi-cm target does
go.{mod,sum}: remove toolchain; go mod tidy
go.mod: revert to Go 1.19
go.mod: go 1.19
go.{mod,sum}, internal/{tools,wasm-tools}: revert root go.mod file to go1.19
Create a wasm-tools specific module that can require go1.22 for wasm-tools-go.
This means that it will be possible to generate a Darwin binary on any
platform (Windows, Linux, and MacOS of course), including CGo. Of
course, the resulting binaries can only run on MacOS itself.
The binary links against libSystem.dylib, which is a shared library. The
macos-minimal-sdk repository contains open source header files and
generated symbol stubs so we can generate a stub libSystem.dylib without
copying any closed source code.
This change implements a new "scheduler" for WebAssembly using binaryen's asyncify transform.
This is more reliable than the current "coroutines" transform, and works with non-Go code in the call stack.
runtime (js/wasm): handle scheduler nesting
If WASM calls into JS which calls back into WASM, it is possible for the scheduler to nest.
The event from the callback must be handled immediately, so the task cannot simply be deferred to the outer scheduler.
This creates a minimal scheduler loop which is used to handle such nesting.
This commit adds support for musl-libc and uses it by default on Linux.
The main benefit of it is that binaries are always statically linked
instead of depending on the host libc, even when using CGo.
Advantages:
- The resulting binaries are always statically linked.
- No need for any tools on the host OS, like a compiler, linker, or
libc in a release build of TinyGo.
- This also simplifies cross compilation as no cross compiler is
needed (it's all built into the TinyGo release build).
Disadvantages:
- Binary size increases by 5-6 kilobytes if -no-debug is used. Binary
size increases by a much larger margin when debugging symbols are
included (the default behavior) because musl is built with debugging
symbols enabled.
- Musl does things a bit differently than glibc, and some CGo code
might rely on the glibc behavior.
- The first build takes a bit longer because musl needs to be built.
As an additional bonus, time is now obtained from the system in a way
that fixes the Y2038 problem because musl has been a bit more agressive
in switching to 64-bit time_t.
This commit changes the number of wait states for the stm32f103 chip to
2 instead of 4. This gets it back in line with the datasheet, but it
also has the side effect of breaking I2C. Therefore, another (seemingly
unrelated) change is needed: the i2cTimeout constant must be increased
to a higher value to adjust to the lower flash wait states - presumably
because the lower number of wait states allows the chip to run code
faster.
This is necessary for better CGo support on bare metal. Existing
libraries expect to be able to include parts of libc and expect to be
able to link to those symbols.
Because with this all targets have a working libc, it is now possible to
add tests to check that a libc in fact works basically.
Not all parts of picolibc are included, such as the math or stdio parts.
These should be added later, when needed.
This commit also avoids the need for the custom memcpy/memset/memcmp
symbols that are sometimes emitted by LLVM. The C library will take care
of that.
This allows CGo code to call some libc functions. Additionally, by
putting memset/memmove/memcpy in an archive they're not included anymore
when not necessary, reducing code size for small programs.
We don't need the separate submodule: compiler-rt is already included in
the llvm-project repository.
This should hopefully make CI slightly faster too.
These files don't really belong in this repository. It's better to
generate them automatically from a source, like the one provided by the
avr-rust project. So a new command `make gen-device-avr` has been
provided for this purpose.