From 9ff353634746602a05dc1e309faf4f77652ab735 Mon Sep 17 00:00:00 2001 From: jackctj117 Date: Wed, 3 Dec 2025 16:45:29 -0700 Subject: [PATCH 1/3] CI tests: Cypress test --- .github/workflows/test-build-psoc6.yml | 116 +++++++++++++++++++++++++ .github/workflows/test-configs.yml | 11 ++- arch.mk | 2 +- 3 files changed, 122 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/test-build-psoc6.yml diff --git a/.github/workflows/test-build-psoc6.yml b/.github/workflows/test-build-psoc6.yml new file mode 100644 index 0000000000..bb24c57459 --- /dev/null +++ b/.github/workflows/test-build-psoc6.yml @@ -0,0 +1,116 @@ +name: Wolfboot Reusable Build Workflow for Cypress PSoC6 + +on: + + workflow_call: + inputs: + arch: + required: true + type: string + config-file: + required: true + type: string + make-args: + required: false + type: string + +jobs: + + build: + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - uses: actions/checkout@v4 + with: + repository: Infineon/psoc6pdl + path: lib/psoc6pdl + + - uses: actions/checkout@v4 + with: + repository: Infineon/TARGET_CY8CKIT-062S2-43012 + path: lib/TARGET_CY8CKIT-062S2-43012 + + - uses: actions/checkout@v4 + with: + repository: Infineon/core-lib + path: lib/core-lib + + - name: Patch cy_syslib.c to declare cy_delay32kMs + run: | + # Add extern declaration for cy_delay32kMs directly in cy_syslib.c + sed -i '/#include "cy_syslib.h"/a \\\n/* Extern declaration for delay variable */\nextern uint32_t cy_delay32kMs;' lib/psoc6pdl/drivers/source/cy_syslib.c + + - name: Workaround for sources.list + run: | + # Replace sources + + set -euxo pipefail + + # Peek (what repos are active now) + apt-cache policy + grep -RInE '^(deb|Types|URIs)' /etc/apt || true + + # Enable nullglob so *.list/*.sources that don't exist don't break sed + shopt -s nullglob + + echo "Replace sources.list (legacy)" + sudo sed -i \ + -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ + /etc/apt/sources.list || true + + echo "Replace sources.list.d/*.list (legacy)" + for f in /etc/apt/sources.list.d/*.list; do + sudo sed -i \ + -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ + "$f" + done + + echo "Replace sources.list.d/*.sources (deb822)" + for f in /etc/apt/sources.list.d/*.sources; do + sudo sed -i \ + -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ + -e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \ + "$f" + done + + echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)" + if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then + # Replace azure with our mirror (idempotent) + sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt + fi + + # Peek (verify changes) + grep -RIn "azure.archive.ubuntu.com" /etc/apt || true + grep -RInE '^(deb|Types|URIs)' /etc/apt || true + echo "--- apt-mirrors.txt ---" + cat /etc/apt/apt-mirrors.txt || true + + - name: Update repository + run: sudo apt-get update + + - name: Install cross compilers + run: | + sudo apt-get install -y gcc-arm-none-eabi + + - name: make distclean + run: | + make distclean + + - name: Select config + run: | + cp ${{inputs.config-file}} .config && make include/target.h + + - name: Build tools + run: | + make -C tools/keytools && make -C tools/bin-assemble + + - name: Build wolfboot + run: | + make ${{inputs.make-args}} V=1 + + diff --git a/.github/workflows/test-configs.yml b/.github/workflows/test-configs.yml index a6a51bc8de..5d7495f6b9 100644 --- a/.github/workflows/test-configs.yml +++ b/.github/workflows/test-configs.yml @@ -8,12 +8,11 @@ on: jobs: - # TODO: cypsoc6.config requires cy_device_headers.h and component defines - # cypsoc6_test: - # uses: ./.github/workflows/test-build-psoc6.yml - # with: - # arch: arm - # config-file: ./config/examples/cypsoc6.config + cypsoc6_test: + uses: ./.github/workflows/test-build-psoc6.yml + with: + arch: arm + config-file: ./config/examples/cypsoc6.config hifive1_test: uses: ./.github/workflows/test-build-riscv.yml diff --git a/arch.mk b/arch.mk index cde222483c..8c470fdb11 100644 --- a/arch.mk +++ b/arch.mk @@ -960,8 +960,8 @@ ifeq ($(TARGET),psoc6) $(CYPRESS_PDL)/drivers/source/cy_crypto.o CFLAGS+=\ - -I$(CYPRESS_PDL)/drivers/include \ -I$(CYPRESS_PDL)/devices/include \ + -I$(CYPRESS_PDL)/drivers/include \ -I$(CYPRESS_PDL)/cmsis/include \ -I$(CYPRESS_TARGET_LIB) \ -I$(CYPRESS_CORE_LIB)/include \ From 926eb96fc78c6d707d8521d87a21616f3954d42f Mon Sep 17 00:00:00 2001 From: jackctj117 Date: Thu, 4 Dec 2025 12:53:54 -0700 Subject: [PATCH 2/3] fix sed command --- .github/workflows/test-build-psoc6.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-psoc6.yml b/.github/workflows/test-build-psoc6.yml index bb24c57459..f647bec04c 100644 --- a/.github/workflows/test-build-psoc6.yml +++ b/.github/workflows/test-build-psoc6.yml @@ -43,7 +43,10 @@ jobs: - name: Patch cy_syslib.c to declare cy_delay32kMs run: | # Add extern declaration for cy_delay32kMs directly in cy_syslib.c - sed -i '/#include "cy_syslib.h"/a \\\n/* Extern declaration for delay variable */\nextern uint32_t cy_delay32kMs;' lib/psoc6pdl/drivers/source/cy_syslib.c + # Find the line with the include and add the extern declaration after it + awk '/#include "cy_syslib.h"/ {print; print ""; print "/* Extern declaration for delay variable */"; print "extern uint32_t cy_delay32kMs;"; next} 1' \ + lib/psoc6pdl/drivers/source/cy_syslib.c > /tmp/cy_syslib_patched.c + mv /tmp/cy_syslib_patched.c lib/psoc6pdl/drivers/source/cy_syslib.c - name: Workaround for sources.list run: | From feec84111df873529934a1ea5a8d39874ae847f8 Mon Sep 17 00:00:00 2001 From: jackctj117 Date: Thu, 4 Dec 2025 14:23:01 -0700 Subject: [PATCH 3/3] Disable PSOC6_CRYPTO in cypsoc6.config to use software crypto --- config/examples/cypsoc6.config | 1 + 1 file changed, 1 insertion(+) diff --git a/config/examples/cypsoc6.config b/config/examples/cypsoc6.config index 457ba5ff2b..fb5afae099 100644 --- a/config/examples/cypsoc6.config +++ b/config/examples/cypsoc6.config @@ -22,6 +22,7 @@ RAM_CODE?=0 DUALBANK_SWAP?=0 PKA?=0 WOLFTPM?=0 +PSOC6_CRYPTO?=0 WOLFBOOT_PARTITION_SIZE?=0x80000 WOLFBOOT_SECTOR_SIZE?=512 WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x10080000