Branch imxrt1180 nxp evk hp flash#11483
Conversation
…ic operation of hpyer Flash.
…xspi_test command is called for verification.
|
|
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
|
@Jason0204 需要签署下CLA |
|
需要添加下attach编译看护,参考:https://club.rt-thread.org/ask/article/5edd0f0940a57129.html |
There was a problem hiding this comment.
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 generatedpin_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. |
| /******************************************************************************* | ||
| * 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); |
| #ifdef BSP_USING_DMA | ||
| /* Create handle for flexspi. */ | ||
| FLEXSPI_TransferCreateHandleEDMA(FLEXSPI1_CONTROL_BASE, &flexspiHandle, flexspi_callback, NULL, &dmaTxHandle, | ||
| &dmaRxHandle); | ||
| #endif |
| #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 |
| #ifdef BSP_USING_DMA | ||
| /* Wait for transfer completed. */ | ||
| while (!g_completionFlag) | ||
| { | ||
| } |
| status = | ||
| flexspi_nor_flash_page_program(FLEXSPI1_CONTROL_BASE, EXAMPLE_SECTOR * SECTOR_SIZE, (void *)s_nor_program_buffer); | ||
| if (status != kStatus_Success) |
| #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" |
| 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. |
| /* Empty initialization function (commented out) | ||
| static void CM7_NVIC_init(void) { | ||
| } */ |
|
这边也一样哈,麻烦PR的代码不要破坏原有的BSP。建议您这边把和这边相关的pin_mux、clock等代码放在Board下面一个文件夹中,然后附上一个readme。 |
如之前分支提到,MCU_Config这个软件更新源码的时候会生成另一个board文件并产生新的pin_mux和clock等代码,这导致无法更新编译目标,建议更改原有BSP结构。 |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR):
submit BSP development task--for imxrt1180-nxp-bsp
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and 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_BSP_USING_DMA=y
CONFIG_BSP_USING_FLEXSPI=y
CONFIG_BSP_USING_FLEXSPI1=y
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up