Added FreeRTOS example + test for STM32H5#79
Conversation
danielinux
commented
Mar 13, 2026
- added ssh test
+ added ssh test
There was a problem hiding this comment.
Pull request overview
Adds a FreeRTOS-based STM32H563 m33mu CI path (echo + HTTPS via a BSD-socket wrapper) and introduces new local/CI workflow wiring to build/run those targets in the emulator.
Changes:
- Add
FREERTOS=1build mode for the STM32H563 port, including FreeRTOS kernel sources + BSD socket wrapper + new FreeRTOS echo/HTTPS servers. - Extend container CI runner script and local workflow runner to support a new
stm32h563-m33mu-freertosworkflow/jobs. - Add new GitHub Actions workflows for FreeRTOS and SSH testing.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/scripts/run-m33mu-workflow.sh | Adds FreeRTOS workflow/job names to the local podman runner interface. |
| tools/scripts/run-m33mu-ci-in-container.sh | Adds FreeRTOS build/run jobs (echo/HTTPS) and resolves m33mu binary path. |
| src/port/stm32h563/Makefile | Introduces FREERTOS build mode and FreeRTOS source integration. |
| src/port/stm32h563/main.c | Adds FreeRTOS scheduler path, BSD socket init, and starts FreeRTOS echo/HTTPS tasks. |
| src/port/stm32h563/ivt.c | Adjusts vector table handler references for FreeRTOS builds. |
| src/port/stm32h563/FreeRTOSConfig.h | Adds a FreeRTOS configuration header for the STM32H563 port. |
| src/port/stm32h563/echo_server_freertos.[ch] | New FreeRTOS task-based TCP echo server using BSD socket wrappers. |
| src/port/stm32h563/https_server_freertos.[ch] | New FreeRTOS task-based HTTPS server using wolfSSL + BSD socket wrappers. |
| src/port/freeRTOS/bsd_socket.c | Tweaks error-handling loops to treat -1 similarly to -WOLFIP_EAGAIN. |
| .github/workflows/stm32h563-m33mu-freertos.yml | New CI workflow to run the FreeRTOS echo test in the container. |
| .github/workflows/stm32h563-m33mu-ssh-tzen.yml | New CI workflow to build/run SSH test and check server banner. |
Comments suppressed due to low confidence (2)
src/port/freeRTOS/bsd_socket.c:321
wolfIP_sock_accept()uses-1for real error cases (e.g., invalid state, allocation failure, filter rejection). Treatingret == -1likeEAGAINhere will causeaccept()to wait/retry indefinitely and hide the underlying failure. Consider mapping-1to a concrete errno and returning immediately (or change the core API to return-WOLFIP_E...codes consistently).
}
return public_fd;
}
if (ret != -WOLFIP_EAGAIN && ret != -1) {
xSemaphoreGive(g_lock);
wolfip_bsd_set_error(ret);
return -1;
}
src/port/freeRTOS/bsd_socket.c:353
wolfIP_sock_connect()can return-1for real errors (e.g., filter rejection / invalid state), not just "would block". Treatingret == -1likeEAGAINhere can turn hard failures into infinite waits and makes diagnosing connection issues difficult. Prefer returning an error and settingsocket_last_error()whenret == -1.
ret = wolfIP_sock_connect(g_ipstack, entry->internal_fd, addr, addrlen);
if (ret == 0) {
xSemaphoreGive(g_lock);
return 0;
}
if (ret != -WOLFIP_EAGAIN && ret != -1) {
xSemaphoreGive(g_lock);
wolfip_bsd_set_error(ret);
return -1;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds a FreeRTOS-based runtime option for the STM32H563 port (echo + HTTPS via a blocking BSD-socket wrapper layer) and wires it into the local/CI m33mu workflow tooling.
Changes:
- Add FreeRTOS echo/HTTPS servers and FreeRTOS hooks/integration in the STM32H563 firmware.
- Extend STM32H563 build system/linker script to support
FREERTOS=1builds and associated sources. - Add/update m33mu runner scripts and GitHub Actions workflows to exercise the new FreeRTOS echo job (and expose an HTTPS FreeRTOS job).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/scripts/run-m33mu-workflow.sh | Accepts/normalizes the new stm32h563-m33mu-freertos workflow name and jobs. |
| tools/scripts/run-m33mu-ci-in-container.sh | Adds FreeRTOS build/run jobs, resolves m33mu binary path, and tweaks CI checks. |
| src/port/stm32h563/target_tzen.ld | Aligns/defines heap+stack reservations similar to non-TZEN linker script and reserves space. |
| src/port/stm32h563/Makefile | Introduces FREERTOS build mode, pulls in FreeRTOS + BSD socket wrapper sources, and adjusts wolfSSL source selection. |
| src/port/stm32h563/main.c | Boots either bare-metal or FreeRTOS server tasks; tightens SAU config for TZEN; adds FreeRTOS failure hooks. |
| src/port/stm32h563/ivt.c | Adjusts vector table handler references to support FreeRTOS SVC/PendSV/SysTick handlers. |
| src/port/stm32h563/FreeRTOSConfig.h | Adds a FreeRTOS configuration for STM32H563 builds. |
| src/port/stm32h563/https_server_freertos.h | Declares FreeRTOS HTTPS server start API. |
| src/port/stm32h563/https_server_freertos.c | Implements a simple TLS1.3 HTTPS server running in a FreeRTOS task via BSD-socket wrappers. |
| src/port/stm32h563/echo_server_freertos.h | Declares FreeRTOS echo server start API. |
| src/port/stm32h563/echo_server_freertos.c | Implements a TCP echo server running in a FreeRTOS task via BSD-socket wrappers. |
| .github/workflows/stm32h563-m33mu-freertos.yml | Adds a CI workflow that runs the FreeRTOS echo job inside the m33mu container. |
| .github/workflows/stm32h563-m33mu-ssh-tzen.yml | Adds a CI workflow for TZEN SSH testing (currently validating via SSH banner). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
(replaced xorshift-based unsecure RNG in STM32H5 demo with TRNG)
dgarske
left a comment
There was a problem hiding this comment.
LGTM — all CI checks passing.