OTA bootloader update_image_state(1) issue

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

OTA bootloader update_image_state(1) issue

Jump to solution
3,687 Views
KyleHsieh
Contributor I

I would like to update application of i.MXRT1060 EVK with OTA bootloader, but "bl_update_image_state(kSwapType_ReadyForTest)" return error as below.

bl_update_image_state_error.JPG

And seems like the bootloader do not enter test mode after reboot. 

My steps: 

SW7 setting: 0010

1. Build and program ota_bootloader release version (using default address 0x60000000)

2. Build and program lwip_httpssrv_ota (using default address 0x60040000)

3. press SW4 to reset

4. Build the other lwip_httpssrv_ota example code and create binary for upgrade test

 create binary file for test.jpg

5. Use web GUI to upgrade application.

gui.JPG

My SDK version is 3.9.3.

Thank you.

 

Best Regards.

Kyle

Labels (1)
0 Kudos
1 Solution
3,654 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
1) Do I need to modify any source or configs except for add log to test it on RT1060 EVK?
-- No.
2) Could you build a test image include bootloader and application that I can test on my side?
-- Please check the attachment.
There's my testing result, it works well.

jeremyzhou_0-1657875842357.png

 


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

View solution in original post

0 Kudos
18 Replies
3,624 Views
KyleHsieh
Contributor I

Hi @jeremyzhou ,

 

I downloaded SDK2.10.1 and built "ota_bootloader"&"lwip_httpsrv_ota_enet" to upgrade the image.

I upgrade the "v1 image" to "v2 image" for test and works well.

But if I want to upgrade from "v2 image" to "v1 image" again.

The log will shown "Image validation failed".

image validation failed.JPG

What's the difference after I upgrade the image?

Thank you.

 

Best Regards.

Kyle

0 Kudos
3,611 Views
KyleHsieh
Contributor I

Hi @jeremyzhou ,

 

Could you please help me to check this issue?

Do I need to sign the upgrade image if I used SDK2.10.1?

Thank you.

 

Best Regards.

Kyle

0 Kudos
3,606 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
I didn't encounter the issue you mentioned, I can update the application from V1 to V2, or V2 to V1 actually.The below figure shows the update steps, and I also attached the log.

jeremyzhou_0-1658911324201.png

jeremyzhou_1-1658911361992.png

 


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

0 Kudos
3,574 Views
KyleHsieh
Contributor I

Hi @jeremyzhou ,

Thanks for your help.

I tried the image that ypu uploaded.

May I ask you a few qusetions?

1. Is flash address corrected? bootloader: 0x60000000, app: 0x60040000

Which flash tools did you used?

2. What's the difference between evkmimxrt1060_lwip_httpssrv_ota_enet.bin and evkmimxrt1060_lwip_httpssrv_ota_freertos_mcuxpresso v1.bin that you upload before.

I could upload the evkmimxrt1060_lwip_httpssrv_ota_enet.bin by web GUI again and again.

But if I want to evkmimxrt1060_lwip_httpssrv_ota_freertos_mcuxpresso v1.bin update, the image would be validation failed as below.

updated different image failed .JPG

3. Which bootloader did you used for evkmimxrt1060_lwip_httpssrv_ota_freertos_mcuxpresso v1.bin? I could not update the image even if use the same image. It could not enter the test mode after I click the upload button. 

updated failed.JPG

0 Kudos
3,556 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
1) 1. Is flash address corrected? bootloader: 0x60000000, app: 0x60040000
-- Yes.
2) What's the difference between evkmimxrt1060_lwip_httpssrv_ota_enet.bin and evkmimxrt1060_lwip_httpssrv_ota_freertos_mcuxpresso v1.bin that you upload before.
-- Actually, the evkmimxrt1060_lwip_httpssrv_ota_enet.bin is the evkmimxrt1060_lwip_httpssrv_ota_freertos_mcuxpresso v2.bin.
3) Which bootloader did you used for evkmimxrt1060_lwip_httpssrv_ota_freertos_mcuxpresso v1.bin?
-- ota_bootloader demo.

jeremyzhou_0-1659939679108.png

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

0 Kudos
3,495 Views
KyleHsieh
Contributor I

Hi @jeremyzhou ,

 

I summary my test steps and upload my binary files on https://community.nxp.com/t5/i-MX-RT/OTA-bootloader-Image-validation-failed-issue/m-p/1506488#M21082

Could you please help us to check "Image validation failed" issue?

Thank you very much.

 

Best Regards.

Kyle

 

 

0 Kudos
3,608 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Sorry for replying late, as I'm on annual leave in last week.
I'll check your question soon later.
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.
-------------------------------------------------------------------------------

 

0 Kudos
3,665 Views
KyleHsieh
Contributor I

Hi @jeremyzhou ,

 

Thank you for your reply.

I referenced https://www.nxpic.org.cn/module/forum/thread-620190-1-1.html and do the test step by step.

But seems like I encouter the same issue on SDK2.7.0 and SDK2.9.3.

Do I need to modify any source or configs except for add log to test it on RT1060 EVK?

Could you build a test image include bootloader and application that I can test on my side?

Thank you.

 

Best Regards.

Kyle

0 Kudos
3,655 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
1) Do I need to modify any source or configs except for add log to test it on RT1060 EVK?
-- No.
2) Could you build a test image include bootloader and application that I can test on my side?
-- Please check the attachment.
There's my testing result, it works well.

jeremyzhou_0-1657875842357.png

 


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

0 Kudos
3,648 Views
KyleHsieh
Contributor I

Dear @jeremyzhou ,

 

The attachments works well on my side.

May I ask which SDK version and IDE did you used? 

Is there anything else that I should pay attention to download SDK package?

 

Thank you.

Best Regards.

 

Kyle

0 Kudos
3,640 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
SDK library: 2.10.1
MCUXpresso: v11.5.0
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.
-------------------------------------------------------------------------------

0 Kudos
3,671 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
To provide the fastest possible support, I'd highly recommend you refer to these two posts.

https://www.nxpic.org.cn/module/forum/thread-620190-1-1.html

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1060-OTA-bootloader-ISP-and-swap-rollback-usag...

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

0 Kudos
3,536 Views
KyleHsieh
Contributor I

Hi @jeremyzhou ,

 

If would like to use blhost command to flash image to app area by uart baudrate 115200 as below,

blhost.exe -t 50000 -p COM11,115200 -j -- get-property 1 0
blhost.exe -t 50000 -p COM11,115200 -j -- flash-erase-region 0x60040000 0x200000 9
blhost.exe -t 50000 -p COM11,115200 -j -- write-memory 0x60040000 test.bin

How could I config ota_bootloader code for higher baudrate?

Thank you.

 

Kyle

0 Kudos
3,522 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
The speed argument is available to set other values than the 115200, however, the speed argument should keep the same once executing the blhost command.

jeremyzhou_0-1660531245028.png

 


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

 

0 Kudos
3,516 Views
KyleHsieh
Contributor I

Hi @jeremyzhou ,

 

I reset and tried to used baudrate "230400" for test but get no reponse received.

blhost get property failed.JPG

Is there any max baudrate limit for this blhost?

How could I define the fix baudrate?

Thank you.

 

Best Regards.

Kyle

0 Kudos
3,493 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @KyleHsieh ,
Thanks for your reply.
In my opinion, the issue mainly relates to the evkmimxrt1060_ota_bootloader, in the demo, it uses the autobaud_get_rate function to calculate the baud rate according to received data, if the calculated baud rate is far from the real baud rate, which will cause the phenomenon you encountered.

jeremyzhou_0-1660632639142.png

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

0 Kudos
3,482 Views
KyleHsieh
Contributor I

Hi @jeremyzhou ,

 

Thanks for your support.

Is there any way to config the higher baudrate for blhost firmware upgrade?

 

Thank you.

Tags (1)
0 Kudos
3,475 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
1) Is there anyway to config the higher baud rate for blhost firmware upgrade?
- Yes, I think so, however, it needs the developer to adjust or optimize the source code.
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.
------------------------------------------------------------------------------o

0 Kudos