i.MX RT1064-EVK Second stage bootloader

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

i.MX RT1064-EVK Second stage bootloader

2,631 Views
jernejturnsek
Contributor I

Hi. I am developing a second stage bootloader for MIMXRT1064-EVK, where I would like to write to two internal Flash image partitions, while bootloader is XIP from it. From the Reference Manual I can see the ROM bootloader API for reading and writting to NOR Flash, but if look into MCUXpresso demo, there is a special flash driver linked to RAM instead XIP from Flash. Is there a reason not to use ROM API for the Flash access in demo? What is the preffered way of doing it? Thanks.

0 Kudos
Reply
7 Replies

2,485 Views
jernejturnsek
Contributor I

I have found a solution. The trick was to disable ICache and DCache while erasing the flash. Also interrupts need to be disabled too. The caches can be enabled again when erase operation is done.

0 Kudos
Reply

2,490 Views
jernejturnsek
Contributor I

I have found this

https://community.nxp.com/t5/i-MX-RT/Programming-the-internal-Flash-of-RT1064/td-p/883989

and I have followed the example and I have still not been able to erase the sector at 0x70040000, while running the code bellow that address. The catch was in that irq_disable, but when stepping through flexspi_nor_flash_erase function, nothing happens.

Please. Is there a working example of how to use ROM API in RT1064 EVK board?

 

Regards,

Jernej

0 Kudos
Reply

2,576 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, sorry for the late response, I'm following your case, but I do not understand a lot are you trying to make the partition during the bootloader? I find a thread about this that maybe could help you.

RT1050 - Booting from serial NOR flash to SDRAM - NXP Community

Best regards,
Pavel

 

0 Kudos
Reply

2,553 Views
jernejturnsek
Contributor I

Is there an example of how to do it with the help of ROM API?

0 Kudos
Reply

2,571 Views
jernejturnsek
Contributor I

Hi, 

I have a MCUBoot loader running XIP on FlexSPI2 NOR Flash (internal one) and I need to read and write (through MTD) two image partitions, which are on the same Flash device in order to implement OTA. Because bootloader is rather large, I do not want to run it from RAM (and I do not plan to use SDRAM), thus when reading and writting, those routines should be ran from RAM or ROM. Mcuxpresso way of doing it is from RAM and why not the ROM API? Thanks.

0 Kudos
Reply

2,536 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, I read the next app note and maybe could help you.

Implement RWW on i.MX RT Series (nxp.com)

Best regards,
Pavel

 

0 Kudos
Reply

2,615 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my name is Pavel, and I will be supporting your case, let me investigate more information about your questions.

Best regards,
Pavel

0 Kudos
Reply