local ota firmware update on imxrt1170evk

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

local ota firmware update on imxrt1170evk

1,867 Views
mxgok
Contributor I

Hi,

For on going project, we are trying to firmware update locally on our custom board design based on rt1172. But for to evaluate, we are testing first on  rt1170evk.  Evaluation kit solution is okey for us. 

Our application firmware will take new firmware from uart and write to secondary slot flash location and use "remap mode" feature as it is suggested on application nodes. I investigated the issue, 

i will say there are 2 approaches. The old approach supports many mcus and gives iar or keil project as output. In the new approach, sbl and sfw is scattered to SDKs of each MCU as it should be. We want new aproach as our application firmware project is based on MCUExpresso. 

Old approach works as all documents are describing it. The problem is that old approach is NOT giving MCUEXPRESSO project. But the new approach, there is no documentation and code is trying to use swap trailer info instead of remap trailer structure. 

OLD APPROACH

NEW APPROACH

SDK_2_13_0_EVK-MIMXRT1060

SBL:

https://github.com/nxp-mcuxpresso/sbl

 

SBL:

evkmimxrt1170_mcuboot_opensource

SDK project

SFW:

https://github.com/nxp-mcuxpresso/sfw

 

SFW:

evkmimxrt1170_ota_demo_enet

SDK project

Document:

https://www.nxp.com/docs/en/application-note/AN13460.pdf

 

Document:????????? Where is documentation describing the flow, docs at the end of the SDK project folder doesn’t give information…..

Howto generate sfw.bin,  how to flash it to which address 0x34000000 or 0x3400400 in which format?????axf,bin,hex……

COMMENTS:

This old way is for various MCUs such as

mxgok_0-1674429010260.png

 

You choose which mcu, run env.bat…..then scons or

·         scons –menuconfig for sdcard/udisk/or AWS ota cases OR

·         use scons to generate IAR or KEIL project……

This for both SBL and SFW…..

 

 

 

 

COMMENTS:

What a mess….For imxrt1170 mcus , remap mode is the way to go because swap boot type uses too much flash erasing and writing unnecessary.

Some chips of i.MXRT series have the feature of remap. The addition of Remap mode is based on this feature. To enable this

feature, set up three registers, the start address, end address, and offset address.

Compared with the Swap mode, this function

greatly reduces the number of flash erasing and writing, prolongs the service life, and shortens the time for FOTA greatly.

 

But when you use remapping, you should use remap trailer instead of two swap image trailers. When I inspect the SDK project, there is no remap trailer also still trying to use swap trailers…..

 

mxgok_1-1674429451341.png

 

 

 

Can you help us to proceed in MCUExpresso project way?

QUESTIONS:

1) Is there a version of old approach giving output MCUexpresso project as IAR or keil project? It will be okey for us also.

2)In mcu expresso way (new approach), can you give us a document explaining the code flow and usage of application firmware as how to burn to flash in which format/address/?

3) Also in the newest SDK release, code still uses swap trailers instead of remap trailer used in remap mode? 

Will be happy if you can guide us. 

0 Kudos
Reply
5 Replies

1,708 Views
mxgok
Contributor I

Help needed...the solution i posted above works for rt1176 based evk. But for our custom board which is based on rt1172, i couldnt make it happen.

The problem is SBL is for rt1176...https://github.com/nxp-mcuxpresso/sbl   because evk is based on it. What to do for SBL for RT1172?

I have changed MIMXRT1776 directory from one found internet with MIMXRT1172.I have modified some directories and Sconscript files to point them, but they didnt work. Is there a SBL for rt1172? 

 

mxgok_0-1678457375532.png

 

 

 

0 Kudos
Reply

1,755 Views
mxgok
Contributor I
 
0 Kudos
Reply

1,756 Views
mxgok
Contributor I

In our project data section of application firmware must use SDRAM, because we are using big buffers which cannot fit in onchip srams . Unfortunately, the  ota examples are built with SRAM configurations. After some struggle, managed to use SDRAM version of the application firmware. Writing below the procedure for having the same problem.

SBL generation:

 

 

SRAM configuration:

·         SBL:

Download code from https://github.com/nxp-mcuxpresso/sbl

Follow the instructions section 3.1 for SBL… https://www.embeddedartists.com/wp-content/uploads/2021/11/iMXRT_OTA_SBL_SFW.pdf

After you get sbl.bin…burn it to 0x30000400 address with  GUI flash tool described in section 4.2.2 of the above diagram….

·         SFW:

SDRAM configuration:

·         SBL:

Download code from https://github.com/nxp-mcuxpresso/sbl

Follow the instructions section 3.1 for SBL…

https://www.embeddedartists.com/wp-content/uploads/2021/11/iMXRT_OTA_SBL_SFW.pdf  You have to enable “Enable SDRAM” option via scons --menuconfig…

After you get sbl.bin…burn it to 0x30000400 address with  GUI flash tool described in section 4.2.2 of the above diagram….

 

·         SFW:

For SDRAM enabling:

mxgok_0-1677596346138.png

 

You can also change primary and secondary application(firmware) address via menuconfig but default ones are 0x3010 0000 and 0x3020 0000……

 

SFW generation:

 

SFW: this the application firmware that we are developing and needs some kind of method (sd,usb,mqqt…) to download and flash the new version application/firmware to secondary slot.

First of all, to see if the sbl jumps to the primary slot the following should be done:

Import a sample project from SDK such as ..evkimxrt1170_lpuart_polling_cm7,

  • Modify the memory of flash as start

0x30100400   and size as 0xfeffc00…….

mxgok_1-1677596346232.png

 

  • Build it and convert axf to bin.

arm-none-eabi-objcopy -v -O binary "evkmimxrt1170_lpuart_polling_cm7.axf" "evkmimxrt1170_lpuart_polling_cm7.bin"

  • Pad the binary with header and signature imgtool is under ….\sbl\component\secure\mcuboot\scripts

py imgtool.py sign --key sign-rsa2048-priv.pem --align 4 --version "0.9.3" --header-size 0x400 --pad-header --slot-size 0x200000 --max-sectors 800 evkmimxrt1170_lpuart_polling_cm7_v2.bin evkmimxrt1170_lpuart_polling_cm7_signed_v2.bin

  • Flash the signed binary firmware to 0x31000000 via GUI flash tool…

After reset, you should be seeing SBL jumps to primary slot firmware,i.e. lpuart polling example….

You can modify this example to download updated version and flash to secondary slot…….

This example uses SRAM as data section…..To use BOARD_SDRAM as data section, edit memory by pushing to the second entry in memory section of project settings….if you need this,

Then you should use SDRAM version of sbl.bin…….

 

Sample Binaries:

In the attachment, you can use “sbl_modified_SDRAM.bin” and flash it 0x30000400….

Then flash signed binary “evkmimxrt1170_lpuart_polling_cm7_signed_v1.bin” to 0x3010 0000.

This binary is generated using imgtool as described above….also the sample project is attached …

Of course, you will be using your own application instead of this one with capable of downloading the updated version …..and change memory addresses as 0x30100400 for v1 and 0x30200400 for v2.

Run the serialApp download application in command prompt, “serialApp.exe evkmimxrt1170_lpuart_polling_cm7_signed_v2_CRC.bin”…..

RESET the evk board, serial output stream will be displayed in serialApp program….

Press 1 in the console of the serialApp and you will see that primary slot app (v1 one ) takes the v2 version and flash it to secondary slot and after reset, you will have your new firmware in the secondary slot…..

(CRC version is used for data integrity during serial transfer….crcgen.exe is used to append CRC to signed version

crc_gen.exe evkmimxrt1170_lpuart_polling_cm7_signed_v2.bin evkmimxrt1170_lpuart_polling_cm7_signed_v2_CRC.bin)

The project includes debug outputs during operation as it is quick and dirty one.

I don’t have much time dealing with the issue, I just wanted to help people suffering from the same problem and give some hints…..

 

0 Kudos
Reply

1,797 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @mxgok ,

The SBL/SFW(old approaches as you said) is a branch from the SDK version(new approaches). It is developed along.

1. No, there isn't.

2. Please read the readme in the project folder. It's enough for using. There isn't other document.

3. Yes.

 

Regards,

Jing

0 Kudos
Reply

1,847 Views
mxgok
Contributor I

One addition, SDK used is SDK_2_13_0_MIMXRT1170-EVK.zip mistakenly entered as 1060.   

0 Kudos
Reply