flash bootloader iMXRT 106x

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

flash bootloader iMXRT 106x

Jump to solution
1,684 Views
halvard
Contributor I

Hi, I am currently working on a custom card based on the i.MX 1060 evaluation board.  The board has to do the following:

  1. Be able to boot 2 different images (based on DIP setting on the board)
  2. Store both images in the qspi-nor-flash on the board (downloaded over ethernet)
  3. Execute the images in RAM, (non XIP)

In the manual for the 1060 (IMXRT1060RM.pdf) there is a mention of the PERSIST_SECONDARY_BOOT and that it can be used for Flex SPI NOR. (chapter 957)

The chapters for the FlexSPI NOR does not have information about how to configure (and locate in flash) the secondary boot.  chapter 9.6.7.5 mention something about info in address 0x200, but I can not see that this is relevant.

The question is:

Are there relevant examples that can demonstrate secondary boot using flexspi-nor ?

The other option is to have a small bootstrap in flash, executing XIP, and that the bootstrap reads the DIP and loads the relevant image to RAM.  Are there any examples that can be relevant for such an approach ?

I am using IAR-EW

Thanks

Halvard

Labels (1)
0 Kudos
1 Solution
1,649 Views
halvard
Contributor I

I did the following:

  • implemented code for downloading 2 different images to 2 different locations in the Flex SPI flash.  This was code we developed many years ago for a similar system, so the job was just a day of porting.  The flashed image is really the raw binary (*.bin) of the project.
  • Making a small bootstrap that is flashed from offset 0 (code from 0x2000) in the flash, just like most of the flex_* examples
  • The bootstrap checks the DIP, checks that the selected image is valid, copies image to the RAM and calls the execution address.
  • The execution address is the ResetHandler since a pointer to ResetHandler is allways at offset 0x04 in the IVT.

case closed

Halvard

View solution in original post

0 Kudos
2 Replies
1,650 Views
halvard
Contributor I

I did the following:

  • implemented code for downloading 2 different images to 2 different locations in the Flex SPI flash.  This was code we developed many years ago for a similar system, so the job was just a day of porting.  The flashed image is really the raw binary (*.bin) of the project.
  • Making a small bootstrap that is flashed from offset 0 (code from 0x2000) in the flash, just like most of the flex_* examples
  • The bootstrap checks the DIP, checks that the selected image is valid, copies image to the RAM and calls the execution address.
  • The execution address is the ResetHandler since a pointer to ResetHandler is allways at offset 0x04 in the IVT.

case closed

Halvard

0 Kudos
1,680 Views
mjbcswitzerland
Specialist V

Hi Halvard

Your boot loading requirements are covered by the uTasker project (can be used with any application so you can still use the SDK for application development if needed):
- Serial and Over-the-Air loading (including Ethernet, as well as USB, SD card, memory stick, LPUART) with AES25 security running from SRAM: https://www.youtube.com/watch?v=2XfgZq19XDw&list=PLWKlVb_MqDQEOCnsNOJO8gd3jDCwiyKKe&index=3
- Flow diagram: https://www.utasker.com/docs/iMX/Loader.pdf
- Serial loader user's guide: https://www.utasker.com/docs/uTasker/uTaskerSerialLoader.pdf
- Bare-Minimum Loader: https://www.utasker.com/docs/uTasker/uTasker_BM_Loader.pdf
- Reference binaries: https://www.utasker.com/iMX/RT1060.html

- Builds with IAR - step-by-step building guide: https://www.utasker.com/docs/iMX/IAR.pdf

In its out-of-the-box form it has a fixed application address but this can be made selectable by modifying

if (*BOOT_MAIL_BOX == RESET_TO_APPLICATION) {
    start_application(iMX_APPLICATION_LOCATION + iMX_FILE_OBJECT_SIZE); // jump to the application
    // If this call returns it means that there is no application in place
    //
}

to

if (*BOOT_MAIL_BOX == RESET_TO_APPLICATION) {
    if (_READ_PORT_MASK(2, DIP_SWITCH) != 0)
        start_application(iMX_APPLICATION_2_LOCATION + iMX_FILE_OBJECT_SIZE); // jump to the application
        // If this call returns it means that there is no application in place
        //
    else {
        start_application(iMX_APPLICATION_LOCATION + iMX_FILE_OBJECT_SIZE); // jump to the application
    }
}

Therefore you will be able to complete this requirement with ease.

Regards

Mark
uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training or product development requirements

0 Kudos