基于TI的Firmware Update固件升级的流程分析usb appliction layers的数据
USB Protocol Package
①/② map to check password correct
Package Format:
Byte[0] = Report Id
Byte[1] = Valid Length (0x21 = 33)
Byte[2] = BSL Core Commands(0x11 RX Password)
Byte[3] = Valid Data (0xFF)...
Byte[Byte[1]+1] = Valid Data (0x00)
Byte[Byte[1]+2] = 0xAC...
Byte[63] = 0xAC (Full Length = 64)Interrupt Out: Host Transfer(Client Receive)
(Interrupt IN): Client Transfer(Host Receive)3F2111FF FFFFFFFF FFFFFFFF FFFFFFFF
FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
FF0000AC ACACACAC ACACACAC ACACACAC
ACACACAC ACACACAC ACACACAC ACACACAC3F2111FF FFFFFFFF FFFFFFFF FFFFFFFF
FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
FFFFFFAC ACACACAC ACACACAC ACACACAC
ACACACAC ACACACAC ACACACAC ACACACAC
③ map to download bsl program(bootloader)
TI provide the bsl program named RAM_BSL_xxx.txt,拆包后每48个字节进行组包发送
Package Format:
Byte[0] = Report Id
Byte[1] = Valid Length(0x34 = 52)
Byte[2] = BSL Core Commands(0x1B RX Data Block Fast)
Byte[3] = RAM_ADDRESS(0x00)
Byte[4] = RAM_ADDRESS(0x25)
Byte[5] = RAM_ADDRESS(0x00)
Byte[6] = Valid Data (0x00)
...
Byte[Byte[1]+1] = Valid Data(0x85)
Byte[Byte[1]+2] = 0xAC
...
Byte[63] = 0xAC3F341B00 25000008 0839B240 805A5C01
32C23140 9033B013 982CFF3F 12010002
00000008 47200002 09010000 00010600
FF0901A1 0185ACAC ACACACAC ACACACAC
下一组写入数据的RAM地址为0x002500 + 48 = 0x002530(30 2500)
3F341B30 25003F95 3F750825 01150109
01810285 3F953F75 08250115 01090191
02C00902 29000101 00803209 04000002
03000000 0921ACAC ACACACAC ACACACAC
④ map to load PC(usb reconnect)
⑤ map to send the BSL Version
⑥ map to write the firmware to flash
这里的firmware是指由固件编译后生成的.txt文件,数据格式如上,同样以48个字节拆分进行传输
3F341B00 80002A14 C80C4A48 5A0E3F40
AEA10F5A 5E4F0200 3A502224 1B4A0600
0B930420 8A430000 0C437D3C 5E0A3E50
88235D4E 0600ACAC ACACACAC ACACACAC
⑦ map to Software BOR Reset
⑧ map to load PC(usb reconnect)
详情见User’s Guide MSP430™ Flash Devices Bootloader (BSL)
BSL Mode - Firmware Update
这里的流程图只是大概流程,具体流程还得用usb分析仪进行抓包分析,如上章所示的几个步骤可实现固件升级