How does blhost cut build files

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

How does blhost cut build files

1,900 次查看
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?
标记 (1)
0 项奖励
回复
3 回复数

1,745 次查看
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 项奖励
回复

1,745 次查看
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 项奖励
回复

1,745 次查看
jingpan
NXP TechSupport
NXP TechSupport

It sounds too difficult.

0 项奖励
回复