Skip to content
Open
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
6 changes: 6 additions & 0 deletions .github/workflows/test-configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,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
4 changes: 4 additions & 0 deletions arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,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
47 changes: 34 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,33 @@ 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, so memcpy copies words even when source and
# destination alignments differ; about doubles the wolfIP network test rates.
CFLAGS_EXTRA+=-DFAST_MEMCPY

# 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 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 +76,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, which provides
# the interrupt-driven 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
82 changes: 82 additions & 0 deletions config/examples/mcxe31b.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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, so memcpy copies words even when source and
# destination alignments differ.
CFLAGS_EXTRA+=-DFAST_MEMCPY

# 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
Loading
Loading