-
Notifications
You must be signed in to change notification settings - Fork 136
Support for NXP S32K14XX #661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- HAL: Flash (FTFC), UART (LPUART1), Clock (FIRC 48MHz), Watchdog - Requires NVM_FLASH_WRITEONCE=1 and RAM_CODE=1 for proper operation - Test app with interactive console: status, trigger, success, reboot - LED indicators: Green (v1), Blue (v2+) - Flash automation script: tools/scripts/nxp-s32k142-flash.sh - Tested on S32K142EVB with sector swap update Supported variants: S32K142 (256KB), S32K144 (512KB), S32K146 (1MB), S32K148 (2MB)
danielinux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Port is complete (docs, tests). Builds fine. Just one thought/consideration on skipping FCF writes.
| /* CRITICAL: Protect the Flash Configuration Field (FCF) region. | ||
| * Writing incorrect values to 0x400-0x40F can permanently lock the device! | ||
| * The FCF is programmed once in the flash_config section and should never | ||
| * be modified at runtime. | ||
| */ | ||
| if ((address < FCF_END_ADDR) && ((address + len) > FCF_START_ADDR)) { | ||
| /* Requested write overlaps with FCF region - this is dangerous! | ||
| * Skip the FCF portion to prevent device locking. | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I wonder if this would affect self-update in any way? It looks like it should not, as the writing is silently discarded and 0 is returned. The new (signed) wolfboot should contain a valid FCF, and self-update will try to overwrite this area, but as long as FCF remains constant across self-updates this should be OK.
Add NXP S32K1xx Support
This PR adds full wolfBoot support for the NXP S32K1xx automotive microcontroller family (S32K142, S32K144, S32K146, S32K148).
Summary
Adds a complete bare-metal HAL implementation for the S32K1xx Cortex-M4F family with sector-swap firmware update capability. Tested on S32K142EVB with successful firmware updates.
Features
HAL Implementation (
hal/s32k1xx.c,hal/s32k1xx.h):Test Application (
test-app/app_s32k1xx.c):status,trigger,success,reboot,helpConfiguration Files:
config/examples/nxp-s32k142.config- 256KB Flash, 32KB SRAM, 2KB sectorsconfig/examples/nxp-s32k144.config- 512KB Flash, 64KB SRAM, 4KB sectorsconfig/examples/nxp-s32k146.config- 1MB Flash, 128KB SRAM, 4KB sectorsconfig/examples/nxp-s32k148.config- 2MB Flash, 256KB SRAM, 4KB sectorsTooling:
tools/scripts/nxp-s32k142-flash.sh- Automated build, sign, and flash script using J-LinkMemory Layout (S32K142)
Important Configuration Requirements
NVM_FLASH_WRITEONCE=1- Required because S32K1xx flash cannot be reprogrammed without eraseRAM_CODE=1- Required because flash cannot be read while being programmedBuild & Test
Files Changed
hal/s32k1xx.c,hal/s32k1xx.h,hal/s32k1xx.ld,test-app/app_s32k1xx.c,test-app/ARM-s32k1xx.lddocs/Targets.mdTesting
Verified on S32K142EVB: