Error in firmware update of MIMXRT106S MCU via OTW on Linux

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Error in firmware update of MIMXRT106S MCU via OTW on Linux

6,811 次查看
Merry
Contributor II

Hi,

I tried to run the Test Script on NXP MIMXRT106S MCU via OTW (UART) on Linux. First , to set the FICA bit I use the updateotw shell command.

I start the OTW update by moving here ->  /sln_local2_iot_bootloader/unit_tests  and run the command with arguments python3 fwupdate_client.py local OTW B /home/vkchlt0280/Documents/MCUXpresso_11.4.0_6237/workspace/sln_local2_iot_local_demo/Debug/sln_local2_iot_local_demo.bin  the script outputs the following:

Sending Start Request
7
ERROR received: 7

The terminal is stuck and no further steps can be processed.

I dont know why this error occurs and I didnt get the solution. Can you help me in figuring out this problem

标签 (1)
0 项奖励
回复
34 回复数

4,622 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

HI @Merry 

 If you meet my previous issues:

unit_test_fwupdate_self_test_start
{"messageType": 1, "fwupdate_message": {"messageType": 1, "fwupdate_server_message": {"messageType": 2}}}
3
ERROR received: 3

You can enter the serial download mode, erase the FICA area

kerryzhou_0-1638780374982.png

Best Regards,

Kerry

0 项奖励
回复

4,594 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Merry 

You need to also use the lvaldi and configure it.

The Ivaldi package can be downloaded from www.nxp.com/mcu-local2.

Then refer to \Ivaldi_sln_local2_iot\README.md configure it.

 

Best Regards,

Kerry

0 项奖励
回复

4,556 次查看
Merry
Contributor II

Hi @kerryzhou ,

Is it neccesary to configure Ivaldi ? How this is essential in firmware upgrade of MCU ?

Could you pls tell.

 

 

Thanks

Merisa

0 项奖励
回复

4,539 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Merry 

   Yes, you need to configure the lvaldi, I also test it based on the configured lavldi, and it works OK.

   Please try it on your side, in the lvaldi software, it has an readme, just follow it and configure it at first, then run the OTW or OTA related command, you will find it can download, please also configure the hardware, as the OTW download interface is not the USB UART port, you need to find the TTL-USB connect the related UART pins. 

   All the details, I already share it with you.

 

Best Regards,

Kerry

0 项奖励
回复

4,519 次查看
Merry
Contributor II

Hi @kerryzhou 

I downloaded Ivaldi tool, changed the configurations mentioned by you and even tried changing the UART module (TTL USB) also, but still no changes. 

Apart from this I tried flashing the "Hello World" program and check if there is any output from UART6. I was not able to get the print at the screen. Do I have to configure anything at the NXP side for obtaining this print? Could this in anyway be the root cause for the issues faced by me?

Thanks in advance! 

0 项奖励
回复

4,489 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Merry 

1. UART hardware

 It needs 3 wire: UART6_TX, UART6_TX, GND, 3 wire connect to your TTL-USB.

kerryzhou_0-1639015009805.png

You also can upload your hardware picture, I even give you my connection previously.

 

2.  Ivaldi tool configuration

  I suggest you also use the windows to configure it, then use the Git Bash to do it, as I also do it like that.

- Windows Subsystem for Linux
    - Bash
    - Python3 (Tested with Python 3.8.3)
### Software

- Python 3.8.x
    - [NOTE: Might work with other Python 3.x versions, but untested. See above.]
- Pip for Python3
 
## Setup

Installing virtualenv

```
user@host:~/sln_imx_rt_prog_and_test $ pip install virtualenv
```

Starting virtualenv (inside the sln_imx_rt_prog_and_test folder)

```
user@host:~/sln_imx_rt_prog_and_test $ virtualenv env
```

Activating virtualenv in **Bash**

```
user@host:~/sln_imx_rt_prog_and_test $ source source env/scripts/activate

 

===================

After that, I use these command:

cd C:\sln_imx_rt_prog_and_test // enter your configured Ivaldi folder

python -m venv env


source env/Scripts/activate

python -m pip install pyserial


python -m pip install libscrc


python fwupdate_client.py local OTW B sln_local2_iot_local_demoB.bin None


python fwupdate_client.py local OTW A sln_local2_iot_local_demoA.bin None


--------------

OTA command
python fwupdate_client.py local OTA B sln_local2_iot_local_demoB.bin None


python fwupdate_client.py local OTA A sln_local2_iot_local_demoA.bin None

 

3. About UART6 test with helloworld.

If you still not OK, you even can use the oscillatorscope to test the TX pin, whether it is really output the UART data.

 

4.  bootstrap and bootloader two Project

 Set: DISABLE_IMAGE_VERIFICATION=1

Download local_voice to (bankA) 0X60300000.

 

Please do more checking.

Wish it helps you!

Best Regards,

Kerry

0 项奖励
回复

4,477 次查看
Merry
Contributor II

Hi @kerryzhou ,

I made the changes you told to do ,like configuring Ivaldi ,Set: DISABLE_IMAGE_VERIFICATION=1 of bootstrap and bootloader  Project and setting UART hardware. But the result is still same.

Start OTW ...
Attempt to connect ...
Connected to /dev/ttyUSB3
unit_test_fwupdate_start_req
Sending Start Request

I will share the hardware set up.

IMG-20211209-WA0030.jpgIMG-20211209-WA0032.jpg

 

I probe the UART6 with our hardware set up by running the script. The data is reaching from 'TTL to USB 'and reaches NXP but I am not sure whether NXP can read or send back data. Is there anyway to know ?

 

Also , I added a print statement inside local_demo UART6 driver and add breakpoint to check whether NXP is receiving UART data .But the programs keeps on running and doesnt pause on these breakpoints

Screenshot from 2021-12-09 21-27-03.png

So , how can we make sure whether NXP receives UART data ? Is there any changes I have to make in the code. Can u pls help on this

0 项奖励
回复

4,449 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Merry 

  Q1: I probe the UART6 with our hardware set up by running the script. The data is reaching from 'TTL to USB 'and reaches NXP but I am not sure whether NXP can read or send back data. Is there anyway to know ?

--Answer:

Please check the local2 design guider, you will find it have the feedback:

kerryzhou_0-1639192606188.png

 

Q2 UART6 test

To be honest, from now on, I think your app code has no issues, it may be influenced by your hardware, I checked your hardware connection picture, I don't think it is very good, wire too long.

I think you may use the SDK RT1060 helloworld, change the pins to the UART6 to test the send and receive at first.

Don't you have the TTL-USB cable like me? That cable will more good than yours, as your connection my have interference, signal may not stable enough.

Eg:

kerryzhou_1-1639192811641.png

 

As you mentioned, directly UART6 can't work, I suspect your hardware connection now.

To the OTW, this point is also very important, which I have told you.

modify the fwupdate_client.py COM port.

kerryzhou_2-1639192986841.png

 

Highly recommend you find a TLL-USB tool like me, very cheap.

 

Best Regards,

Kerry

 

 

 

0 项奖励
回复

4,411 次查看
Merry
Contributor II

Hi  @kerryzhou  ,

As you said , I was  configuring UART6 of  SDK RT1060 helloworld to test the send and receive.

I made the below changes in hello_world.c

1..Added  these 2 headerfiles :   #include "serial_port_uart.h"    and    #include "serial_manager.h" 

2..Screenshot from 2021-12-13 20-31-55.png

3..Screenshot from 2021-12-13 20-36-53.png

4..Screenshot from 2021-12-13 20-41-30.png

Is there any other changes I have to make in the code? After making these changes ,I didnt get the output. Could you pls help..

0 项奖励
回复

4,399 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Merry 

  You make things difficult.

  Please use my attached project, I already help you change the UART port to UART6, and test it on my SLN-LOCAL2-IOT, the UART works OK.

This is the printf information:

kerryzhou_0-1639461155871.png

When you input the data, it will return back, so both TX, RX works.

Use my attached project, with JLINK debugger.

BTW, I find your connection may have issues, but I can't see it clearly.

kerryzhou_1-1639461211594.png

As I told you:

kerryzhou_2-1639461239933.png

3 pins used: 

pin12 UART6_TX connect to TTL-USB UART_RX

pin10 UART6_RX connect to TTL-USB UART_TX

pin15 GND connect to TTL-USB GND.

Please test it.

Seems your UART6 even didn't work for your hardware connection

Just confirm it at first.

Best Regards,

Kerry

 

 

 

0 项奖励
回复

4,386 次查看
Merry
Contributor II

Hi 

Thank you for the Uart project.

Could you pls tell to which address we may flash it.

0 项奖励
回复

4,380 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Merry 

   Just download my code directly, it will located from 0X6000000, this is used to test your UART6 interface directly, I highly suspect your hardware connection have issues.

Best Regards,

Kerry

0 项奖励
回复

4,359 次查看
Merry
Contributor II

Hi @kerryzhou  

I first try to flash your code using Jlink Segger and got the below error :

Screenshot from 2021-12-15 12-59-35.png

Also, we probe NXP for checking TX pin of Uart6 without connecting TTL USB.But we didnt get any transmission and that TX pin gives signal low.  We try to solve the issue..Is there anything to add in the  code .Could you pls help us with this.

0 项奖励
回复

4,352 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Merry 

  What's the JLINK driver version you are using?

  Please use this version:

https://www.segger.com/downloads/jlink/JLink_Windows_x86_64_V750.exe

Install it.

Then MCUXpresso select it:

windows->preferences

kerryzhou_1-1639554500443.png

 

 Please also need to check your device, you need to select RT106S:

Run->debug configurations

kerryzhou_0-1639554418600.png

Please try it again!

Best Regards,

Kerry

 

0 项奖励
回复

4,367 次查看
Merry
Contributor II

Hi @kerryzhou 

Our JLINK driver version is JLink_V754b.

I think there is no issue with this driver version.

I changed device to RT106S.

Now , while probing TX pin of NXP I got signal high. Also when I try to flash using Jlink Segger and test it using TTL USB I didn't get print statement .
Still ,there is something missing . Can you pls help

标记 (1)
0 项奖励
回复

4,355 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Merry 

1. if you don't use the same JLINK driver as me, do you can enter the debug mode like me with my project?

2. You didn't give me updated information about your hardware UART connection, I can't see clearly, please double check your UART6 related pins, whether you use the correct pin or not?

I can confirm my code works OK on the SLN-LOCAL2-IOT, I don't know you debug it or not, in fact, it is very easy to check and debug.

If you still not OK, enter debug mode, run it, use osciallator to check the UART6_TX pin, whether it has wave or not? If you still have issues, you can change another SLN-LOCAL2-IOT to test it, as your colleagure also have the boards.

Please do more checking by yourself, as I already provide all the UART project, OTA, OTW detail test steps, test result, hardware connection to you. Now, it just related to your test method, test TTL-USB tool, hardware connection issues, you need to check it by yourself carefully, thanks.

Best Regards,

Kerry

0 项奖励
回复

4,295 次查看
Merry
Contributor II

Hi @kerryzhou  

Your evkmimxrt1060_lpuart_polling project works after changing pinmux to uart6 alone and changing device to MIMXRT106S.

There is no issue with the hardware UART connection and Jlink driver.

I tried to make uart6 up in sln_local2_iot_hello_world_virtual_com too..It works.

I felt difficult to make uart6 up in local_demo project.Could you pls help in this?

Also ,I gone with the firmware update via OTW  with the changes suggested by you.But it still act the same way as before Sending start request.

 

 

0 项奖励
回复

4,291 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Merry 

  My code can sendout the data and when you use the console, eg Tera Term input the word, it will also receive and send it out. Do you test both send and receive, all works with your COM port now?

  If your OTW still not work, seems still have the configuration issues. But it works both on my side and my colleague side. When you test the OTW, you need to burn the bootloader, bootstrap +local_demo again. bootloader disable the verification.

  Best Regards,

Kerry

0 项奖励
回复

4,277 次查看
Merry
Contributor II

Hi @kerryzhou  

I tested both send and receive, all works with the COM port and USB port too.

I configured Ivaldi ,disabled image verification of both Bootstrap and Boodloader , run the main app local demo on App A and  done flashing through TTL-USB on App B for Firmware update .Still no changes.I think there is some issue while doing these changes.

Also ,I doubted whether we want to enable uart6 in local demo code like made in lpuart polling program.

0 项奖励
回复

4,265 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Merry 

  Do you use the USB shell select the updateotw or not? 

  In fact, in my previous reply, I already give you all the details, even the test .bin appA and appB.

kerryzhou_0-1640052455668.png

Please check this item, before you do the OTW with your J26 UART TLL-USB, you need to use the SLN-LOCAL2-IOT USB UART port shell enter the OTW mode at first:

kerryzhou_1-1640052502158.png

Do you do it or not before you enter the OTW detail command process?

If you still not OK.

Please test the MSD update at first.

Check the user guide:

https://www.nxp.com/webapp/Download?colCode=SLN-LOCAL2-IOT-UG

Chapter 5.3 USB Mass Storage Device (MSD) Mode.

Whether you can run app A, and change the app B, then check in the shell about the app version?

The app you use my attached app previously:

https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imxrt/17411/1/sln_local2_iot_local_demoA...

https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imxrt/17411/2/sln_local2_iot_local_demoB...

After you make this works, then test the OTW again.

You can power off your board, power off the TTL-USB, power off the SLN-LOCAL2-IOT, then power on SLN-LOCAL2-IOT, power on your TTL-USB tool. then record all the OTW operations in the video, share your video with me, I will check your details.

In fact, when I do it, it works OK.

Best Regards,

Kerry

 

 

0 项奖励
回复