iMXRT1064 Bootloader

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

iMXRT1064 Bootloader

Jump to solution
4,866 Views
hemadri_payam
Contributor III

Hi,

I am developing a bootloader for iMXRT1064 to update the firmware in the inbuilt flash (interfaced through FLEXSPI2). As per my understanding, the bootloader in the bootrom section can be used to perform flash operations (read, erase and program through FLEXSPI2).


When I try to perform any of the flash bootloader operations, I end up in Hardfault - USAFAULT (Usage Fault - UNALIGNED)


However I am not using IAR workbench and building the code by setting up the platform in Visual Code and using boilermake. Lauterbach Trace32 is used for debugging.

The image is built as XIP with the below linker file configurations:


 m_flash_config (RX) : ORIGIN = 0x70000000, LENGTH = 0x00001000
m_ivt (RX) : ORIGIN = 0x70001000, LENGTH = 0x00001000
m_interrupts (RX) : ORIGIN = 0x70002000, LENGTH = 0x00000400
m_text (RX) : ORIGIN = 0x70002400, LENGTH = 0x0003DC00
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000
m_data2 (RW) : ORIGIN = 0x20200000, LENGTH = 0x000C0000

Can you please help what is the configuration that I am missing.

Regards,

Hemadri

Labels (1)
1 Solution
11 Replies
3,828 Views
vikram_tathe
Contributor II

Hello, victorjimenez

As you mentioned in this thread, The MCUXpresso SDK version for the RT1064 will include a Bootloader example. This version will be released in the next weeks.

and in the previous message, you told that the new version of the SDK is out now. I encourage you to check the bootloader example for the i.MXRT1064.

I am using MXRT1064 SDK but did not find the bootloader example code in the SDK.

could you please share the example code or example code name in the if you have?

I am developing the code so that bootloader and application code both will be in the internal flash only and the primary bootloader will call the secondary bootloader Placed at 0x70000000 location in the flash and the secondary bootloader will call to an application started at address 0x70008400 in the flash memory.

Here, bootloader and application code projects are different.

Could you please let me know how to debug these two binaries?

Regards,

Vikram

0 Kudos
3,828 Views
hemadri_payam
Contributor III

Hi,

The problem is solved if I call the ROM bootloader functions (g_bootloaderTree->flexSpiNorDriver->get_config() & g_bootloaderTree->flexSpiNorDriver->init()) before initializing the FLEXCAN peripheral.

But I am curious to know the reason why the base pointer for the CAN peripheral becomes Null when the ROM bootloader function is called. 

Can NXP share the source code of the ROM bootloader API functions.

The example provided in the SDK runs in RAM. However, the bootloader that I am developing runs in Flash and in XIP mode. Please confirm if the procedure that I am following to update the firmware application is correct.

Regards,

Hemadri

0 Kudos
3,828 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Hemadri,

Regarding your questions please see my comments below.

Can NXP share the source code of the ROM bootloader API functions.

Unfortunately, is not possible to share the source code of the ROM bootloader API functions.

Please confirm if the procedure that I am following to update the firmware application is correct.

Yes, the procedure that you are following is correct. Please keep in mind that the functions that update the firmware must be executed from RAM. Although the bootloader example provided in the SDK resides in RAM, you can use this as a guide to making your own bootloader.

Regards,

Victor

0 Kudos
3,828 Views
hemadri_payam
Contributor III

Hi Victor,

Thanks for the response. I will update my code as per the instructions and executing the firmware update from RAM.

Regards,

Hemadri

0 Kudos
3,828 Views
hemadri_payam
Contributor III

Hi,

As mentioned earlier, I am developing second level bootloader to update the application firmware. The application firmware is sent via FlexCAN - FD. The second level bootloader runs from NOR FLASH in XIP mode. Linker file configurations are the same as mentioned above.

When I call the function: 

nor_options.option0.U = 0xC0000008;

status_ = g_bootloaderTree->flexSpiNorDriver->get_config ( 1, &config_,&nor_options );

The base pointer for the CAN peripheral becomes Null. 

Image is attached for your reference.

Can I know the root cause of this problem.

The procedure followed to develop a second level bootloader with the update over FlexCAN:

1. Bootloader code runs in Flash in XIP mode.

2. Check for GPIO to decide on whether to update or jump to firmware application.

3. Get the firmware to through FlexCAN.

4. ROM boot APIs are used to update the firmware in the flash.

5. Step 3 and step 4 continues to execute until the complete firmware is updated to Flash.

6. Jump to Application.

Please confirm if I am following the right procedure of developing a second level bootloader to update the Firmware application in Flash.

Regards,

Hemadri

0 Kudos
3,828 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Hemadri,

The new version of the SDK is out now. I encourage you to check the bootloader example for the i.MXRT1064.

Best regards,

Victor

0 Kudos
3,828 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Hemadri,

Unfortunately, there's no demo about the operations of the internal flash. About the bootloader demo, I'd like to suggest you refer to the bootloader_examples in SDK_2.5.0_EVK-MIMXRT1060.

The next MCUXpresso SDK version for the RT1064 will include a Bootloader example. This version will be released in the next weeks.


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.
-------------------------------------------------------------------------------

3,828 Views
hemadri_payam
Contributor III

Hi Victor,

Thank you so much for the information.

Regards,

Hemadri

3,829 Views
carstengroen
Senior Contributor II
3,828 Views
hemadri_payam
Contributor III

Hi Carsten,

I followed as per the example that you have provided in the above thread and the problem is solved.

Thank you so much.

Regards,

Hemadri

0 Kudos
3,828 Views
carstengroen
Senior Contributor II

Thanks Hemadri,

happy to be of some help :smileyhappy:

0 Kudos