Skip to content

Branch imxrt1180 nxp evk hp flash#11483

Open
Jason0204 wants to merge 3 commits into
RT-Thread:masterfrom
Jason0204:Branch_imxrt1180_nxp_evk_hpFlash
Open

Branch imxrt1180 nxp evk hp flash#11483
Jason0204 wants to merge 3 commits into
RT-Thread:masterfrom
Jason0204:Branch_imxrt1180_nxp_evk_hpFlash

Conversation

@Jason0204

Copy link
Copy Markdown

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR):

submit BSP development task--for imxrt1180-nxp-bsp

你的解决方案是什么 (what is your solution)

  1. use MCU_Config software for clock and pinmux initialization.
  2. update drv_flexspi to enable flexspi1 and eDMA4 TX/RX channels.
  3. update board.c to call BOARD_CommonSetting function and MCU_Config location.
  4. boot-up M7 from CMSIS-DAP to enter msh of RT-Thread, because FlexSPI1 A1 has already set to XIP boot for CM33, pin-muxed with octal hpyer flash(MT35XU512).

请提供验证的bsp和config (provide the config and bsp)

  • BSP:
    bsp\nxp\imx\imxrt\imxrt1180-nxp-evk\cm7
    bsp\nxp\imx\imxrt\imxrt1180-nxp-evk\cm7\packages\nxp-imxrt-sdk-latest\MIMXRT1180\SConscript
    bsp\nxp\imx\imxrt\libraries\drivers
  • .config:
    CONFIG_BSP_USING_DMA=y
    CONFIG_BSP_USING_FLEXSPI=y
    CONFIG_BSP_USING_FLEXSPI1=y
  • action: not defined it yet.

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@Jason0204 Jason0204 requested a review from Rbb666 as a code owner June 14, 2026 15:07
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

Copy link
Copy Markdown

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  • 将目标分支设置为 \ Set the target branch to:Branch_imxrt1180_nxp_evk_hpFlash
  • 设置PR number为 \ Set the PR number to:11483
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将自动推送至你的分支。
    The formatted code will be automatically pushed to your branch.

完成后,提交将自动更新至 Branch_imxrt1180_nxp_evk_hpFlash 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the Branch_imxrt1180_nxp_evk_hpFlash branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

@github-actions github-actions Bot added BSP: NXP Code related with NXP BSP labels Jun 14, 2026
@supperthomas supperthomas requested a review from Copilot June 16, 2026 01:58
@Rbb666

Rbb666 commented Jun 16, 2026

Copy link
Copy Markdown
Member

@Jason0204 需要签署下CLA

@Rbb666

Rbb666 commented Jun 16, 2026

Copy link
Copy Markdown
Member

需要添加下attach编译看护,参考:https://club.rt-thread.org/ask/article/5edd0f0940a57129.html

Copilot AI 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.

Pull request overview

This PR adds/updates the i.MXRT1180 NXP EVK CM7 BSP bring-up, switching to MCUXpresso Config Tools–generated clock/pin/peripheral init and adding FlexSPI1 Octal DDR + eDMA4 support and a shell test command.

本次 PR 主要用于完善 i.MXRT1180 NXP EVK CM7 BSP 的启动与外设初始化,切换为 MCUX Config Tools 生成的时钟/引脚/外设初始化代码,并新增 FlexSPI1 OPI DDR + eDMA4 支持及 MSH 测试命令。

Changes:

  • Introduce FlexSPI1 octal DDR flash ops (with optional EDMA) and update the shared i.MXRT FlexSPI driver to use them.
  • Replace legacy MCUX_Config/* pinmux paths with board-local generated pin_mux.*, clock_config.*, peripherals.* wiring via SCons.
  • Enable cache + DMA + FlexSPI in the CM7 configuration and add TRDC permission setup in board init.

Reviewed changes

Copilot reviewed 17 out of 20 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
bsp/nxp/imx/imxrt/libraries/drivers/drv_flexspi.c Updates common i.MXRT FlexSPI init and adds an MSH flash R/W test using new octal-flash helpers.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/rtconfig.h Enables cache and turns on DMA/FLEXSPI/FLEXSPI1 BSP macros; updates core type to M7.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/SConscript Switches to board-local generated sources and adds octal flash ops to the build.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/ports/flexspi_port.h Adds RT1180-specific FlexSPI/EDMA port configuration and LUT index definitions.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/pin_mux.h New MCUX-generated pinmux header for CM7.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/pin_mux.c New MCUX-generated pinmux init including FlexSPI1 signals.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/peripherals.h Aligns header guard and exposes generated peripherals init APIs.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/peripherals.c Adds generated peripherals init stubs.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/MCUX_Config/pin_mux.c Removes old generated pinmux source under MCUX_Config/.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/MCUX_Config.mex Updates MCUX config project metadata for RT1189 and generated file paths.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/flexspi_octal_flash_ops.c Adds octal DDR flash operations (read/program/erase, optional EDMA, cache handling).
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/clock_config.h Updates generated clock output defines for the new clock plan.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/clock_config.c Updates generated clock init implementation (PLL/PFD/root clock selections).
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/board.h Includes peripherals.h to integrate generated peripheral init.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/board/board.c Adds TRDC grant/config logic and calls common settings + boot peripherals during board init.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/applications/main.c Updates boot banner string.
bsp/nxp/imx/imxrt/imxrt1180-nxp-evk/cm7/.config Enables cache/DMA/FLEXSPI/FLEXSPI1 and updates generated Kconfig selections.

Comment on lines +102 to +109
/*******************************************************************************
* Prototypes
******************************************************************************/
extern status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address);
extern status_t flexspi_nor_flash_page_program(FLEXSPI_Type *base, uint32_t dstAddr, const uint32_t *src);
extern status_t flexspi_nor_get_vendor_id(FLEXSPI_Type *base, uint8_t *vendorId);
extern status_t flexspi_nor_enable_octal_mode(FLEXSPI_Type *base);
extern void flexspi_nor_flash_init(FLEXSPI_Type *base);
Comment on lines +529 to +533
#ifdef BSP_USING_DMA
/* Create handle for flexspi. */
FLEXSPI_TransferCreateHandleEDMA(FLEXSPI1_CONTROL_BASE, &flexspiHandle, flexspi_callback, NULL, &dmaTxHandle,
&dmaRxHandle);
#endif
Comment on lines +26 to +31
#ifdef BSP_USING_DMA
static volatile bool g_completionFlag = false;
edma_handle_t dmaTxHandle;
edma_handle_t dmaRxHandle;
static flexspi_edma_handle_t flexspiHandle;
#endif
Comment on lines +356 to +360
#ifdef BSP_USING_DMA
/* Wait for transfer completed. */
while (!g_completionFlag)
{
}
Comment on lines +239 to +241
status =
flexspi_nor_flash_page_program(FLEXSPI1_CONTROL_BASE, EXAMPLE_SECTOR * SECTOR_SIZE, (void *)s_nor_program_buffer);
if (status != kStatus_Success)
Comment on lines 12 to +18
#include "fsl_iomuxc.h"
#include "fsl_rgpio.h"
#include "fsl_cache.h"
#include "fsl_ele_base_api.h"
#include "fsl_dcdc.h"
#include "fsl_trdc.h"
#include "fsl_rgpio.h"
Comment on lines +250 to +253
uint32_t ele_fw_sts;

/* Get ELE FW status */
ELE_BaseAPI_GetFwStatus(MU_RT_S3MUA, &ele_fw_sts);
At that point, AHB write FlexSPI sequence index is set to 9, but in LUT, the
command is not filled by ROM. If the debugger sets software breakpoint at flash
after reset/attachment, FlexSPI AHB write command will be triggered. It may
cause AHB bus hang if the command in LUT sequence index 9 is any read opeartion.
after reset/attachment, FlexSPI AHB write command will be triggered. It may
cause AHB bus hang if the command in LUT sequence index 9 is any read opeartion.
So we need to ensure at any time, the FlexSPI LUT sequence 9 for the flash must
be set to STOP command to avoid unexpected debugger behaivor.
Comment on lines +76 to +78
/* Empty initialization function (commented out)
static void CM7_NVIC_init(void) {
} */
@nxp-ran

nxp-ran commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

这边也一样哈,麻烦PR的代码不要破坏原有的BSP。建议您这边把和这边相关的pin_mux、clock等代码放在Board下面一个文件夹中,然后附上一个readme。

@Jason0204

Copy link
Copy Markdown
Author

这边也一样哈,麻烦PR的代码不要破坏原有的BSP。建议您这边把和这边相关的pin_mux、clock等代码放在Board下面一个文件夹中,然后附上一个readme。

如之前分支提到,MCU_Config这个软件更新源码的时候会生成另一个board文件并产生新的pin_mux和clock等代码,这导致无法更新编译目标,建议更改原有BSP结构。

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

Labels

BSP: NXP Code related with NXP BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants