IOMUXC writing

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

IOMUXC writing

1,931 次查看
sapirbuz
Contributor IV

Hi,

How can we write to the IOMUXC registers?

In what boot phase this writing process is done?

We would like to boot from FlexSPI second options, so we need to configure its pins to ALT0 mode. When and how is it done?

sapirbuz_0-1653916572212.png

 

One more question:

To support the Flexspi second option, we need to configure the Mux mode registers and the daisy registers.

For GPIO_AD_B1_08 and GPIO_AD_B1_15 I didn’t see a daisy register. Why?

sapirbuz_1-1653916572274.png

 

 

Thanks,

Sapit

0 项奖励
回复
7 回复数

1,918 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sapirbuz ,

    If you want to use the secondary boot, you don't need to configure the IOMUXC by yourself, ROM will help you do it.

  When you use the secondary boot:

burn eFuse 0x450 or  BOOT_CFG pin, set FLASH_TYPE[2:0] = 111 - QSPI device supports 3B read by default on secondary pinmux option 

  So, when you BOOT, it will read the BOOT_CFG pin configuration or the eFuse, when it matches the secondary pinmux option, the ROM code will help you configure the IOMUXC directly.

  If you want to configure it by yourself, you can use this code:

IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_15_FLEXSPIA_SS0_B, 1U);

IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_15_FLEXSPIA_SS0_B, 0x10F1U);

GPIO_AD_B1_15 doesn't need to use the daisy for ALT0.

Wish it helps you!

Best Regards,

Kerry

 

0 项奖励
回复

1,911 次查看
sapirbuz
Contributor IV

Thank you!

" If you want to use the secondary boot, you don't need to configure the IOMUXC by yourself, ROM will help you do it."

1. ROM= internal boot ROM?

2. Is this the only case where I don't need to configure the IOMUXC? when should I configure the IOMUX for some ALT mode and when it isn't required?

What about the other pins like JTAG, I2C, UART, FlexSPI B, do I need to configure their IOMUXC registers?

0 项奖励
回复

1,902 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sapirbuz 

   Answer your questions:

1. ROM= internal boot ROM?

=> Yes, internal ROM, mainly used for the boot.

2. Is this the only case where I don't need to configure the IOMUXC? when should I configure the IOMUX for some ALT mode and when it isn't required?

=>If your used pin is not the ROM related flash pin, you also can configure it in the user application code, about the IOMUX configure, just use my last reply, the code in the pinmux to configure it, when you select the related function, then it will help you select the it's ALT mode.

Eg.GPIO_AD_B1_15

#define IOMUXC_GPIO_AD_B1_15_FLEXSPIA_SS0_B 0x401F8138U, 0x0U, 0, 0, 0x401F8328U
#define IOMUXC_GPIO_AD_B1_15_ACMP_OUT03 0x401F8138U, 0x1U, 0, 0, 0x401F8328U
#define IOMUXC_GPIO_AD_B1_15_LPSPI3_SCK 0x401F8138U, 0x2U, 0x401F8510U, 0x1U, 0x401F8328U
#define IOMUXC_GPIO_AD_B1_15_SAI1_TX_SYNC 0x401F8138U, 0x3U, 0x401F85ACU, 0x1U, 0x401F8328U
#define IOMUXC_GPIO_AD_B1_15_CSI_DATA02 0x401F8138U, 0x4U, 0x401F8400U, 0x0U, 0x401F8328U
#define IOMUXC_GPIO_AD_B1_15_GPIO1_IO31 0x401F8138U, 0x5U, 0, 0, 0x401F8328U
#define IOMUXC_GPIO_AD_B1_15_USDHC2_DATA7 0x401F8138U, 0x6U, 0x401F8604U, 0x1U, 0x401F8328U
#define IOMUXC_GPIO_AD_B1_15_KPP_COL00 0x401F8138U, 0x7U, 0, 0, 0x401F8328U
#define IOMUXC_GPIO_AD_B1_15_ENET2_1588_EVENT3_IN 0x401F8138U, 0x8U, 0, 0, 0x401F8328U
#define IOMUXC_GPIO_AD_B1_15_FLEXIO3_FLEXIO15 0x401F8138U, 0x9U, 0, 0, 0x401F8328U

What about the other pins like JTAG, I2C, UART, FlexSPI B, do I need to configure their IOMUXC registers?

=>JTAG, is default as the SWD function, you don't need to configure it.

  I2C, UART, pinmux to configure it, check the sdk driver related project.

  FlexSPI B, if you want ot use it, you also can configure it.

SDK_2_11_1_EVK-MIMXRT1060\boards\evkmimxrt1060\driver_examples\flexspi

Although it is for A port, but you can modify it for B port.

BTW, a question for you, how do you modify your MIMXRT1050-EVKB board for the QSPI flash? I find one DFAE also helps you check the boot issues, he said you do the MIMXRT1050-EVK rework, but I don't know which detail HW points you have modified, this one?

OPTION2: USE QSPI FLASH(Mount R153~R158, DNP R356,R361~R366)

Best Regards,

kerry

0 项奖励
回复

1,898 次查看
sapirbuz
Contributor IV

Thank you for your detailed answer!

we soldered the Flexspi secondary port A to an external 3.3V flash (see picture below)

  1. FlexSPI_CLK- from R228 (on IMXRT1050-EVKB) to  pin 6 on Flash
  2. FlexSPI_SS0- from R229 (on IMXRT1050-EVKB) to  pin 1 on Flash
  3. FlexSPI_D0_A- from R227 (on IMXRT1050-EVKB) to  pin 5 on Flash
  4. FlexSPI_D1_A- from R226 (on IMXRT1050-EVKB) to  pin 2 on Flash
  5. FlexSPI_D2_A- from R225 (on IMXRT1050-EVKB) to  pin 3 on Flash
  6. FlexSPI_D3_A- from R224 (on IMXRT1050-EVKB) to  pin 7 on Flash
  7. FLASH_VCC- from J13.2 (on IMXRT1050-EVKB) to pin 8 on Flash
  8. GND from J11.2 (on IMXRT1050-EVKB) to pin 4 on Flash

 

sapirbuz_0-1654089763737.png

 

0 项奖励
回复

1,892 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sapirbuz ,

  So you connect the flash chip here:

kerryzhou_0-1654135501648.png

  But, your mentioned point is not enough, as you know, the related pin is also connect to other component,  to be honesty, I think, your connection maybe have issues, as the wire connection don't like the PCB layout, which is stable.

  Anyway, just try to remove the find issues.

1.FLEXSPI_A_SS0_B: GPIO_AD_B1_15, ALT0, remove R98

2.FLEXSPI_A_SCLK GPIO_AD_B1_14 ALT0, remove R99
3.FLEXSPI_A_DQS GPIO_AD_B1_09 ALT0, remove R223,R102
4.FLEXSPI_A_DATA0 GPIO_AD_B1_13 ALT0, remove R101
5.FLEXSPI_A_DATA1 GPIO_AD_B1_12 ALT0,remove 100
6.FLEXSPI_A_DATA2 GPIO_AD_B1_11 ALT0, don't connect J23
7.FLEXSPI_A_DATA3 GPIO_AD_B1_10 ALT0, don't connect J23

You also need to let me know your used flash detail partnumber, as you need to make sure your connected FLASH_VCC matches your flash chip, and the QE bit need to use the correct area.

About the testing, you can use the MCUBootUtility, configuration like this:

kerryzhou_1-1654136377156.png

 

quad mode setting, you need to check your used flash datasheet.

Check whether you can find the flash or not?

If you are using this code in debug mode:

SDK_2_11_1_EVKB-IMXRT1050\boards\evkbimxrt1050\driver_examples\flexspi\nor\polling_transfer

You really need to modify the pin to the related pin, I highly suggest you run the above code in the RAM, and make sure the flash works at first.

This will be used to check, whether your external flash hardware really works, check the flash erase, write, read works.

Best Regards,

kerry

 

0 项奖励
回复

1,883 次查看
sapirbuz
Contributor IV
0 项奖励
回复

1,867 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sapirbuz ,

  I checked your datasheet, your QE bit is S2[1], command is 0x31.

kerryzhou_0-1654481787095.png

kerryzhou_1-1654481801087.png

kerryzhou_2-1654481807131.png

 

So, please check you use the correct QE bit postion and command, test it again.

Best Regards,

Kerry

 

 

 

0 项奖励
回复