This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2642R: OAD Not Successful using BTool

Part Number: CC2642R
Other Parts Discussed in Thread: UNIFLASH, , CC1352R

Hello, 

I am trying to implement the simple_peripheral_oad_onchip example on a CC2642 Launchpad. For reference, my SDK is: simplelink_cc13x2_26x2_sdk_3_40_00_02 and I am using CCS 10.1.1.00004 

Here are the steps I have followed:

1. First imported BIM into my workspace by importing it from: C:\ti\simplelink_cc13x2_26x2_sdk_3_40_00_02\examples\nortos\CC26X2R1_LAUNCHXL\bim\bim_onchip\ccs
2. Flashed BIM onto the launchpad by clicking the "Flash" button in CCS
3. Imported the simple_peripheral_oad_onchip example from: C:\ti\simplelink_cc13x2_26x2_sdk_3_40_00_02\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\simple_peripheral_oad_onchip
4. Built and flashed the example code onto the launchpad by clicking the "Debug" button in CCS
5. At this point I can verify that I see it advertising it over bluetooth using a mobile app
6. I then use a different computer that is connected to a separate launchpad running "host_test", which was flashed using Uniflash with the hex file located at C:\ti\simplelink_cc13x2_26x2_sdk_3_40_00_02\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\hexfiles\host_test_app.hex
7. In BTool, I do a scan, and then establish a connection to the correct device (I observe the BLE address using the mobile app) (I also wait for the connection update request to occur)
8. I go to the OAD tab, click "Read Image File" and browse to the following bin file: workspace_v10\simple_peripheral_oad_onchip_app_CC26X2R1_LAUNCHXL_tirtos_ccs\Debug\simple_peripheral_oad_onchip_app_CC26X2R1_LAUNCHXL_tirtos_ccs_Debug_oad.bin
9. I then click "send"

During the start up process, it gets disconnected, reconnects, and then tells me "OAD Download Not Successful". The following are the messages that occur in BTool after I hit the "send" button:

--------------------------------------------------------------------
[119] : <Info> - 01:44:29.458
OAD - Update Connection Settings
--------------------------------------------------------------------
[120] : <Info> - 01:44:29.465
Start OAD Download
--------------------------------------------------------------------
[121] : <Info> - 01:44:29.467
StartReset Service Discovery
--------------------------------------------------------------------
[122] : <Info> - 01:44:29.469
OAD Send UUID Discovery
--------------------------------------------------------------------
[123] : <Tx> - 01:44:29.462
-Type : 0x01 (Command)
-OpCode : 0x2016 (HCI_LEReadRemoteUsedFeatures)
-Data Length : 0x02 (2) byte(s)
Handle : 0x0000 (0)
Dump(Tx):
0000:01 16 20 02 00 00 .. ...
--------------------------------------------------------------------
[124] : <Tx> - 01:44:29.478
-Type : 0x01 (Command)
-OpCode : 0xFD86 (GATT_DiscPrimaryServiceByUUID)
-Data Length : 0x12 (18) byte(s)
ConnHandle : 0x0000 (0)
Value : 00:00:00:00:00:00:00:B0:00:40:51:04:D0:FF:00:F0
Dump(Tx):
0000:01 86 FD 12 00 00 00 00 00 00 00 00 00 B0 00 40 ...............@
0010:51 04 D0 FF 00 F0 Q.....
--------------------------------------------------------------------
[125] : <Rx> - 01:44:29.493
-Type : 0x04 (Event)
-EventCode : 0x003E (HCI_LE_GenericReportEvent)
-Data Length : 0x0C (12) bytes(s)
LE Event Code : 0x04 (4) (HCI_LE_ReadRemoteUsedFeaturesCompleteEvent)
LE Event Code : 0x04 (4) (HCI_LE_ReadRemoteUsedFeaturesCompleteEvent)
Status : 0x00 (0) (SUCCESS)
ConnectionId : 0x0000 (0)
Features : 0x00000000000059FF (23039) (
Encryption
Connection_Parameters_Request
Reject_Extended_Indication
Slave_Features_Exchange
Ping
Data_Packet_Length_Extension
Privacy
Extended_Scanner_Filter_Policies
PHY_2M
Coded_PHY
Extended_Advertising
Channel_Selection_Algorithm_2)
Dump(Rx):
0000:04 3E 0C 04 00 00 00 FF 59 00 00 00 00 00 00 .>......Y......
--------------------------------------------------------------------
[126] : <Rx> - 01:44:29.509
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (0) (SUCCESS)
OpCode : 0xFD86 (GATT_DiscPrimaryServiceByUUID)
DataLength : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 86 FD 00 .........
--------------------------------------------------------------------
[127] : <Rx> - 01:44:30.967
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x0A (10) bytes(s)
Event : 0x0507 (1287) (ATT_FindByTypeValueRsp)
Status : 0x00 (0) (SUCCESS)
ConnHandle : 0x0000 (0)
PduLen : 0x04 (4)
Handle : 31:00
Handle : FF:FF
Dump(Rx):
0000:04 FF 0A 07 05 00 00 00 04 31 00 FF FF .........1...
--------------------------------------------------------------------
[128] : <Info> - 01:44:30.972
OAD Send UUID Info Discovery
--------------------------------------------------------------------
[129] : <Rx> - 01:44:32.957
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x0507 (1287) (ATT_FindByTypeValueRsp)
Status : 0x1A (26) (bleProcedureComplete)
ConnHandle : 0x0000 (0)
PduLen : 0x00 (0)
Dump(Rx):
0000:04 FF 06 07 05 1A 00 00 00 .........
--------------------------------------------------------------------
[130] : <Tx> - 01:44:32.957
-Type : 0x01 (Command)
-OpCode : 0xFE11 (GAP_UpdateLinkParamReq)
-Data Length : 0x0A (10) byte(s)
ConnHandle : 0x0000 (0)
IntervalMin : 0x0006 (6)
IntervalMax : 0x0006 (6)
ConnLatency : 0x0000 (0)
ConnTimeout : 0x0032 (50)
Dump(Tx):
0000:01 11 FE 0A 00 00 06 00 06 00 00 00 32 00 ............2.
--------------------------------------------------------------------
[131] : <Tx> - 01:44:32.972
-Type : 0x01 (Command)
-OpCode : 0xFD84 (GATT_DiscAllCharDescs)
-Data Length : 0x06 (6) byte(s)
ConnHandle : 0x0000 (0)
StartHandle : 0x0031 (49)
EndHandle : 0xFFFF (65535)
Dump(Tx):
0000:01 84 FD 06 00 00 31 00 FF FF ......1...
--------------------------------------------------------------------
[132] : <Rx> - 01:44:33.004
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (0) (SUCCESS)
OpCode : 0xFE11 (GAP_UpdateLinkParamReq)
DataLength : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 11 FE 00 .........
--------------------------------------------------------------------
[133] : <Rx> - 01:44:33.036
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (0) (SUCCESS)
OpCode : 0xFD84 (GATT_DiscAllCharDescs)
DataLength : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 84 FD 00 .........
--------------------------------------------------------------------
[134] : <Rx> - 01:44:34.973
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x0F (15) bytes(s)
Event : 0x0505 (1285) (ATT_FindInfoRsp)
Status : 0x00 (0) (SUCCESS)
ConnHandle : 0x0000 (0)
PduLen : 0x09 (9)
Format : 0x01 (1) (HANDLE_BT_UUID_TYPE__handles_and_16_bit_Bluetooth_UUIDs)
Handle : 0031
Uuid : 00:28
Handle : 0032
Uuid : 03:28
Dump(Rx):
0000:04 FF 0F 05 05 00 00 00 09 01 31 00 00 28 32 00 ..........1..(2.
0010:03 28 .(
--------------------------------------------------------------------
[135] : <Rx> - 01:44:36.968
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x19 (25) bytes(s)
Event : 0x0505 (1285) (ATT_FindInfoRsp)
Status : 0x00 (0) (SUCCESS)
ConnHandle : 0x0000 (0)
PduLen : 0x13 (19)
Format : 0x02 (2) (HANDLE_UUID_TYPE__handles_and_128_bit_UUIDs)
Handle : 0033
Uuid : 00:00:00:00:00:00:00:B0:00:40:51:04:D1:FF:00:F0

Dump(Rx):
0000:04 FF 19 05 05 00 00 00 13 02 33 00 00 00 00 00 ..........3.....
0010:00 00 00 B0 00 40 51 04 D1 FF 00 F0 .....@Q.....
--------------------------------------------------------------------
[136] : <Rx> - 01:44:38.971
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x0B (11) bytes(s)
Event : 0x0505 (1285) (ATT_FindInfoRsp)
Status : 0x00 (0) (SUCCESS)
ConnHandle : 0x0000 (0)
PduLen : 0x05 (5)
Format : 0x01 (1) (HANDLE_BT_UUID_TYPE__handles_and_16_bit_Bluetooth_UUIDs)
Handle : 0034
Uuid : 01:29
Dump(Rx):
0000:04 FF 0B 05 05 00 00 00 05 01 34 00 01 29 ..........4..)
--------------------------------------------------------------------
[137] : <Rx> - 01:44:40.956
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x0505 (1285) (ATT_FindInfoRsp)
Status : 0x1A (26) (bleProcedureComplete)
ConnHandle : 0x0000 (0)
PduLen : 0x00 (0)
Dump(Rx):
0000:04 FF 06 05 05 1A 00 00 00 .........
--------------------------------------------------------------------
[138] : <Info> - 01:44:40.964
OAD Invalidate Image On StartReset
--------------------------------------------------------------------
[139] : <Tx> - 01:44:40.967
-Type : 0x01 (Command)
-OpCode : 0xFD96 (GATT_WriteLongCharValue)
-Data Length : 0x07 (7) byte(s)
ConnHandle : 0x0000 (0)
Handle : 0x0033 (51)
Offset : 0x0000 (0)
Value : 01
Dump(Tx):
0000:01 96 FD 07 00 00 33 00 00 00 01 ......3....
--------------------------------------------------------------------
[140] : <Rx> - 01:44:41.003
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (0) (SUCCESS)
OpCode : 0xFD96 (GATT_WriteLongCharValue)
DataLength : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 96 FD 00 .........
--------------------------------------------------------------------
[141] : <Rx> - 01:44:44.962
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x0519 (1305) (ATT_ExecuteWriteRsp)
Status : 0x00 (0) (SUCCESS)
ConnHandle : 0x0000 (0)
PduLen : 0x00 (0)
Dump(Rx):
0000:04 FF 06 19 05 00 00 00 00 .........
--------------------------------------------------------------------
[142] : <Info> - 01:44:44.969
Waiting For Device Reset
--------------------------------------------------------------------
[143] : <Rx> - 01:44:47.970
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x0B (11) bytes(s)
Event : 0x0607 (1543) (GAP_LinkParamUpdate)
Status : 0x00 (0) (SUCCESS)
ConnHandle : 0x0000 (0)
ConnInterval : 0x0006 (6)
ConnLatency : 0x0000 (0)
ConnTimeout : 0x0032 (50)
Dump(Rx):
0000:04 FF 0B 07 06 00 00 00 06 00 00 00 32 00 ............2.
--------------------------------------------------------------------
[144] : <Info> - 01:44:49.460
Device Disconnected
Handle = 0x0000
Addr Type = 0x01 (ADDRTYPE_RANDOM)
BDAddr = 7D:B7:51:96:F2:4E
--------------------------------------------------------------------
[145] : <Rx> - 01:44:49.459
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x0606 (1542) (GAP_TerminateLink)
Status : 0x00 (0) (SUCCESS)
ConnHandle : 0x0000 (0)
Reason : 0x08 (8) (SUPERVISION_TIMEOUT_TERM)
Dump(Rx):
0000:04 FF 06 06 06 00 00 00 08 .........
--------------------------------------------------------------------
[146] : <Info> - 01:44:59.973
Establish Connection
--------------------------------------------------------------------
[147] : <Tx> - 01:44:59.976
-Type : 0x01 (Command)
-OpCode : 0xFE62 (GapInit_connect)
-Data Length : 0x0A (10) byte(s)
PeerAddrType : 0x01 (1) (PEER_ADDRTYPE_RANDOM_OR_RANDOM_ID)
PeerAddr : 7D:B7:51:96:F2:4E
InitiatingPhy : 0x01 (1) (
INIT_PHY_1M)
Timeout : 0x0000 (0)
Dump(Tx):
0000:01 62 FE 0A 01 4E F2 96 51 B7 7D 01 00 00 .b...N..Q.}...
--------------------------------------------------------------------
[148] : <Rx> - 01:45:00.003
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (0) (SUCCESS)
OpCode : 0xFE62 (GapInit_connect)
DataLength : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 62 FE 00 ......b..
--------------------------------------------------------------------
[149] : <Error> - 01:45:39.987
OAD Operation Timed Out
Operation Name = GAP_EstablishLink_OadReset
--------------------------------------------------------------------
[150] : <Info> - 01:45:39.990
OAD - Restore Connection Settings
--------------------------------------------------------------------
[151] : <Error> - 01:45:39.992
OAD Download Not Successful
--------------------------------------------------------------------

Can anyone tell me what I'm doing wrong?

Any and all help is appreciated, thanks!

  • Hi,

    Thank you for reaching out. In general, we recommend you use the newer SDK version.

    The "issue" seems to be caused by a connection termination (due to supervision timeout) - see packet 145.

    I hope this will help,

    Regards,

  • Hi Clement,

    I've updated my SDK to the latest version with CCS compiler and I'm getting the exact same results.

    Do you know what would cause a supervision timeout during OAD?

    Also, am I combining the BIM and application the correct way? I just flash the BIM project (default configuration) and then subsequently flash the simpleperipheral_oad project? Do I not need to specify the locations to flash to?

    Thank you again for your help,

    James

  • Hi James,

    I have not done BTool OAD with CC2642R. But, I have done BTool OAD with CC260R2F. You need to select the Run_Btool in the folder not the btool.

    -kel

  • Hi,

    @Markel, thank you for your contribution. However, please let me point that the remark below is incorrect for CC2642R devices.

    You need to select the Run_Btool in the folder not the btool.

    Actually,"btool.exe" should be used when the device runs host_test compiled with the BLE5Stack. If the device runs host_test compiled with the BLEStack, then "Run_BTool.bat" should be used.
    For CC2642R, only the BLE5Stack is available, so "btool.exe" should always be used.

    @James, the supervision timeout comes from the absence of reception of valid connection packet for a given time.The question is then, what causes such absence of reception?

    - it could be some interference. Here the connection timeout seems to be only 2 seconds - which is small but ok for testing in a not too busy environment. You can try to increase the connection timeout value to make sure this is not the issue.

    - it could be because one device hangs. To check this, I would recommend to use the debug mode on the peripheral side:https://dev.ti.com/tirex/content/simplelink_cc13xx_cc26xx_sdk_6_30_00_84/docs/ble5stack/ble_user_guide/html/ble-stack-5.x-guide/debugging-index.html

    Here are some tests that may help identifying the issue:

    To finish, the issue occurs before the device receives the updated image (i.e. before it is supposed to reboot). So the BIM should not have any impact for the moment.

    I hope this will help,

    Regards,

  • Thank you Clement and Markel for the assistance.

    As a side note, I tried running with the "Run_Btool.bat" and got the same results.

    I have also tried increasing the connection timeout time to 20 seconds and still get the same results.

    It looks like the launchpad that is being programmed over the air is indeed hanging. I say this because around the time I see the "supervision timeout" message, the red LED on the launchpad being programmed turns on. Even after resetting power to this launchpad the red LED (DIO6) stays stuck on and the board is no longer able to broadcast over BLE until I reflash the BIM and application.

    I double checked my configurations and the BIM is "Debug_unsecured" and the application is "Debug". I verified this by clicking each project in the project explorer and it has some text at the end of the project name that reads "[Active - Debug]".

    I'm also noticing that in the OAD panel on Btool there is a "general" section that has a checkbox for "Secure". It does not allow me to uncheck this box, is this saying that it wants the secure BIM?

    Any other ideas why the unedited example is hanging during OAD would be appreciated, thank you!

  • Hi James,

    I just had a successful OAD using btool. But using 2 x CC1352R Launchpad and SDKv6.20.

    I don't have 2 x CC26x2R1 Launchpad to exactly duplicate your issue. SDKv3.40 is old SDK version. Why do you use it? Also, at btool if you select the wrong Slave BDA address you will probably get the supervision timeout error.

    -kel

  • Thank you for the response, Markel.

    I forgot to mention that I have updated to the latest SDK (v6.3), and am still seeing this issue.

    I am fairly certain I'm connecting to the correct slave address, as the OAD procedure is changing something on the target launchpad. It is causing the target launchpad to hang and won't boot correctly until I reflash everything with the programmer.

    Markel, on the OAD tab when you hit "Read Image File", are you choosing the .bin file that sits in the Release folder? This is the .bin file that is generated by CCS when you build, correct?

  • Markel, on the OAD tab when you hit "Read Image File", are you choosing the .bin file that sits in the Release folder? This is the .bin file that is generated by CCS when you build, correct?

    Yes.

    If you are using SDKv6.30 should be the same procedure as I did. Details below.

    1. Flash one of your CC26x2R1 launchpad with host_test.hex from "C:\ti\simplelink_cc13xx_cc26xx_sdk_6_20_00_29\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\hexfiles". This launchpad needs to be connected to your PC with btool.

    2. The other CC26x2R1 launchpad you need to flash with cc26x2r1lp_bim_onchip.hex which can be found in C:\ti\simplelink_cc13xx_cc26xx_sdk_6_20_00_29\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\hexfiles\bim_onchip\Release

    3. Then flash the same launchpad with the bin file of the Simple Peripheral on chip example program should be in the release folder. If you use the hex file most likely it won't advertise. Check first using IOS LightBlue App or nRF Connect App if the board is advertising

    For flashing you can use Uniflash. The BLE Slave Address you can see at nRF Connect App. You should be able to see the same BLE Slave Address at btool when you discover.

    Here is my CCS project what I did earlier I build the bim off chip and simple peripheral off chip example programs.

    -kel

  • Hi Markel,

    I am confused about something:

    In your screenshot I can see that you imported the BIM project from the "nortos" folder. However, you say in step #2 that you are using Uniflash to flash over the BIM hex file found in the "rtos" folder.

    Does the BIM project in your project explorer not serve a purpose?

  • I am confused about something:

    In your screenshot I can see that you imported the BIM project from the "nortos" folder. However, you say in step #2 that you are using Uniflash to flash over the BIM hex file found in the "rtos" folder.

    Does the BIM project in your project explorer not serve a purpose?

    Yes you are right. You can do either should work also.

    I just imported the bim off chip just in case I would need to debug the bim. But mostly you do not need to modify the bim. If you build the bim in your ccs workspace it will also generate a bim hex file.

    -kel

  • Alright, so I'm not sure why, but the process that is on the user guide (as well as the process that Markel has described) doesn't seem to work for the CC26X2.

    But, I did finally get it to work by doing a different process:

    1. Build and flash (using CCS) the "Persistent App" found here: C:\ti\simplelink_cc13xx_cc26xx_sdk_6_30_01_03\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\persistent_app

    2. Flash the .bin file of your project (in this case it is the simple_peripheral_oad_onchip) using UNIFLASH

    3. Build and flash the BIM using CCS

    Using this process, I was then able to flash something over using BTool. 

    I guess I needed to flash over the persistent app. Maybe this worked for Markel because he had previously flashed over the persistent app and it stayed untouched in some location in memory throughout subsequent code flashes?

    Thank you all, hope this helps others.

  • I did Off chip OAD so I did not need the persistent app. Good to know you made it to work.

    -kel