How does blhost cut build files

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

How does blhost cut build files

1,418 Views
longzhao1
Contributor I

I am trying to understand how does blhost execute the flash process. I ran this command to flash the build file to the device

./blhost -p /dev/ttyUSB0,xxxxx -- write-memory 0xxxxxxx buildFile.bin
I then use wireshark to intercept usb0's traffic, I found that blhost cut the big .bin file into several segments, and send these segments one by one to flash the device.
pastedImage_2.png
At here, the blhost sends out two 320 bytes segments, followed with a 70 bytes segments each time. In the first 8 bytes of the first 320 bytes segment, it has the same hex data (5a a5 00 02). 
pastedImage_3.png
pastedImage_4.png
My questions:
1. Why does blhost cut the data into 2 * 320 bytes of data + 1 * 70 bytes of data, then repeat?
2. Why the first 8 bytes are the same? What does this 8 bytes mean?
3. How does blhost knows that every segment is received correctly?
4. Where can I get blhost source code?
Tags (1)
0 Kudos
3 Replies

1,263 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Zhao,

Attachment is MCUboot bootloader user's manual. It has the detail of communication protocol. Please take a look.

Blhost source code is not opened to customer.

Regards,

Jing

0 Kudos

1,263 Views
longzhao1
Contributor I

For some reasons that I couldn't use blhost to flash the device, just wondering that is it possible to send hex data directly to the device to trigger the flash process?

0 Kudos

1,263 Views
jingpan
NXP TechSupport
NXP TechSupport

It sounds too difficult.

0 Kudos