ROM API nor flash program execution stops

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

ROM API nor flash program execution stops

328 Views
sandeepc
Contributor III

Hi,

Dear i am developing custom bootloader for our application.

To store the received bin file new memory location of flash memory. i started exploring the flexspi rom api, when i execute this example without changing anything in the example code, my code getting crash.

IMxrt1170 

void ROM_API_Init(void)

{

if ((ANADIG_MISC->MISC_DIFPROG & ANADIG_MISC_MISC_DIFPROG_CHIPID(0x10U)) != 0U)

{

g_bootloaderTree = ((bootloader_api_entry_t *)*(uint32_t *)0x0021001cU);

}

else

{

g_bootloaderTree = ((bootloader_api_entry_t *)*(uint32_t *)0x0020001cU);

}

after this function 

status = ROM_FLEXSPI_NorFlash_GetConfig(FlexSpiInstance, &norConfig, &option);

during above function call program getting crash.

 

For execute example code is it required to change anything? with respect rt117xx

Since we are using XIP mode 

sandeepc_0-1713869197195.png

 

@kerryzhou 

 

0 Kudos
8 Replies

290 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sandeepc ,

   Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.

   Yes, I also find this issues, and will also do more digger in about it.

    I also find, if you do the flash mass erase at first, then you can pass the rom_api testing.

    BTW, if you test this code, no matter flash have code or not, all works OK:

\SDK_2_15_000_MIMXRT1170-EVK\boards\evkmimxrt1170\driver_examples\flexspi\nor\polling_transfer

  So, when you test it, you can try:

1. rom_api: do mass erase at first before flash testing.

2. run flexspi_nor_polling_transfer demo

About the mentioned issue, I will do more testing on my side, any updated information, I will let you know.

Best Regards,

Kerry

0 Kudos

279 Views
sandeepc
Contributor III
example code executed without any errors,
i solved above the issue by
project properties ==> settings ==> manager linker script => link application to RAM ==> Apply and close.

But i am trying to write 40 kb which is starting address of 0x300
few pages are writing and few pages are not writing sometimes i added delay between the every rom write and erase function.

What might be the reason?

Regards
Sandeep C
0 Kudos

277 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sandeepc ,

  Thanks for your updated information.

  1. When you run the ROM API in the flash, whether it have issues on your side or not?

   2. About the few page write failed, this should related to the write is very quick, eg, the previous write still not finished, then you do the new page write, just delay is not enough. You need to check the program finished status, make sure the write is really finished, then you can do the new page programming.

Please try it again.

If you still have question about it, please kindly let me know.

Best Regards,

Kerry

0 Kudos

234 Views
sandeepc
Contributor III
Hi,
Update on my query.
I made two programs for writing and the qspi flash data.
1) 1st program to write the 33kb to from starting address of 0x40000 it written successfully to flash.
2) 2nd program just read the data from address of 0x30040000.
To test memory corruption i followed below procedure:
a) i written 33kb by using first program.
b)2nd program Dumped code to the rt1170.
as soon as code dump, by using memory browser i checked the written data was perfect and its stored.

after this i executed by step by step(F6 key) during this below functions memory not corrupted
BOARD_ConfigMPU();
BOARD_InitPins();
BOARD_BootClockRUN();
BOARD_InitDebugConsole();

PRINTF("\r\n FLEXSPI NOR example started!\r\n");

ROM_API_Init();

/* Clean up FLEXSPI NOR flash driver Structure */
memset(&norConfig, 0U, sizeof(flexspi_nor_config_t));

#if (__CORTEX_M == 7U)
/* Disable I cache */
SCB_DisableICache();
#endif

Memory corrupted as soon as i executed below code
status = ROM_FLEXSPI_NorFlash_GetConfig(FlexSpiInstance, &norConfig, &option);
function returned kStatus_Success

Why memory getting corrupted after executing above function?
Note: Both are example code only not modified anything.

Regards,
Sandeep C

0 Kudos

207 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sandeepc ,

  Do you try do the flash mass earse at first, then test it again, whether you still get the 

ROM_FLEXSPI_NorFlash_GetConfig

issues or not?

  Please try it, then give me updated information, thanks.

Best Regards,

Kerry

0 Kudos

125 Views
sandeepc
Contributor III

I tried its working fine,
i tried with dumping the multiple program data was present in the written memory location.
But only in the debug mode. if i come out from the debug mode previously written code only executes not the rom api flash code.
Can you suggest me any tool to dump .hex or bin file to rt1170.

I have noticed application running from RAM. but it should run from flash what are the things i need to change to run from flash.

sandeepc_0-1714375912693.png

 

 

sandeepc_0-1714374216599.png

 


Regards,

Sandeep C

Tags (1)
0 Kudos

94 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sandeepc .

1. Can you suggest me any tool to dump .hex or bin file to rt1170.

=>Answer: If your app is the flash app, then you can use the debugger download it directly.

If your project is the RAM project, then it is the non-xip demo, you need to do the 0X2000 offset, then generate the .hex, and use the MCUBootutility or the SEC tool to download it.

You can refer to my document:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/How-to-load-MDK-RAM-app-to-the-RT1170-external-f...

 

2. I have noticed application running from RAM. but it should run from flash what are the things i need to change to run from flash

=》Answer:

Deselect the link to RAM:

kerryzhou_0-1714470505016.png

 

Best Regards,

Kerry

 

0 Kudos

271 Views
sandeepc
Contributor III

Thanks,

Issue is not in my side, just we have to do the following configuration after importing the example.

project properties ==> settings ==> manager linker script => link application to RAM ==> Apply and close.

Modification required:

Just in chip ID based on manufacturer.

if (*vendorID != kSerialFlash_Winbond_ManufacturerID)

{

status = kStatus_ROM_FLEXSPINOR_Flash_NotFound;

return status;

}

it worked fine without any other modification to the code.

 

Issue:

RUN mode: Regarding Page write/erase working fine.

DEBUG mode: when i read written memory of my custom data it will not write or erase perfectly.

regarding the above issue am working on it.

@kerryzhou 

Regards:

sandeep C

0 Kudos