Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions .github/scripts/validate_embed_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,142 @@ DEVICE_VALIDATION_TARGETS=(

# Machine validation targets
MACHINE_VALIDATION_TARGETS=(
"pca10040-s132v6"
"microbit"
"microbit-s110v8"
"microbit-v2"
"microbit-v2-s113v7"
"microbit-v2-s140v7"
"nrf52840-mdk"
"btt-skr-pico"
"pca10031"
"reelboard"
"pca10056"
"pca10059"
"bluemicro840"
"itsybitsy-m0"
"feather-m0"
"trinket-m0"
"gemma-m0"
"circuitplay-express"
"circuitplay-bluefruit"
"clue-alpha"
# "gameboy-advance"
# some picolibc symbol missed

"grandcentral-m4"
"itsybitsy-m4"
"feather-m4"
"matrixportal-m4"
"pybadge"
"metro-m4-airlift"
"pyportal"
"particle-argon"
"particle-boron"
"particle-xenon"
"pinetime"
"x9pro"
"pca10056-s140v7"
"pca10059-s140v7"
"reelboard-s140v7"
"wioterminal"
"pygamer"
"xiao"
"rak4631"
"feather-nrf52840"
"feather-nrf52840-sense"
"itsybitsy-nrf52840"
"qtpy"
"teensy41"
"teensy40"
"teensy36"
"p1am-100"
"atsame54-xpro"
"feather-m4-can"
"arduino-nano33"
"arduino-mkrwifi1010"
"pico"
"nano-33-ble"
"nano-rp2040"
"feather-rp2040"
"qtpy-rp2040"
"kb2040"
"macropad-rp2040"
"badger2040"
"badger2040-w"
"tufty2040"
"thingplus-rp2040"
"xiao-rp2040"
"waveshare-rp2040-zero"
"challenger-rp2040"
"trinkey-qt2040"
"gopher-badge"
"ae-rp2040"
"thumby"
"pico2"
"tiny2350"
"pico-plus2"
# "metro-rp2350"
# TODO: llgo sync this 0.39.0 target
"waveshare-rp2040-tiny"
"nrf52840-s140v6-uf2-generic"
"bluepill"
"feather-stm32f405"
"lgt92"
"nucleo-f103rb"
"nucleo-f722ze"
"nucleo-l031k6"
"nucleo-l432kc"
"nucleo-l476rg"
"nucleo-l552ze"
"nucleo-wl55jc"
"stm32f4disco"
"stm32f4disco-1"
"stm32f469disco"
"lorae5"
"swan"
"mksnanov3"
# "stm32l0x1"
# TODO: llgo sync this 0.39.0 target

# "atmega328pb"
# "atmega1284p"
# "arduino"
# "arduino-leonardo"
# "arduino-mega1280"
# "arduino-nano"
# "attiny1616"
# "digispark"
# error: ran out of registers during register allocation
# 2 errors generated.
# panic: export object of internal/abi failed: exit status 1

"esp32-mini32"

"esp32c3-supermini"

# "nodemcu"
# compile picolibcnewlib/libc/tinystdio/puts.c fail

"esp-c3-32s-kit"
"qtpy-esp32c3"
"m5stamp-c3"
"xiao-esp32c3"
"esp32-c3-devkit-rust-1"
"esp32c3-12f"
"makerfabs-esp32c3spi35"

# "hifive1b"
# "maixbit"
# "tkey"
# picolibc symbol notfound like vfprintf,stdout,srandom ...

"elecrow-rp2040"
"elecrow-rp2350"
"hw-651"
"hw-651-s110v8"
"wasm"
"wasm-unknown"
)

# Global variables
Expand Down Expand Up @@ -96,13 +232,18 @@ create_device_test_file() {

cat > "$filename" << EOF
package main

import _ "github.com/goplus/emb/$device_package"

//export handleHardFault
func handleHardFault() {}

//export handleInterrupt
func handleInterrupt() {}

//export Reset_Handler
func Reset_Handler() {}

func main() {}
EOF

Expand Down Expand Up @@ -136,16 +277,22 @@ create_machine_test_file() {
mkdir -p "$test_dir"
cat > "$test_file" << 'EOF'
package main

import (
_ "github.com/goplus/emb/machine"
)

//export handleHardFault
func handleHardFault() {}

//export handleInterrupt
func handleInterrupt() {}

//export Reset_Handler
func Reset_Handler() {}

func main(){

}
EOF
log_info "Created test file: $test_file" >&2
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/validate-embed-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,19 @@ jobs:
- name: Run Device Package Validation
run: |
./.github/scripts/validate_embed_packages.sh device

validate-machine-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Setup LLGO
uses: ./.github/actions/setup-llgo
with:
commit-hash: b25ae1b4e7c06a302d1d09eb9e9b0ad1e3a43abd
- name: Run Machine Package Validation
run: |
./.github/scripts/validate_embed_packages.sh machine
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module github.com/goplus/emb

go 1.20

require github.com/goplus/lib v0.3.1 // indirect
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/goplus/lib v0.3.1 h1:Xws4DBVvgOMu58awqB972wtvTacDbk3nqcbHjdx9KSg=
github.com/goplus/lib v0.3.1/go.mod h1:SgJv3oPqLLHCu0gcL46ejOP3x7/2ry2Jtxu7ta32kp0=
Loading