1+ # wolfBoot configuration for NXP S32K144
2+ #
3+ # S32K144: Cortex-M4F, 512KB Flash, 64KB SRAM
4+ # Flash sector size: 4KB (larger flash variants use 4KB sectors)
5+ # Default: RUN mode at 48 MHz (FIRC - internal RC oscillator)
6+ #
7+ # Build: cp config/examples/nxp-s32k144.config .config && make
8+
9+ ARCH?=ARM
10+ CORTEX_M4?=1
11+ NO_MPU=1
12+ TARGET?=s32k1xx
13+ SIGN?=ECC256
14+ HASH?=SHA256
15+ VTOR?=1
16+ NO_ASM?=0
17+ EXT_FLASH?=0
18+ SPI_FLASH?=0
19+ ALLOW_DOWNGRADE?=0
20+
21+ # S32K1xx flash requires erase before write (cannot re-program same location)
22+ # This is required for sector swap trailer flag updates to work correctly
23+ NVM_FLASH_WRITEONCE?=1
24+
25+ WOLFBOOT_VERSION?=0
26+ V?=0
27+ SPMATH?=1
28+ RAM_CODE?=1
29+ DUALBANK_SWAP?=0
30+
31+ # Select S32K144 variant for correct flash size and sector size
32+ CFLAGS_EXTRA+=-DS32K144
33+
34+ # 4KB sectors (S32K144/146/148 with 512KB+ flash)
35+ WOLFBOOT_SECTOR_SIZE?=0x1000
36+
37+ # Memory layout for S32K144 (512KB Flash):
38+ # Bootloader: 0x00000000 - 0x0000BFFF (48 KB)
39+ # Boot Partition: 0x0000C000 - 0x00043FFF (224 KB)
40+ # Update Partition: 0x00044000 - 0x0007BFFF (224 KB)
41+ # Swap Sector: 0x0007C000 - 0x0007CFFF (4 KB)
42+ WOLFBOOT_PARTITION_SIZE?=0x38000
43+ WOLFBOOT_PARTITION_BOOT_ADDRESS?=0xC000
44+ WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x44000
45+ WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x7C000
46+
47+ # Clock mode: Default is RUN mode with FIRC (48 MHz internal RC)
48+ # To enable HSRUN mode (112 MHz), uncomment below (requires SOSC + SPLL, not fully implemented):
49+ #CFLAGS_EXTRA+=-DS32K1XX_CLOCK_HSRUN
50+
51+ # Optionally enable watchdog
52+ #CFLAGS_EXTRA+=-DWATCHDOG
53+
54+ # Debugging options (uncomment as needed)
55+ DEBUG?=0
56+ DEBUG_SYMBOLS?=0
57+ DEBUG_UART?=0
58+ #CFLAGS_EXTRA+=-DDEBUG_HARDFAULT
0 commit comments