OTFAD with FlexSPI in code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OTFAD with FlexSPI in code

Jump to solution
1,332 Views
AChun
Contributor I

I am using IMXRT1010EVK board with NXP-MCUBootUtility-v3.5.0.

I use the function “ flexspi_nor_flash_init(EXAMPLE_FLEXSPI)”,

and blink the led after the function.

It failed while i choose OTFAD as my secure Type, I follow 

the post “Use FlexSPI while decrypted with OTFAD”, change code to the the following

 {
 //OTFAD->CR &= ~OTFAD_CR_GE_MASK;
  backupendaddr = OTFAD->CTX[0].RGD_W1;
  OTFAD->CTX[0].RGD_W1 = OTFAD->CTX[0].RGD_W0;
  //flexspi_nor_flash_init(EXAMPLE_FLEXSPI);
  OTFAD->CTX[0].RGD_W1 = backupendaddr;
  //OTFAD->CR |= OTFAD_CR_GE(1);
}

The led blink with OTFAD when i commet the  function “flexspi_nor_flash_init(EXAMPLE_FLEXSPI)”.

data.ldt:

        <#if memory.name=="SRAM_ITC">
        *flexspi_nor_flash_ops.o(.text*)
        *fsl_flexspi.o(.text*)
        </#if>

main_text.ldt:

        *(EXCLUDE_FILE(*flexspi_nor_flash_ops.o *fsl_flexspi.o) .text*)

 The program is in XIP mode.

 

0 Kudos
1 Solution
1,265 Views
jay_heng
NXP Employee
NXP Employee

The issue is caused by FlexSPI reset way, please refer to my blog

https://www.cnblogs.com/henjay724/p/14479276.html

View solution in original post

7 Replies
1,266 Views
jay_heng
NXP Employee
NXP Employee

The issue is caused by FlexSPI reset way, please refer to my blog

https://www.cnblogs.com/henjay724/p/14479276.html

1,310 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Actually, I'm not very clear with this question, whether you mean the evkmimxrt1170_flexspi_nor_polling_transfer_cm7 can't work well after enabling encrypted XiP with OTFAD.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
1,292 Views
AChun
Contributor I

I'm using the flexspi example code for the IMXRT1010EVK board. Add the blinking code after the function "flexspi_nor_flash_init".

    BOARD_ConfigMPU();
    BOARD_InitBootPins();
    BOARD_BootClockRUN();
    BOARD_InitDebugConsole();
    SCB_DisableDCache();

    flexspi_nor_flash_init(EXAMPLE_FLEXSPI);

    PRINTF("\r\nFLEXSPI example started!\r\n");

    /* Set systick reload value to generate 1ms interrupt */
    if (SysTick_Config(SystemCoreClock / 1000U))
    {
    	while (1);
    }
    while (1)
    {
		if(delay_timer==0)
		{
			delay_timer = 500;
			LED_toggle();
		}
    }

 

Following the article , I have change the function "BOARD_BootClockRUN()".

It blinks the led If I commet the function "flexspi_nor_flash_init".

Or I change the secure boot Type to "HAB signed Image Boot".

How can it work on OTFAD Mode with the flexspi_nor_flash_init and blinky in code?

0 Kudos
1,287 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
Firstly, I'd like to know your Advanced Key Settings, next, in the flexspi_nor_polling_transfer demo, the flexspi_nor_flash_init will be relocated to the RAM after booting up, so it shouldn't be affected by the restriction mentioned in the article.

jeremyzhou_0-1656922179485.png

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos
1,279 Views
AChun
Contributor I

Here is the NXP-MCUBootUtility-v3.5.0. "Advanced Key Settings".

Advanced Key Settings.png

The setting is work (led blinky) when I commet the function "flexspi_nor_flash_init".

Also, I confirm the map,  the function "flexspi_nor_flash_init"  is definitely located in RAM.

flexspiinram.png

0 Kudos
1,275 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
Can you share the read result of eFuse in the NXP-MCUBootUtility-v3.5.0?
@jay_heng  Can you share some insight into the phenomenon?
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
1,270 Views
AChun
Contributor I

The fuse is got here.

fuse_setting.png

0 Kudos