Android APP CC2640R2F OTA process

Copyright: Merry due share and eternity, knowledge sharing and immortal, I share my happiness ... https://blog.csdn.net/walter247443819/article/details/80336505

Android APP CC2640R2F OTA process

1. Mirror (bin file) Verify

A.
FFC1 write (10:00) to open the notification
ffc2 write (10:00) to open the notification
FFC 5 is written (10:00) to open the notification
sent CMD 01 (1byte) to ffc5, 3Byte returned (second byte is returns the need to modify the size mtu
OAD_BLOCK_SIZE)
the Get the OAD the Command Block size 0x01 0 None
the Get the OAD the Response Block size 0x01. 3 OAD_BLOCK_SIZE
B content header checksum:

OAD Image Identification Value
1. Whether the image is identified OAD CC2640R2F is 0x20474D492044414f (ASCII for 'OAD IMG') 2. Let OAD Target to quickly identify the legitimacy of the mirror.
The means for the BIM A 3.Provides to Find The Start of The Flash containing OAD Page Image for ON-Chip OAD
the BIM Version
the BIM determines the correct version
Image Header Version
verify correct image
Image Information
Providing detailed image about the state and type of OAD The message is below:

Image Length
total length of the mirror, the For the On-Chip the OAD, The size of Word The CC2640R2F IS fixed.is
defined by EFL_OAD_ADDR_RESOLUTION
Software Version
modify the application with the mirror and stack comprising

C. successful verification Mirror
image verification is successful returns a byte FFC1 (00 success), Start OAD ' command. Need to turn
OTA, FFC5. OAD Target success after opening into the configuration state, and returns cmd 12 and the desired a first
block number sequence number, then the first block starts sending the Target to the OAD
the start Process the OAD the Command 0x03 None 0
the start Process the OAD the Response Byte 0 0x03. 5: the Command ID (0x03) Byte 1-3: Block number The

2. The image transmission block

Ensure that the notice is opened
mirror Char block write response, the CMD (0x12)
Image Char the Write Block the Response Byte 0 0x12. 6: the Command ID (0x12) Byte. 1: The Previous Block receivedByte the Status of 2-5: Block Number

byte1 values:

The success of the transmission block returns, the first byte sent is the request FFC2 Block number
4. If the completion of downloading the entire file bin, OAD Target device and the response status code OAD_DL_COMPLETE Block
Number to 0xFFFFFFFF.
After 5.bin file download is complete, you receive OAD_DL_COMPLETE, need to send the OTA Target 0x04 for verification.
After successful authentication OTA Target will be burning, burn successfully 20s disconnects Bluetooth, reconnect
Enable OAD Image Command 0x04 0/4 LEN = 0: noneLEN = 4: Image type and image number of image to be downloaded

Enable OAD Image Response 0x04 2 Byte 0: Command ID (0x04)Byte 1: Return Status

3.OTA complete

   接收完整镜像像后,如果CRC匹配会跳转到‘End’状态。

The application then checks if there are more waiting to download the image. If so, the application will be returned to the mirror download status. If
there are no more image download, OAD Target will check whether the downloaded image should be copied to the internal flash.
If you have received enabled OAD Target command, the new image will be copied to the internal flash memory, the device will be reset. If not, mirroring the current resident will continue normally.

4.OTA timing diagram

http: //www.plantuml.com / plantuml / UML / fLHDJnD163upl 8zwg59CU7IM4AXHKaW6Dh4U2BJtIcTkDsjixEed0eHYX_b8nW eC6GKEI2U294GNwCdQNz5yxEbjrMOQFnqcpVZ TzdkUTcI6ROyQTae6mnkaivWHIvJAWYHUSPmcRfHg93NgHnF1u1fooZZb6HTEITTOiOQ1I89OFtSqJT_jKh1srZkP5hNhzxJF21WVRqJHYsmN700tR1A4 sH4Rj7reIEZMIzEmi0vvQYAPUXYB1JalH4ozhm_ff9TTCWbZ9kKK6tGESsgPa4mY1Jp9SRe3ILX2L9V4OTNICMAau1EM1Jc6PmX784wsHVtOhTV4kuFHqNGSUTD0LYA4Ud1YWs6R5FkZ8glxGIpjYCL6kreJQwTY_RBv_R1rjISZaxcKUtmWBbRlC220acm3L9tQccMQHEF8rnp1e7Msw6wTYRKLz s6k91aHkA YERv Ltd tAxlMdHc _jBKBW3E7_8uVPYNU03mY72PJQHWsBEqvPEaSWH6hLCBIe969DCHVnVkZ9dIrJH6xR9as2ViYfCdP_MhkM4d XyV4gr0 fz0LRo0gU4mqcskDFOFGhsu8PDEMpIF0SXop7mNdZ3BQxYn84gvJzpN_vHHBdKNCGjcAorvbGt9HnDve2Zumgr2mIOIu3Nm8kdWc4ufJnWWOjWteOu_KJp_0lYU7-o-QX2_3zxvH6hQhKlvr twUEf5ONIco96ut0XQt9M6MDr2uii7HQbviTkw YZszf54cKwDJsLIwMVJsLngAfT98t6quExNc Srxo5QtcdNA_8jGlA2kfjVnUfwkpAlG7vM5jH5zqP67vc1yCZSDa kyhPuX04P4-SD4bWGt2a6A2ZgRe04IAPtvi97mr-79NV7_kimgLqCoH-dPFm2

5.http://software-dl.ti.com/lprf/simplelink_cc2640r2_latest/docs/blestack/ble_user_guide/html/ble-stack-3.x-guide/reference.html
TI 官方OTA 介绍

Guess you like

Origin blog.csdn.net/walter247443819/article/details/80336505