Skip to content

Commit fdf2632

Browse files
committed
Fix CI
1 parent 45143c7 commit fdf2632

3 files changed

Lines changed: 143 additions & 137 deletions

File tree

.github/workflows/stm32h563-m33mu-https-tls13.yml

Lines changed: 0 additions & 135 deletions
This file was deleted.

.github/workflows/stm32h563-m33mu.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ jobs:
141141
make -C src/port/stm32h563 \
142142
WOLFSSL_ROOT=../../../../wolfssl \
143143
ENABLE_HTTPS=1 ENABLE_MQTT_BROKER=1 ENABLE_SSH=1 \
144+
WOLFSSL_SP_NO_ASM=1 \
144145
CC=arm-none-eabi-gcc OBJCOPY=arm-none-eabi-objcopy
145146
146147
- name: Run m33mu + DHCP + full test
@@ -317,3 +318,132 @@ jobs:
317318
if [ -f /tmp/m33mu.pid ]; then
318319
sudo kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
319320
fi
321+
322+
stm32h563_m33mu_https_tls13:
323+
runs-on: ubuntu-latest
324+
timeout-minutes: 25
325+
container:
326+
image: ghcr.io/danielinux/m33mu-ci:1.7
327+
options: --privileged
328+
329+
steps:
330+
- uses: actions/checkout@v4
331+
332+
- name: Install host tools
333+
run: |
334+
set -euo pipefail
335+
apt-get update
336+
apt-get install -y sudo dnsmasq iproute2 curl git tcpdump
337+
338+
- name: Fetch wolfSSL
339+
run: |
340+
set -euo pipefail
341+
if [ ! -d ../wolfssl ]; then
342+
git clone --depth 1 --branch master https://github.com/wolfSSL/wolfssl.git ../wolfssl
343+
fi
344+
345+
- name: Build STM32H563 HTTPS firmware
346+
run: |
347+
set -euo pipefail
348+
make -C src/port/stm32h563 clean TZEN=0 ENABLE_HTTPS=1 \
349+
WOLFSSL_SP_NO_ASM=1 CC=arm-none-eabi-gcc OBJCOPY=arm-none-eabi-objcopy
350+
make -C src/port/stm32h563 TZEN=0 ENABLE_HTTPS=1 \
351+
WOLFSSL_SP_NO_ASM=1 CC=arm-none-eabi-gcc OBJCOPY=arm-none-eabi-objcopy
352+
strings src/port/stm32h563/app.bin | grep "Initializing HTTPS server" > /dev/null
353+
354+
- name: Run m33mu + DHCP + HTTPS test
355+
timeout-minutes: 15
356+
run: |
357+
set -euo pipefail
358+
359+
cleanup() {
360+
set +e
361+
if [ -f /tmp/m33mu.pid ]; then
362+
sudo kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
363+
fi
364+
if [ -f /tmp/tcpdump.pid ]; then
365+
sudo kill "$(cat /tmp/tcpdump.pid)" 2>/dev/null || true
366+
fi
367+
sudo pkill -x m33mu 2>/dev/null || true
368+
if [ -f /tmp/dnsmasq.pid ]; then
369+
sudo kill "$(cat /tmp/dnsmasq.pid)" 2>/dev/null || true
370+
fi
371+
sudo ip link del tap0 2>/dev/null || true
372+
}
373+
trap cleanup EXIT
374+
375+
sudo ip tuntap add dev tap0 mode tap
376+
sudo ip addr add 192.168.12.1/24 dev tap0
377+
sudo ip link set tap0 up
378+
379+
cat > /tmp/dnsmasq.conf <<'CONF'
380+
interface=tap0
381+
bind-interfaces
382+
dhcp-range=192.168.12.50,192.168.12.100,255.255.255.0,12h
383+
dhcp-leasefile=/tmp/dnsmasq.leases
384+
log-dhcp
385+
CONF
386+
sudo dnsmasq --conf-file=/tmp/dnsmasq.conf --pid-file=/tmp/dnsmasq.pid
387+
388+
sudo tcpdump -i tap0 -nn -U -w /tmp/https-test.pcap > /tmp/tcpdump.log 2>&1 &
389+
echo $! > /tmp/tcpdump.pid
390+
391+
sudo m33mu src/port/stm32h563/app.bin \
392+
--cpu stm32h563 --tap:tap0 --uart-stdout --timeout 180 --quit-on-faults \
393+
2>&1 | tee /tmp/m33mu.log &
394+
sleep 1
395+
m33mu_pid="$(pgrep -n -x m33mu || true)"
396+
if [ -n "${m33mu_pid}" ]; then
397+
echo "${m33mu_pid}" > /tmp/m33mu.pid
398+
fi
399+
400+
ip=""
401+
for _ in $(seq 1 90); do
402+
if [ -s /tmp/dnsmasq.leases ]; then
403+
ip="$(tail -n1 /tmp/dnsmasq.leases | cut -d' ' -f3)"
404+
fi
405+
if [ -n "${ip}" ]; then
406+
break
407+
fi
408+
sleep 1
409+
done
410+
if [ -z "${ip}" ]; then
411+
echo "No DHCP lease acquired."
412+
echo "m33mu log:"
413+
tail -n 200 /tmp/m33mu.log || true
414+
exit 1
415+
fi
416+
echo "Leased IP: ${ip}"
417+
418+
ok=0
419+
for _ in $(seq 1 60); do
420+
if ! pgrep -x m33mu >/dev/null 2>&1; then
421+
echo "m33mu exited before HTTPS check."
422+
tail -n 200 /tmp/m33mu.log || true
423+
exit 1
424+
fi
425+
if curl --silent --show-error --fail --insecure --tlsv1.3 \
426+
--connect-timeout 10 --max-time 20 \
427+
"https://${ip}/" | tee /tmp/curl.log | grep -q "wolfIP"; then
428+
ok=1
429+
break
430+
fi
431+
sleep 0.5
432+
done
433+
if [ "${ok}" -ne 1 ]; then
434+
echo "HTTPS test failed."
435+
echo "m33mu log:"
436+
tail -n 200 /tmp/m33mu.log || true
437+
echo "curl log:"
438+
tail -n 200 /tmp/curl.log || true
439+
echo "tcpdump log:"
440+
tail -n 50 /tmp/tcpdump.log || true
441+
exit 1
442+
fi
443+
echo "HTTPS test succeeded."
444+
if [ -f /tmp/m33mu.pid ]; then
445+
sudo kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
446+
fi
447+
if [ -f /tmp/tcpdump.pid ]; then
448+
sudo kill "$(cat /tmp/tcpdump.pid)" 2>/dev/null || true
449+
fi

src/port/stm32h563/Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ ifeq ($(ENABLE_MQTT),1)
4444
ENABLE_TLS = 1
4545
endif
4646

47+
# Disable wolfSSL Cortex-M assembly (set to 1 for emulators/CI that reject
48+
# certain T32 instructions generated by sp_cortexm.c; real hardware uses 0)
49+
WOLFSSL_SP_NO_ASM ?= 0
50+
4751
# Library paths - default to sibling directories (clone alongside pattern)
4852
WOLFSSL_ROOT ?= $(ROOT)/../wolfssl
4953
WOLFSSH_ROOT ?= $(ROOT)/../wolfssh
@@ -124,8 +128,15 @@ WOLFSSL_SRCS := \
124128
$(WOLFSSL_ROOT)/wolfcrypt/src/memory.c \
125129
$(WOLFSSL_ROOT)/wolfcrypt/src/wolfmath.c \
126130
$(WOLFSSL_ROOT)/wolfcrypt/src/sp_int.c \
127-
$(WOLFSSL_ROOT)/wolfcrypt/src/sp_c32.c \
128-
$(WOLFSSL_ROOT)/wolfcrypt/src/sp_cortexm.c \
131+
$(WOLFSSL_ROOT)/wolfcrypt/src/sp_c32.c \
132+
133+
ifeq ($(WOLFSSL_SP_NO_ASM),0)
134+
WOLFSSL_SRCS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_cortexm.c
135+
else
136+
CFLAGS += -DWOLFSSL_SP_NO_ASM
137+
endif
138+
139+
WOLFSSL_SRCS += \
129140
$(WOLFSSL_ROOT)/src/ssl.c \
130141
$(WOLFSSL_ROOT)/src/tls.c \
131142
$(WOLFSSL_ROOT)/src/tls13.c \

0 commit comments

Comments
 (0)