-
Notifications
You must be signed in to change notification settings - Fork 230
Add MIMXRT1176 (i.MX RT1170) support #466
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
Add MIMXRT1176 (i.MX RT1170) support #466
Conversation
c8b31f5 to
f559018
Compare
Add support for MIMXRT1176 including direct flash boot (XIP) mode. Build system: - Add FLASH_BUILD=1 option for flash-resident builds - Fix UF2_MIMXRT1176_ADDR to 0x30000400 (FCFB at 0x400 offset) - Use MCU-specific memory.ld for MIMXRT1176 Linker scripts: - Add MIMXRT1176_flash.ld for XIP boot configuration - Update MIMXRT1176_memory.ld to support both RAM and flash builds Flash operations: - Fix SCB_InvalidateDCache_by_Addr to use absolute address instead of offset (was causing cache corruption on Cortex-M7) - Add XIP detection to skip FlexSPI re-init when running from flash - Add ROM_API_Init() call required for MIMXRT1176 USB support: - Add optional USB_PWR_PINMUX for boards with USB power control - Fix USB PHY PLL reference clock for RT1176 (24MHz, not 480MHz) Board support: - Add imxrt1170_evk board with clock configuration supporting both RAM (SDP) and flash (XIP) boot modes Other fixes: - Fix CFG_TUSB_MEM_ALIGN to 32 bytes for M7 DCache compatibility - Add MIMXRT1176-specific sources to family.cmake - Update README with RT1170-EVK and FLASH_BUILD documentation
f559018 to
46ba35e
Compare
560c8e9 to
65a8643
Compare
Add automated two-stage flashing via `make flash-sdp` for RT1170/RT1176: - Uses blhost from NXP SPSDK (pip install spsdk) - Loads NXP flashloader, then programs TinyUF2 to external flash - Supports both FLASH_BUILD=1 (two-stage) and RAM builds (direct load) - Configurable FLASHLOADER path for custom flashloader binaries Usage: make BOARD=imxrt1170_evk FLASH_BUILD=1 flash-sdp FLASHLOADER=/path/to/ivt_flashloader.bin Also updates README with detailed RT1170 flashing instructions and uses runtime is_running_from_flash() check in board_flash.c for self-flash.
65a8643 to
9021780
Compare
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.
Pull request overview
This PR adds support for the MIMXRT1176 (i.MX RT1170) microcontroller with flash boot capability (XIP - Execute In Place). The implementation differs from other RT10xx chips by supporting both RAM-based SDP loading and direct flash boot, using a two-stage flashloader approach with blhost instead of sdphost. The PR includes support for the MIMXRT1170-EVKB evaluation board and fixes a cache invalidation bug affecting all IMXRT boards.
Key Changes:
- Added MIMXRT1176 linker scripts for both RAM (_ram.ld) and flash (_flash.ld) boot modes
- Implemented XIP detection to prevent FlexSPI re-initialization when running from flash
- Fixed cache invalidation bug by using absolute addresses instead of offsets
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ports/mimxrt10xx/tusb_config.h | Changed USB memory alignment from 4-byte to 32-byte for DCache compatibility |
| ports/mimxrt10xx/linker/MIMXRT1176_ram.ld | New RAM boot linker script with adjusted memory regions for SDP loading |
| ports/mimxrt10xx/linker/MIMXRT1176_memory.ld | New memory layout file defining MIMXRT1176-specific memory regions and offsets |
| ports/mimxrt10xx/linker/MIMXRT1176_flash.ld | New flash boot linker script for XIP operation with 0x400 FCFB offset |
| ports/mimxrt10xx/family.cmake | Added conditional compilation for MIMXRT1176-specific SDK files and drivers |
| ports/mimxrt10xx/boards/imxrt1170_evk/flash_config.c | New FlexSPI NOR flash configuration for IS25WP128 flash on RT1170-EVK |
| ports/mimxrt10xx/boards/imxrt1170_evk/clock_config.h | New clock configuration header for RT1170 dual-core support |
| ports/mimxrt10xx/boards/imxrt1170_evk/clock_config.c | New clock initialization with XIP vs SDP detection and minimal OSC-based config |
| ports/mimxrt10xx/boards/imxrt1170_evk/board.mk | New board makefile defining MCU variant and flash targets |
| ports/mimxrt10xx/boards/imxrt1170_evk/board.h | New board configuration with LED, button, USB, and UART pin definitions |
| ports/mimxrt10xx/boards/imxrt1170_evk/board.cmake | New CMake board configuration for RT1170-EVK |
| ports/mimxrt10xx/boards.c | Added MIMXRT1176-specific USB PHY PLL initialization and board-configurable PHY calibration |
| ports/mimxrt10xx/board_flash.c | Added XIP detection, ROM_API_Init call, and fixed cache invalidation bug |
| ports/mimxrt10xx/README.md | Added comprehensive RT1170 documentation including build instructions and flashing guide |
| ports/mimxrt10xx/Makefile | Added FLASH_BUILD support and blhost-based flash-sdp target for RT1176 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #define SKIP_DCDC_ADJUSTMENT 1 | ||
| #define SKIP_FBB_ENABLE 1 | ||
| #define SKIP_LDO_ADJUSTMENT 1 |
Copilot
AI
Dec 19, 2025
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.
The macros SKIP_DCDC_ADJUSTMENT, SKIP_FBB_ENABLE, and SKIP_LDO_ADJUSTMENT are defined but never used anywhere in this file. If these are meant to be conditional compilation flags for code that was removed or not yet implemented, they should either be removed or the relevant conditional code should be added.
| #define SKIP_DCDC_ADJUSTMENT 1 | |
| #define SKIP_FBB_ENABLE 1 | |
| #define SKIP_LDO_ADJUSTMENT 1 |
- rename memory.ld to boot.ld - calculate ivt origin from fcfb - correct sram linker value for 102x, 105x, 106x
d2f8b5e to
47c841b
Compare
hathach
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.
@APIUM exellent work, thank you very much of the PR. I refactor and update PR to get SRAM version working as well. Binary is flashable via either jlink and/or sdp using blhost. For BLhost we need to create image with ivt at zero address there for need to cook the ivt header (boot start + size). Also when loaded by blhost, fcfb is not part of the image, therefore I added an fcfb copy and ivt/boot copy so that we can re-create those section.
I think we should only keep the flash-store ram-executed version only of tinyuf2, there is no benefit for the flash XIP (FLASH_BUILD) verion. It is not only slower, but is not self upgradable. Let me know what you think if that makes sense, we will just remove the FLASH_BUILD related code.
PS: LED for evkb is not working due to hard coded pinmux, I will fix this in follow up PR later.
Thanks for the changes and explanation, I’m on phone only so have only given a cursory look but they look good.
Sounds reasonable to me, I’m happy to do this, but I’m away and not back until early Jan so if you have time before then and want it done no worries
Ah yes I noticed this but didn’t look into it - makes sense |
|
@APIUM great, I am glad that makes sense to you. Jan is OK, though I would be busy with other works so I think I will just do it now while having all the imxrt evk from 1011 to 1170 on my desk now. |
hathach
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.
thank you very much for your PR. I have wrap up the rt117x support with flash stored, ram executed like other rt10xx. blhost and cooked ivt0 give me a bit of troubleshooting, but it is on running OK now. I would expect newer imxrt would use blhost instead of sdphost, so it is great to get it supported. @APIUM should there is any issue when you get back to your pc. Let me know, we can fix it with follow up pr.
Great to have this merged, thanks for your help and follow up work @hathach. I will let you know if I have any issues. |
|
@APIUM I made an follow up PR to fix rt1170 evk LED and also refactor to use the .mex (mcux pinconfig tool) to make it easier to config pin/clock. Though I found that rt1170 run with very low cpu frequency i.e. 24MH comparing to other smaller chip with 600Mhz. I tried to tweak it to its nominal freq at 900mhz, although tinyuf2 can boot, but jumping to app e.g blinky does not work. Not sure what is wrong but If you could find time to fix it, it would be great thank you. PS: pr is #469 |
|
@hathach was able to have a look at this today, does this change fix it for you? I could only test on my customboard so not 100% it sorts it out on the EVK but I'm not sure why it wouldn't. Still does initial SDP flash at 24MHz, but as soon as it's on flash it's full speed and working well for me. |
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
UF2_BOARD_IDin your board.h follow correct format from uf2 specsCould we get a PID for the 1170 evkb please? I have put one in this change but will update it on assignment.
Description of Change
Add support for MIMXRT1176. We are using this on an 1176 custom board, but I've added support for the 1170EVKB eval board as well. These are the changes I needed/used to get it working correctly.
I did this with XIP, as with the 1176 the memory layout is complex with the M4/M7 split and there were clock/power state differences running in SDP vs booting from flash, so this made it much easier to build in support.
I haven't tested on any other boards (as I don't have any on hand) but there shouldn't be any changes that would negatively affect them. There is a fix in here that should affect all imxrt boards though, we were calling SCB_InvalidateDCache_by_Addr with the offset, which could have been leaving stale data in the cache.
I think all the copyright headers are correct.
Thanks for reviewing the change.