Skip to content

[WIP] boards/arm/imxrt: Add frdm-imxrt1186 CM33 nsh. - #19858

Closed
ajlennon wants to merge 1 commit into
apache:masterfrom
ajlennon:feat/mimxrt1180-evk-cm33-nsh
Closed

[WIP] boards/arm/imxrt: Add frdm-imxrt1186 CM33 nsh.#19858
ajlennon wants to merge 1 commit into
apache:masterfrom
ajlennon:feat/mimxrt1180-evk-cm33-nsh

Conversation

@ajlennon

@ajlennon ajlennon commented Aug 15, 2026

Copy link
Copy Markdown

Summary

  • Add MIMXRT1186 Cortex-M33 support under arch/arm/src/imxrt (ARCH_FAMILY_IMXRT118x).
  • Teach ARCH_CHIP_IMXRT to select Cortex-M7 or Cortex-M33 per chip.
  • Add FRDM-IMXRT1186 configs:
    • nsh — LPUART1, ITCM/OCRAM debugger RAM-load
    • nsh-xip — FlexSPI2 XIP at secure AHB 0x14000000
    • usbnsh — USB CDC/ACM system console on OTG1 J63
    • netnsh / netnsh-xip — RT118x NETC Ethernet + DHCP (link-wait)
  • Clear inherited ARMv8-M MSPLIM/PSPLIM; ELE/TRDC ownership; SYS_PLL3 @ 480 MHz; M33 @ 240 MHz.
  • CMake + GNU Make board integration (src/Makefilelibboard.a).
  • Board implementation status: board documentation.
  • Hardware evidence and retained logs: board testing record; full XIP ostest serial log: ostest-xip.log.
  • Board docs follow Documentation/contributing/doc_templates/board.rst.

Out of scope: LED/button drivers, CM7, MCUBoot, fuse/AHAB. No MIMXRT1180-EVK / RT1189 claim.

BSP status

Area Tested on FRDM-IMXRT1186
CM33 RAM-load NSH / clocks / ELE / SysTick PASS
apps/testing/ostest waited full suite (RAM-load) PASS
apps/testing/ostest waited full suite (FlexSPI2 XIP @ 0x14000000) PASS
FlexSPI2 XIP true POR (uhubctl, no gdb) PASS
USB CDC NSH on J63 PASS
NETC MDIO / 1 Gbit link / DHCP ACK 192.168.2.248/24 PASS (board→LAN ping not re-proven after RX BDR1 fix; host→board ICMP replied earlier)
LEDs / button Not in this PR

Impact

  • New feature: YES — FRDM CM33 NSH, clocks, XIP, USB CDC, NETC/DHCP.
  • User adaptation: NO for existing boards.
  • Build: NO for existing boards (new board/chip family only).
  • Hardware: YES — new FRDM-IMXRT1186 board support (MIMXRT1186).
  • Documentation: YES — board page under Documentation/platforms/arm/imxrt/boards/frdm-imxrt1186/.
  • Security: NO fuse/AHAB changes; ELE ownership transfer is fail-closed at startup.
  • Compatibility: NO intentional break for existing IMXRT boards.

Testing

The maintained FRDM-IMXRT1186 testing record documents the hardware methods, results, and limitations. The complete XIP ostest serial log is ostest-xip.log.

I confirm that changes are verified on local setup and work as intended.

  • Build Host: Ubuntu Linux (x86_64), Arm GNU Toolchain 13.2.1, CMake/Ninja + GNU Make
  • Target: frdm-imxrt1186 — configs nsh, nsh-xip, usbnsh, netnsh, netnsh-xip
  • Probe: MCU-Link CMSIS-DAP WGUPS4RWFPGOT
  • Focused fork preflight: run 31956932658

CMake configure/build for nsh, nsh-xip, usbnsh, and netnsh-xipPASS.

OS smoke on board (XIP POR → NSH)

True FlexSPI2 XIP power-on reset (wirebootconfig xxxx, LinkServer flash @ 0x14000000, uhubctl hub cycle, no gdb on boot path). Serial console on MCU-Link VCOM:

nsh> uname -a
NuttX 13.0.0 d4ba1324ff6-dirty Aug 16 2026 17:48:39 arm frdm-imxrt1186
nsh> help
help usage:  help [-v] [<cmd>]
...
Builtin Apps:
    dd     nsh    sh
nsh> uptime
00:00:00 up  0:00, load average: 0.00, 0.00, 0.00

Debugger RAM-load nsh previously also reached nsh> with help / uname -a / uptime, g_imxrt118x_clock_status=0x7f, g_imxrt118x_clock_error=0, live SYS_PLL3_CTRL=0x2020201b, M33 root 0x00000201, LPUART0102 root 0x00000209.

apps/testing/ostest full suite (RAM-load)

Full waited run on PR tip 8c2513fbdd8, with CONFIG_SCHED_WAITPID=y, CONFIG_TESTING_OSTEST=y, CONFIG_TESTING_OSTEST_WAITRESULT=y, and one loop. The image was loaded by LinkServer through MCU-Link.

The test-only RAM link kept executable text in ITCM and placed read-only data in OCRAM so the full suite would fit beyond the board's 128 KiB ITCM; this does not change the production nsh layout.

nsh> ostest
ostest_main: Started user_main at PID=4
...
user_main: waitpid test
...
wdog_test end...
...
barrier_test: Thread 7 completed with result=0
...
sched_lock: PASSED No pre-emption occurred while scheduler was locked.
sched_lock: Finished
...
user_main: Exiting
ostest_main: Exiting with status 0
nsh>

No ERROR, panic, assertion, or failure line was emitted.

apps/testing/ostest full suite (XIP)

Complete serial log: ostest-xip.log.

Full waited run on PR tip 8c2513fbdd8 (CONFIG_TESTING_OSTEST=y,
CONFIG_SCHED_WAITPID=y, CONFIG_TESTING_OSTEST_WAITRESULT=y, one loop).
Image flashed with LinkServer to secure FlexSPI2 0x14000000; .text at
0x1400b000. ~2m02s to exit.

nsh> ostest
ostest_main: Started user_main at PID=4
...
wdog_test end...
...
barrier_test: Thread 7 completed with result=0
...
sched_lock: PASSED No pre-emption occurred while scheduler was locked.
...
user_main: Exiting
ostest_main: Exiting with status 0
nsh>

No ERROR, panic, assertion, or failure line was emitted.

USB CDC console (J63)

usbnsh RAM-load; host enumerated 0525:a4a7 as cdc_acm:

Bus 001 Device 034: ID 0525:a4a7 Netchip Technology, Inc. Linux-USB Serial Gadget (CDC ACM mode)
DEVNAME=/dev/ttyACM2
ID_VENDOR=NuttX
ID_MODEL=CDC_ACM_Serial
ID_USB_DRIVER=cdc_acm

NuttShell (NSH) NuttX-13.0.0
nsh> uname -a
NuttX 13.0.0 103f4e2e9fe-dirty Aug 16 2026 22:10:43 arm frdm-imxrt1186
CDC_NSH_PROOF_PASS

NETC / DHCP

ENETC1 + switch path; DHCP ACK on lab LAN:

dhcpc_request: Received ACK
dhcpc_request: Got IP address 192.168.2.248
dhcpc_request: Got netmask 255.255.255.0
dhcpc_request: Got DNS server 0: 192.168.2.1
dhcpc_request: Got default router 192.168.2.1
dhcpc_request: Lease expires in 86400 seconds

nsh> ifconfig
eth0    Link encap:Ethernet HWaddr 02:00:00:01:03:00 at RUNNING mtu 576
        inet addr:192.168.2.248 DRaddr:192.168.2.1 Mask:255.255.255.0

Host→board ICMP while that address was held (earlier same-day evidence):

PING 192.168.2.248 (192.168.2.248) 56(84) bytes of data.
64 bytes from 192.168.2.248: icmp_seq=1 ttl=64 time=71.2 ms
64 bytes from 192.168.2.248: icmp_seq=2 ttl=64 time=38.2 ms
64 bytes from 192.168.2.248: icmp_seq=3 ttl=64 time=27.0 ms
3 packets transmitted, 3 received, 0% packet loss

Board→LAN ping was not re-proven after the later RX BDR1 fix; DHCP ACK / ifconfig remain the networking claim.

Testing logs before change

N/A — new board / chip-family support (no prior frdm-imxrt1186 baseline on this tree).

Testing logs after change

See the board testing record and the full XIP ostest serial log ostest-xip.log, plus the USB CDC and NETC/DHCP transcripts above.

PR verification Self-Check

  • Single squash on current master.
  • XIP + USB + NETC included with hardware evidence; LEDs excluded.
  • Board documentation aligned to doc_templates/board.rst.
  • No RT1189 claim; DCO + Assisted-by:; still draft/WIP.
  • This PR is still work in progress (not ready for review).

AI assistance

Prepared with assistance from Cursor. Commits use Assisted-by: above human Signed-off-by:; no AI Co-authored-by.

@ajlennon

Copy link
Copy Markdown
Author

Host regression note: after this change, imxrt1170-evk:nsh still configures and links cleanly on the same tree (sanity-checked locally).

EVK serial proof is still pending — no MIMXRT1180-EVK attached on the development host yet. Happy to attach an nsh> transcript when available.

@github-actions github-actions Bot added Area: Build system Arch: arm Issues related to ARM (32-bit) architecture Size: L The size of the change in this PR is large Board: arm labels Aug 15, 2026
@acassis

acassis commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

@PetervdPerk could you please help to review? It is based on your i.MX RT1170 port

@acassis

acassis commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

@ajlennon Cursor made some mistakes:

Used config files:
    1: .codespellrc
ERROR __main__.py:618: Check failed: /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/imxrt/CMakeLists.txt

cmake-format check failed, run following command to update the style:
  $ cmake-format <src> -o <dst>

ERROR __main__.py:618: Check failed: /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/imxrt/CMakeLists.txt
Warning: /home/runner/work/nuttx/nuttx/nuttx/boards/arm/imxrt/imxrt1180-evk/include/board.h:10:1: warning: #include outside of 'Included Files' section
Warning: /home/runner/work/nuttx/nuttx/nuttx/boards/arm/imxrt/imxrt1180-evk/include/board.h:12:1: warning: #include outside of 'Included Files' section
ERROR __main__.py:618: Check failed: /home/runner/work/nuttx/nuttx/nuttx/boards/arm/imxrt/imxrt1180-evk/src/CMakeLists.txt
Some checks failed. For contributing guidelines, see:
  https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md
Error: Process completed with exit code 1.

@ajlennon

Copy link
Copy Markdown
Author

Thanks guys - Cursor is a bit overly keen here! I will change this to WIP ! Sorry to be a bother! I am about to smoke test this on an EVK board here...

@ajlennon ajlennon changed the title boards/arm/imxrt: Add imxrt1180-evk CM33 nsh WIP: boards/arm/imxrt: Add imxrt1180-evk CM33 nsh Aug 15, 2026
@acassis

acassis commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Please replace:
Co-authored-by: Cursor cursoragent@cursor.com
with:
Assisted-by: Cursor cursoragent@cursor.com

Legally AI cannot assume Copyright, see: https://en.wikipedia.org/wiki/Monkey_selfie_copyright_dispute

@ajlennon

Copy link
Copy Markdown
Author

Marked WIP (draft + title).

CI issues from Alan's note are addressed in a932f4d:

  • cmake-format on arch/arm/src/imxrt/CMakeLists.txt and boards/.../imxrt1180-evk/src/CMakeLists.txt
  • board.h nxstyle Included Files / license header sections
  • Docs RST title overline length (imxrt1180-evk/index.rst)

Still pending: MIMXRT1180-EVK serial nsh> smoke test before removing WIP.

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@github-actions github-actions Bot added Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. and removed Size: L The size of the change in this PR is large labels Aug 15, 2026
@ajlennon
ajlennon force-pushed the feat/mimxrt1180-evk-cm33-nsh branch 3 times, most recently from 51cc518 to e8aeb16 Compare August 15, 2026 11:38
@ajlennon

Copy link
Copy Markdown
Author

@acassis Thanks — updated trailers per your note and NuttX CONTRIBUTING.md: replaced Co-authored-by: Cursor … with Assisted-by: Cursor … (Assisted-by above Signed-off-by). We have encoded the same rule for future DD/AESL agent commits.

Reference: https://en.wikipedia.org/wiki/Monkey_selfie_copyright_dispute

@ajlennon
ajlennon force-pushed the feat/mimxrt1180-evk-cm33-nsh branch from e8aeb16 to f1ebb9b Compare August 15, 2026 11:38
@ajlennon ajlennon changed the title WIP: boards/arm/imxrt: Add imxrt1180-evk CM33 nsh [WIP] boards/arm/imxrt: Add imxrt1180-evk CM33 nsh. Aug 15, 2026
@ajlennon

Copy link
Copy Markdown
Author

Follow-up on CONTRIBUTING compliance (re-read guide after your Assisted-by note):

  • Title set to [WIP] + remains draft until real EVK nsh> runtime logs exist (CONTRIBUTING 1.7 / 1.9).
  • DTCM debugger load on MIMXRT1180-EVK is proven on our lab host; image still faults before console — so HW runtime proof is not claimed yet.
  • Will align commit trailers to Assisted-by: Cursor:<model> form and topic trailing . before undrafting.

@ajlennon

Copy link
Copy Markdown
Author

The MIMXRT1180-EVK hardware smoke test now passes.

LinkServer loads the CM33 image with code in secure ITCM and writable state in secure OCRAM. The board reaches NSH over MCU-LINK LPUART1 at 115200 baud; uname -a and help both run successfully.

The early UsageFault was CFSR.STKOF: ROM/LinkServer left MSPLIM/PSPLIM active, so the first C prologue faulted. b4fdeb415a clears both limits before entering C startup.

MIMXRT1180-EVK NSH hardware boot proof

Posted by Cursor on Alex's behalf.

@ajlennon ajlennon changed the title [WIP] boards/arm/imxrt: Add imxrt1180-evk CM33 nsh. boards/arm/imxrt: Add imxrt1180-evk CM33 nsh. Aug 15, 2026
@ajlennon
ajlennon marked this pull request as ready for review August 15, 2026 14:21
@ajlennon
ajlennon requested a review from masayuki2009 as a code owner August 16, 2026 14:10
@ajlennon
ajlennon marked this pull request as draft August 16, 2026 14:11

@linguini1 linguini1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include more detailed testing information, like runtime logs and an OS test run on the board.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the board doc template.

@ajlennon

Copy link
Copy Markdown
Author

Runtime verification update, with scope kept explicit:

  • The frdm-imxrt1186:nsh image was loaded through LinkServer into the ITCM/OCRAM debugger-load layout and reached the LPUART1 nsh> prompt on the FRDM-IMXRT1186.
  • OS smoke covered help, uname -a, and uptime; uname -a reports NuttX 13.0.0 / ARM / frdm-imxrt1186, and uptime advances at approximately one second per second.
  • Clock/ELE state after boot: g_imxrt118x_clock_status=0x7f, g_imxrt118x_clock_error=0; live values include SYS_PLL3_CTRL=0x2020201b, M33 root 0x00000201, and LPUART0102 root 0x00000209.
  • The focused fork preflight remains green: checkpatch, CMake/Ninja, Apache-style cibuild/defconfig normalisation, Apache Lint, documentation, and GNU Make libboard.a all pass in run 31956932658.

Separate fork-only bring-up has also now proved NETC receive plus DHCP ACK (192.168.2.248/24) and USB device enumeration on J63 (0525:a4a7, Linux cdc_acm). Those implementations are not part of this PR. Debugger-started XIP works, but true POR still remains in Boot ROM near 0x100157f4; USB CDC enumeration works, but bidirectional NSH traffic over the new tty is not yet proved.

This PR therefore remains the focused CM33 NSH/clocks debugger-load slice, without a POR-boot, NETC, XIP, or USB scope claim.

Posted by Cursor on Alex's behalf.

@ajlennon

Copy link
Copy Markdown
Author

Correction to the USB fork-only note above: CDC NSH is now proved end-to-end on J63.

Fork tip ed50ad17c93 makes CDC/ACM the usbnsh system console rather than using sercon only to register a serial device. On a fresh debugger RAM load, Linux enumerated 0525:a4a7 as cdc_acm on /dev/ttyACM2; three carriage returns produced nsh>, and uname -a returned:

NuttX 13.0.0 ed50ad17c93-dirty Aug 16 2026 22:10:43 arm frdm-imxrt1186

This remains fork-only evidence and does not change the scope of this CM33 NSH/clocks PR.

Posted by Cursor on Alex's behalf.

@ajlennon
ajlennon force-pushed the feat/mimxrt1180-evk-cm33-nsh branch 2 times, most recently from 1bb0777 to 604e10d Compare August 16, 2026 21:34
@ajlennon
ajlennon force-pushed the feat/mimxrt1180-evk-cm33-nsh branch 2 times, most recently from 3235d4d to 643d283 Compare August 16, 2026 21:52
@ajlennon

ajlennon commented Aug 16, 2026

Copy link
Copy Markdown
Author

@linguini1 Thanks — addressed your two notes on tip 643d283125c:

  1. Testing — PR description now includes board runtime transcripts for XIP POR OS smoke (uname / help / uptime), USB CDC NSH on J63, and NETC DHCP ACK 192.168.2.248/24 (plus earlier host→board ICMP). Board→LAN ping after the RX BDR1 fix is still not re-claimed.
  2. Board docsDocumentation/platforms/arm/imxrt/boards/frdm-imxrt1186/index.rst rewritten to follow Documentation/contributing/doc_templates/board.rst (tags, Features, Buttons/LEDs, Pin Mapping, Install/Build/Flash, Configurations).

PR remains [WIP] / draft. We will add an apps/ostest run next.

Posted by Cursor on Alex's behalf.

@linguini1

Copy link
Copy Markdown
Contributor

Do not respond to my comments with AI.

@ajlennon

Copy link
Copy Markdown
Author

Do not respond to my comments with AI.

Sure - no more responses from me to you.

@linguini1

Copy link
Copy Markdown
Contributor

Please include the full runtime logs, not just a truncated version. If it is too much text, you can either put them in Markdown drop-downs or attach the files.

@ajlennon
ajlennon force-pushed the feat/mimxrt1180-evk-cm33-nsh branch from 8c2513f to 59fe16f Compare August 16, 2026 23:29
Comment thread arch/arm/src/imxrt/imxrt_usbdev.c Outdated
Comment thread arch/arm/src/imxrt/imxrt_usbdev.c Outdated
****************************************************************************/

#ifdef CONFIG_ARCH_FAMILY_IMXRT118x
void __attribute__((naked)) noinstrument_function __start(void)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we can use the same __start for all cases.

Comment thread boards/arm/imxrt/frdm-imxrt1186/STATUS.md Outdated
@ajlennon
ajlennon force-pushed the feat/mimxrt1180-evk-cm33-nsh branch from 26dcf81 to 2d3b689 Compare August 17, 2026 07:54
@ajlennon

Copy link
Copy Markdown
Author

@PetervdPerk-NXP @xiaoxiang781216 — force-pushed a single squash of the FRDM RT1186 CM33 work for re-review.

Addressed in this tip:

  • Shared __start / reset dispatcher with existing imxrt paths
  • USB gating via imxrt_periphclks.h (common peripheral-clock interface)
  • Implementation status moved into board RST docs

Local checks on the squash tip: checkpatch clean; frdm-imxrt1186:usbnsh configure/build PASS.

@ajlennon
ajlennon force-pushed the feat/mimxrt1180-evk-cm33-nsh branch 4 times, most recently from c0bb2ec to efd3a51 Compare August 17, 2026 08:16
Add the RT118x CM33 architecture, clocks, FRDM board configurations,
XIP, USB CDC console, and NETC support.

Use a shared reset dispatcher, expose RT118x USB gating through the
common peripheral-clock interface, and keep implementation status in
the board documentation.

Assisted-by: Cursor:Auto
Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk>
@ajlennon
ajlennon force-pushed the feat/mimxrt1180-evk-cm33-nsh branch from efd3a51 to 74a465d Compare August 17, 2026 08:18

@PetervdPerk-NXP PetervdPerk-NXP left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still incomplete after a quick pass:

  • Only a subset of the IRQs is defined.
  • The memory map is not complete.
  • The hardware register definitions therefore cannot yet be considered usable or review-ready.

Please use the i.MX RT1180 SVD to generate the headers and validate the resulting definitions against the hardware documentation. That is likely the simplest way to obtain a complete and consistent register map.

At the moment, the review is effectively being used to drive the implementation step by step. This consumes a significant amount of reviewer time and is not a sustainable way to develop the contribution. If an AI agent is being used, please iterate with it independently and perform a comprehensive validation before posting another revision. It is the author’s responsibility to identify and resolve these gaps, rather than relying on reviewers to crowdsource the agent’s next instructions.

Please return for review when the implementation has been checked end to end.

@ajlennon ajlennon closed this Aug 17, 2026
@ajlennon

Copy link
Copy Markdown
Author

All good - I'll keep this new board support for my own work then and if anybody decides my work has value you may discuss with me using my work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Area: Build system Board: arm Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants