Use the ROM bootloader to configure the QSPI

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

Use the ROM bootloader to configure the QSPI

Jump to solution
624 Views
javiersoriano
Contributor II

I have been reading a bit about the ROM bootloader, but I am stil not sure I can use it for what I want. I am usign a Freedom K82 dev board.

The manual of the K82 sub-family says that the ROM bootloader can be used to boot an application from the QSPI. I would like to use it slightly different.

Starting point

I have an application that initializes the QSPI and the OTFAD (using the BCA, QCB and keyblob), and then I read/write data from/to it. To get this to work, I had to use the fsl_* drivers in my code, which I took from the Bootloader 2.0 source code.

      - I would not like to reuse the software bootlader, because I already have a bootloader of my own in place. 

      - I tried modifying the FOPT field, but whenever I try to debug, many errors occur. (value 0xBF)

      - Running the microcontroller without the debugger, my app seems ot hang, as if it never gets out of the bootloader, or just some error happens. 

Goal

Ultimately, I would like to have the QSPI and OTFAD initialized by the ROM bootloader, and then jump to my application (residing in internal flash.) My application would then proceed to read and write data, but all the initialization would be done by the ROM bootloader.

I have a few questions:

1. Is my goal even possible?

1. How to force the ROM bootloader to run every time the device is booted?

1. Does Section 2.7.1 from this document apply to the ROM bootloader as well?

2. Would the QSPI remain configured even after exiting the ROM bootloader?

3. What version and type is included as the ROM bootloader? In the example NXP bootloader 2.0, I see a freedom_bootloader, flashloader, and a flashloader_loader. Is the ROM bootloader represented in any of those?

4. Would the QSPI remain configured even after application jumps?

Thanks in advance for the patience and guidance :smileyhappy:

0 Kudos
1 Solution
458 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Javier,

Please see below some feedback about your questions:

1) The QSPI can be configured by the ROM bootloader but it then expects to load an application in QSPI memory or simply jump to an existing application in QSPI memory. The ROM bootloader would not configure QSPI and then jump to an application in internal flash.

The flow diagram for the ROM bootloader with QSPI support can be found in the next documents:

- K82_Reference_Manual

- KBOOT_QSPI_User_Guide

2) The QSPI remains configured but code would actually be executed from QSPI memory.

3) The freedom_bootloader code would be the closest match to the ROM bootloader firmware.

4) Same as [2].

Regards!

Jorge Gonzalez

View solution in original post

2 Replies
459 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Javier,

Please see below some feedback about your questions:

1) The QSPI can be configured by the ROM bootloader but it then expects to load an application in QSPI memory or simply jump to an existing application in QSPI memory. The ROM bootloader would not configure QSPI and then jump to an application in internal flash.

The flow diagram for the ROM bootloader with QSPI support can be found in the next documents:

- K82_Reference_Manual

- KBOOT_QSPI_User_Guide

2) The QSPI remains configured but code would actually be executed from QSPI memory.

3) The freedom_bootloader code would be the closest match to the ROM bootloader firmware.

4) Same as [2].

Regards!

Jorge Gonzalez

458 Views
javiersoriano
Contributor II

Hello Jorge, 

Thanks for the detailed and accurate information. I had already feared that it would not be entirely possible to use it in the way I wanted. So I ended up doing it in a different way. Basically configuring the QSPI/OTFAD from the user app, which is stored in the internal flash. 

Cheers!

Javier

0 Kudos