Programming the custom board(MIMXRT1176CVM8B) with flash (W25Q01NWZEIQ) via secure provisioning tool Hi, I am able read, write, program and erase the custom board flash (W25Q01NWZEIQ) via secure provisioning tool (serial downloader mode enabled and FLASH_AUTO_PROBE_EN = 1). We are using FlexSPI_1 primary configuration pin as an interface to flash But in MCUXpresso IDE we are not able to flash the .axf file. We modified few parameters of evkbmimxrt1170_flexspi_nor_config.c file such as look up table, size as 128 MB etc. The flash error appears like below. ProgramPage (0x30000000, 0x20002838, 0x4000) status 0x1 - driver reported driver error - EXTSPIJ driver rc -96 (0xFFFFFFA0). For more details, please find the attached files. Thanks in advance Re: Programming the custom board(MIMXRT1176CVM8B) with flash (W25Q01NWZEIQ) via secure provisioning Hello @Raj_01,
The error occurs because the .cfx file used by MCUXpresso IDE is designed specifically for the memories populated on the EVK. As you may know, different flash memories can require different command sets, initialization sequences, and configurations. Therefore, the EVK flash loader may not be compatible with your custom memory device. To debug your application in MCUXpresso IDE, you will need to create and use a custom .cfx flash driver that supports your specific memory. The following links offers a guide to make this file, although these guides are not specifically designed for the RT1170, you can follow the same procedure:
AN13386: RT600 Flash Loader for Custom Flash Device How to Create a New Flash Driver for MCUXpresso IDE
Please let me know if you have any further questions.
BR Habib Re: Programming the custom board(MIMXRT1176CVM8B) with flash (W25Q01NWZEIQ) via secure provisioning Hi Habib, I followed the same instructions as you mentioned in the last reply, also modified some files such as flashprg.c , flashConfig.h, flexspi_nor_flash.h, flasdev.c to match our custom board flash features and built new .cfx file and flashed. But still, we are unable to flash. We are getting some error and warnings, please find the error files are attached. Please suggest solution for this. Thanks in advance. Re: Programming the custom board(MIMXRT1176CVM8B) with flash (W25Q01NWZEIQ) via secure provisioning Hello @Raj_01,
In order to support you better, could you please provide me the following information?
-Could you describe the steps you performed in the Secure Provisioning Tool? Did you use the Boot memory configuration to test your flash?
-Are you currently using the FLASH_AUTO_PROBE_EN fuse, or are you using GPIO_DISP_B1_6 to enable this bit?
-If you test your custom .cfx flash loader without FLASH_AUTO_PROBE_EN enabled, do you observe the same behavior?
-When you launch a debug session, what is the current boot pin configuration?
-Could you also share the reason for using FLASH_AUTO_PROBE_EN in your application?
BR Habib Re: Programming the custom board(MIMXRT1176CVM8B) with flash (W25Q01NWZEIQ) via secure provisioning Hello @Raj_01,
Based on your description that the same error occurs even when AUTO_PROBE_EN is not enabled, the issue could be related to the .cfx implementation. I would recommend using the Boot Memory Configuration Tool available in the Secure Provisioning Tool. This utility allows you to select and validate the configuration parameters for your flash device, helping you verify that the selected settings are compatible with your memory and compare them with the implemented in your .cfx file.
In addition, you can use this tool to generate the FCB. I recommend reviewing this community post, particularly the steps starting from point 15. That section provides a more detailed explanation of how the Secure Provisioning Tool generates the FCB and may help clarify the parameters and output produced by the tool.
Also, could you also clarify me what is the purpose for using FLASH_AUTO_PROBE_EN in your application?
BR Habib Re: Programming the custom board(MIMXRT1176CVM8B) with flash (W25Q01NWZEIQ) via secure provisioning 1. In the secure provisioning tool, the size of the flash has been modified to 128MB and FLASH_AUTO_PROBE_EN was set to 1 in the SW1. Hence we were able to flash through secure provisioning tool. We are using serial downloader mode for flashing and switching back to boot mode for running application. Modified the flash drivers as per the previous replies and trying to flash it through MCU Xpresso IDE. As the requirement is to debug flashing through Secure Provisioning tool will not resolve my issue. 2 and 5. FLASH_AUTO_PROBE_EN - Yes. After enabling it only, we were able to flash through secure provision. 3. Yes. 4. Refer the attached image. Attaching the error log and the modified files. The below is the evkbmimxrt1170_flexspi_nor_config.c containing the LUT code to create FCB from MCU IDE: /* * Copyright 2018-2022 NXP * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include "evkbmimxrt1170_flexspi_nor_config.h" /* Component ID definition, used by tools. */ #ifndef FSL_COMPONENT_ID #define FSL_COMPONENT_ID "platform.drivers.xip_board" #endif /******************************************************************************* * Code ******************************************************************************/ #if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1) #if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__) __attribute__((section(".boot_hdr.conf"), used)) #elif defined(__ICCARM__) #pragma location = ".boot_hdr.conf" #endif #define FLASH_DUMMY_CYCLES (8U) #define FLASH_DUMMY_VALUE (0x03U) const flexspi_nor_config_t qspiflash_config = { .memConfig = { .tag = FLEXSPI_CFG_BLK_TAG, .version = FLEXSPI_CFG_BLK_VERSION, .readSampleClksrc=kFlexSPIReadSampleClk_LoopbackInternally, .csHoldTime = 3U, .csSetupTime = 3U, // Enable DDR mode, Wordaddassable, Safe configuration, Differential clock .controllerMiscOption = (1UL << kFlexSpiMiscOffset_SafeConfigFreqEnable),//0x10, .deviceType = kFlexSpiDeviceType_SerialNOR, .sflashPadType = kSerialFlash_4Pads, .serialClkFreq = kFlexSpiSerialClk_100MHz, //kFlexSpiSerialClk_133MHz, .sflashA1Size = 128U * 1024U * 1024U, .timeoutInMs = 5000U, .sflashA2Size = 0U, .sflashB1Size = 0U, .sflashB2Size = 0U, /* Enable flash configuration feature */ .configCmdEnable = 1U, .configModeType[0] = kDeviceConfigCmdType_Generic, /* Set configuration command sequences */ .configCmdSeqs[0] = { .seqNum = 1U, .seqId = 12U, .reserved = 0U, }, /* Prepare setting value for Read Register in flash */ .configCmdArgs[0] = (FLASH_DUMMY_VALUE << 4U), .lookupTable = { // Read LUTs [4U * 0U + 0U] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEC, RADDR_SDR, FLEXSPI_4PAD, 0x20), [4U * 0U + 1U] = FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, FLASH_DUMMY_CYCLES, READ_SDR, FLEXSPI_4PAD, 0x04), // Read Status LUTs [4U * 1U + 0U] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05, READ_SDR, FLEXSPI_1PAD, 0x04), // Write Enable LUTs [4U * 3U + 0U] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06, STOP, FLEXSPI_1PAD, 0x00), // Erase Sector LUTs [4U * 5U + 0U] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x21, RADDR_SDR, FLEXSPI_1PAD, 0x20), // Erase Block LUTs [4U * 8U + 0U] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xDC, RADDR_SDR, FLEXSPI_1PAD, 0x20), // Pape Program LUTs [4U * 9U + 0U] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x12, RADDR_SDR, FLEXSPI_1PAD, 0x20), [4U * 9U + 1U] = FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04, STOP, FLEXSPI_1PAD, 0x00), // Erase Chip LUTs [4U * 11U + 0U] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60, STOP, FLEXSPI_1PAD, 0x00), // Set Read Register LUTs [4U * 12U + 0U] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xC0, WRITE_SDR, FLEXSPI_1PAD, 0x01), [4U * 12U + 1U] = FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x00, STOP, FLEXSPI_1PAD, 0x00), }, }, .pageSize = 256u, .sectorSize = 4u * 1024u, .blockSize = 64u * 1024u, .ipcmdSerialClkFreq = 1U, .isUniformBlockSize = 0U, //false, .isDataOrderSwapped = 0U, .serialNorType = 0U, .needExitNoCmdMode = 0U, .halfClkForNonReadCmd = 0U, .needRestoreNoCmdMode = 0U, .reserved0 = 0U, .FlashStateCtx = 0U, }; #endif /* XIP_BOOT_HEADER_ENABLE */ Re: Programming the custom board(MIMXRT1176CVM8B) with flash (W25Q01NWZEIQ) via secure provisioning The NOR used is 1Gb/W25Q01NWZEIQ while on i.MX RT1170 refer device is 128Mb or 512Mb. So the config file is different . You may update the config file and share the config file for review is possible. Since the error informaton is 'driver reported driver error - EXTSPIJ driver rc -96', the drive command could be different as well may need to double check
記事全体を表示