Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3b19653
mcxe247: standalone interrupt-driven wolfIP driver, TCP/UDP speed test
twcook86 Nov 13, 2026
53b56d8
mcxe247: stop the speed test with Ctrl-C, harden the UDP tests
twcook86 Nov 13, 2026
78e7233
mcxe247: build wolfIP without -ffreestanding
twcook86 Nov 13, 2026
244e0cd
improve FAST_MEMCPY with word copies and cortex-m unaligned reads
twcook86 Nov 15, 2026
f175757
run cpu at 80 MHz and turn on flash code cache
twcook86 Nov 16, 2026
a26b40b
mcxe247: build wolfIP with -O2 and a poll budget of 8
twcook86 Nov 16, 2026
4b1de67
wolfip_speed.py: receive in the sender thread for UDP bidir
twcook86 Nov 16, 2026
2e2e995
mcxe247: make the wolfIP speed test the default network test
twcook86 Nov 16, 2026
5aff80f
mcxe247: run memcpy and the wolfIP checksum from SRAM_L
twcook86 Nov 16, 2026
b3588e1
mcxe247: run the wolfIP speed test in HSRUN at 112 MHz
twcook86 Nov 16, 2026
e5d300b
string: post-increment the FAST_MEMCPY word loop
twcook86 Nov 16, 2026
af3162c
wolfip speed test: fix review findings in the server and host script
twcook86 Nov 17, 2026
6f71bbb
fix xmodem issues
twcook86 Nov 25, 2026
9aedefc
Address pr comments
twcook86 Dec 1, 2026
03718e4
mcxe247: make the unaligned memcpy opt-in, fix review nits
twcook86 Dec 1, 2026
b22cdab
minor fix
twcook86 Dec 1, 2026
33de392
fix xmodem eot issue
twcook86 Dec 1, 2026
27dd4f8
initial commit
twcook86 Nov 18, 2026
42f8973
add wolfip support
twcook86 Nov 18, 2026
7173956
wolfip perf improvements
twcook86 Nov 23, 2026
a210070
rename from e31b_emac to mcxe_emac for more general use
twcook86 Nov 23, 2026
e2edfa7
address copilot/fenrir issues
twcook86 Nov 25, 2026
795c8cc
mcxe31b: opt in to the unaligned memcpy
twcook86 Dec 1, 2026
3eafa25
fix xmodem eot issue
twcook86 Dec 1, 2026
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
6 changes: 6 additions & 0 deletions .github/workflows/test-configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,12 @@ jobs:
arch: arm
config-file: ./config/examples/mcxe247.config

nxp_mcxe31b_test:
uses: ./.github/workflows/test-build.yml
with:
arch: arm
config-file: ./config/examples/mcxe31b.config

max32666_test:
uses: ./.github/workflows/test-build.yml
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ tools/unit-tests/unit-pkcs11_store
tools/unit-tests/unit-sectorflags
tools/unit-tests/unit-spi-flash
tools/unit-tests/unit-string
tools/unit-tests/unit-string-unaligned
tools/unit-tests/unit-wolfip-speed
tools/unit-tests/unit-xmodem-rx
tools/unit-tests/unit-update-flash
tools/unit-tests/unit-update-flash-enc
tools/unit-tests/unit-update-flash-enc-cache
Expand Down
4 changes: 4 additions & 0 deletions arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,10 @@ ifeq ($(ARCH),ARM)
ifeq ($(TARGET),imx95_m7)
CORTEX_M7=1
endif
ifeq ($(TARGET),mcxe31b)
CORTEX_M7=1
ARCH_FLASH_OFFSET=0x00400000
endif
ifeq ($(TARGET),stm32l0)
CORTEX_M0=1
SPI_TARGET=stm32
Expand Down
50 changes: 37 additions & 13 deletions config/examples/mcxe247.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#
# MCXE247: Cortex-M4F, 2MB flash (1.5MB Program Flash + 512KB FlexNVM), 256KB
# SRAM. It is register compatible with the S32K148 and uses the s32k1xx HAL.
# Default: RUN mode at 48 MHz (FIRC - internal RC oscillator)
# Default: RUN mode at 80 MHz (crystal + SPLL); the wolfIP speed test uses HSRUN
# at 112 MHz.
#
# Build: cp config/examples/mcxe247.config .config && make

Expand Down Expand Up @@ -30,12 +31,36 @@ DUALBANK_SWAP?=0
# Select the MCXE247 variant. SRAM is ECC protected and holds no valid ECC after
# power-on. WOLFBOOT_RAM_ECC_INIT clears the SRAM the bootloader uses
# (0x1FFFC000-0x20002FFF) at reset so its ECC is valid. The rest of SRAM is the
# application's to initialize.
# application's to initialize (see APP_RAM_ECC_INIT).
CFLAGS_EXTRA+=-DMCXE247 -DWOLFBOOT_RAM_ECC_INIT

# Word-at-a-time memcpy/memset in src/string.c (bootloader and test-app). The
# Cortex-M4 loads unaligned words from RAM and flash, so with
# FAST_MEMCPY_UNALIGNED memcpy copies words even when source and destination
# alignments differ; about doubles the wolfIP network test rates. Nothing on
# this target copies from peripheral registers with memcpy.
CFLAGS_EXTRA+=-DFAST_MEMCPY -DFAST_MEMCPY_UNALIGNED

# Run at 80 MHz from the 8 MHz crystal (SOSC + SPLL) with the 4 KB flash code
# cache on. wolfBoot returns clock and cache to their reset state before it
# starts the application (the cache stays on only if its invalidate times
# out); the test-app then switches both on again.
# Remove to run from the 48 MHz internal oscillator.
CFLAGS_EXTRA+=-DS32K1XX_CLOCK_80MHZ -DS32K1XX_CODE_CACHE

# The wolfIP speed test runs in HSRUN at 112 MHz (bus 56 MHz, flash 28 MHz)
# and returns to RUN at 80 MHz when it stops. Flash cannot be programmed in
# HSRUN, so the console commands that write flash run at 80 MHz.
CFLAGS_EXTRA+=-DS32K1XX_HSRUN_SPEED_TEST

# 4KB sectors
WOLFBOOT_SECTOR_SIZE?=0x1000

# The application's vector table follows the image header and is used in
# place (VTOR). The table must be 1 KB aligned, or the core fetches the vectors
# of IRQ 48 and up from the wrong slots.
IMAGE_HEADER_SIZE?=1024

# Memory layout (Program Flash 0x00000000 - 0x0017FFFF):
# Bootloader: 0x00000000 - 0x0000BFFF (48 KB)
# Boot Partition: 0x0000C000 - 0x000C3FFF (736 KB)
Expand All @@ -54,20 +79,19 @@ CFLAGS_EXTRA+=-DDEBUG_UART_RX_PORT=S32K_PORT_D -DDEBUG_UART_RX_PIN=17
CFLAGS_EXTRA+=-DDEBUG_UART_RX_MUX=PORT_PCR_MUX_ALT3

# wolfIP network test in the test-app (optional)
# Adds the "network" console command. Needs a wolfIP checkout and an MCUXpresso
# SDK (for the fsl_enet driver).
# Adds the "network" console command. Needs a wolfIP checkout with the
# nxp_mcxe_enet driver.
ENABLE_WOLFIP?=0
WOLFBOOT_LIB_WOLFIP?=../lib/wolfip
MCUXPRESSO?=$(PWD)/../NXP/mcuxpresso-sdk/mcuxsdk
# Without WOLFBOOT_TEST_TFTP the command only acquires a DHCP lease. The file
# must fit the 40 KB receive buffer.
WOLFBOOT_TEST_TFTP?=1
# By default the command acquires a DHCP lease and runs a TCP and UDP
# throughput server on port 9, driven from the host by
# tools/scripts/wolfip_speed.py.
WOLFIP_SPEED_TEST?=1
# WOLFBOOT_TEST_TFTP=1 makes the command fetch a file over TFTP instead (it
# overrides WOLFIP_SPEED_TEST). The file must fit the 40 KB receive buffer.
# With both set to 0 the command only acquires a DHCP lease.
WOLFBOOT_TEST_TFTP?=0
CFLAGS_EXTRA+=-DHOST_IP_STR='"192.168.50.1"' -DTFTP_FILENAME='"wolfip_test.bin"'
# WOLFIP_SPEED_TEST=1 makes the command run a TCP throughput server on port 9
# instead (it never returns; reset the board to stop it). WOLFBOOT_TEST_TFTP
# overrides it: with both set to 1 the command runs the TFTP fetch and the speed
# server is never started.
WOLFIP_SPEED_TEST?=0

# Debugging options
DEBUG?=0
Expand Down
84 changes: 84 additions & 0 deletions config/examples/mcxe31b.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# wolfBoot configuration for NXP MCX E31B (FRDM-MCXE31B)
#
# MCXE31B: Cortex-M7, 4 MB code flash (four 1 MB blocks) + 128 KB data flash,
# 8 KB sectors. wolfBoot switches the core from FIRC 48 MHz to the PLL
# (160 MHz) and enables the caches. It runs from flash, with data, bss and the
# RAM_CODE flash routines in the 64 KB CM7_0 DTCM.
#
# Build: cp config/examples/mcxe31b.config .config && make

ARCH?=ARM
TARGET?=mcxe31b
SIGN?=ECC256
HASH?=SHA256
VTOR?=1
NO_ASM?=0
NO_MPU=1
EXT_FLASH?=0
SPI_FLASH?=0
ALLOW_DOWNGRADE?=0

# Each 64-bit ECC segment of the flash can be programmed only once between
# erases
NVM_FLASH_WRITEONCE?=1

WOLFBOOT_VERSION?=0
V?=0
SPMATH?=1
RAM_CODE?=1
DUALBANK_SWAP?=0

# The CM7 DTCM is ECC protected and must be written before it is read
CFLAGS_EXTRA+=-DWOLFBOOT_RAM_ECC_INIT

# 8KB sectors
WOLFBOOT_SECTOR_SIZE?=0x2000

# Word-at-a-time memcpy/memset in src/string.c (bootloader and test-app). The
# Cortex-M7 loads unaligned words from RAM and flash, so with
# FAST_MEMCPY_UNALIGNED memcpy copies words even when source and destination
# alignments differ. Nothing on this target copies from peripheral registers
# with memcpy.
CFLAGS_EXTRA+=-DFAST_MEMCPY -DFAST_MEMCPY_UNALIGNED

# The application's vector table follows the image header and is used in
# place (VTOR). The table must be 1 KB aligned, or the core fetches the vectors
# of some IRQs (e.g. EMAC, 105) from the wrong slots.
IMAGE_HEADER_SIZE?=1024

# Memory layout (code flash 0x00400000 - 0x007FFFFF):
# IVT + Bootloader: 0x00400000 - 0x0040FFFF (64 KB)
# Boot Partition: 0x00410000 - 0x005EFFFF (1920 KB)
# Update Partition: 0x005F0000 - 0x007CFFFF (1920 KB)
# Swap Sector: 0x007D0000 - 0x007D1FFF (8 KB)
# 0x007D4000 - 0x007FFFFF is left free: it holds the Secure BAF and, when the
# security firmware feature flag is set, the security firmware.
WOLFBOOT_PARTITION_SIZE?=0x1E0000
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x410000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x5F0000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x7D0000

# Console on the MCU-Link VCOM port: LPUART5, PTE14 (TX) and PTE3 (RX),
# 115200 8N1

# wolfIP network test in the test-app (optional)
# Adds the "network" console command. Needs a wolfIP checkout, which provides
# the nxp_mcxe_emac driver (EMAC, RMII to the LAN8741 PHY). The driver is
# interrupt driven; NXP_MCXE_EMAC_IRQ=0 makes it poll the EMAC instead.
ENABLE_WOLFIP?=0
WOLFBOOT_LIB_WOLFIP?=../lib/wolfip
NXP_MCXE_EMAC_IRQ?=1
# By default the command acquires a DHCP lease and runs a TCP and UDP
# throughput server on port 9, driven from the host by
# tools/scripts/wolfip_speed.py.
WOLFIP_SPEED_TEST?=1
# WOLFBOOT_TEST_TFTP=1 makes the command fetch a file over TFTP instead (it
# overrides WOLFIP_SPEED_TEST). The file must fit the 128 KB receive buffer.
# With both set to 0 the command only acquires a DHCP lease.
WOLFBOOT_TEST_TFTP?=0
CFLAGS_EXTRA+=-DHOST_IP_STR='"192.168.50.1"' -DTFTP_FILENAME='"wolfip_test.bin"'

# Debugging options
DEBUG?=0
DEBUG_SYMBOLS?=0
DEBUG_UART?=1
2 changes: 0 additions & 2 deletions config/examples/nxp-s32k142.config
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x25000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x3E000

# Clock mode: Default is RUN mode with FIRC (48 MHz internal RC)
# To enable HSRUN mode (112 MHz), uncomment below (requires SOSC + SPLL, not fully implemented):
#CFLAGS_EXTRA+=-DS32K1XX_CLOCK_HSRUN

# Optionally enable watchdog
#CFLAGS_EXTRA+=-DWATCHDOG
Expand Down
2 changes: 0 additions & 2 deletions config/examples/nxp-s32k144.config
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x44000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x7C000

# Clock mode: Default is RUN mode with FIRC (48 MHz internal RC)
# To enable HSRUN mode (112 MHz), uncomment below (requires SOSC + SPLL, not fully implemented):
#CFLAGS_EXTRA+=-DS32K1XX_CLOCK_HSRUN

# Optionally enable watchdog
#CFLAGS_EXTRA+=-DWATCHDOG
Expand Down
2 changes: 0 additions & 2 deletions config/examples/nxp-s32k146.config
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x80000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xF4000

# Clock mode: Default is RUN mode with FIRC (48 MHz internal RC)
# To enable HSRUN mode (112 MHz), uncomment below (requires SOSC + SPLL, not fully implemented):
#CFLAGS_EXTRA+=-DS32K1XX_CLOCK_HSRUN

# Optionally enable watchdog
#CFLAGS_EXTRA+=-DWATCHDOG
Expand Down
2 changes: 0 additions & 2 deletions config/examples/nxp-s32k148.config
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0xC4000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x17C000

# Clock mode: Default is RUN mode with FIRC (48 MHz internal RC)
# To enable HSRUN mode (112 MHz), uncomment below (requires SOSC + SPLL, not fully implemented):
#CFLAGS_EXTRA+=-DS32K1XX_CLOCK_HSRUN

# Optionally enable watchdog
#CFLAGS_EXTRA+=-DWATCHDOG
Expand Down
Loading
Loading