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.

RTOS/CC2640R2F: OAD not functioning anymore

Part Number: CC2640R2F

Tool/software: TI-RTOS

Hi,

We have made a software with OAD functioning  we have been usingthe Simpleling SDK 1.50.58 for this.

Right now we are experiencing that the OAD has started failing.  We get timeout after the first block is written to the Chip.

This has been working before, even OAD with the binfiles we have used successfulyl before has stopped working.

We have tried reinstalling CCS, SDKs, compilers and XDC tools, but nothing is helping.

Have you got any idea on what we can try next?

[534] : <Info> - 06:10:38.443
OAD Send Start OAD To ImageControl
--------------------------------------------------------------------
[535] : <Tx> - 06:10:38.443
-Type           : 0x01 (Command)
-OpCode         : 0xFDB6 (GATT_WriteNoRsp)
-Data Length    : 0x05 (5) byte(s)
 ConnHandle     : 0x0000 (0)
 Handle         : 0x0041 (65)
 Value          : 03
Dump(Tx):
0000:01 B6 FD 05 00 00 41 00 03                      ......A..
--------------------------------------------------------------------
[536] : <Rx> - 06:10:38.482
-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         : 0xFDB6 (GATT_WriteNoRsp)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 B6 FD 00                      .........
--------------------------------------------------------------------
[537] : <Rx> - 06:10:38.502
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x0E (14) bytes(s)
 Event          : 0x051B (1307) (ATT_HandleValueNotification)
 Status         : 0x00 (0) (SUCCESS)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x08 (8)
 Handle         : 0x0041 (65)
 Value          : 12:00:00:00:00:00
Dump(Rx):
0000:04 FF 0E 1B 05 00 00 00 08 41 00 12 00 00 00 00 .........A......
0010:00                                              .
--------------------------------------------------------------------
[538] : <Tx> - 06:10:38.502
-Type           : 0x01 (Command)
-OpCode         : 0xFDB6 (GATT_WriteNoRsp)
-Data Length    : 0xF8 (248) byte(s)
 ConnHandle     : 0x0000 (0)
 Handle         : 0x003D (61)
 Value          : 00:00:00:00:4F:41:44:20:49:4D:47:20:D4:A6:0B:74:
                  01:01:FE:00:FF:FF:01:01:FF:FF:FF:FF:35:1B:01:00:
                  50:00:00:00:30:30:30:31:34:1B:01:00:2C:00:FF:FF:
                  00:FE:00:FF:18:00:00:00:00:40:01:00:01:C0:01:00:
                  20:05:00:20:68:3C:00:20:01:FE:00:FF:F1:1A:01:00:
                  00:00:00:00:68:3C:00:20:E1:E0:00:00:01:C9:01:10:
                  01:C9:01:10:01:C9:01:10:01:C9:01:10:01:C9:01:10:
                  01:C9:01:10:01:C9:01:10:01:C9:01:10:01:C9:01:10:
                  01:C9:01:10:01:C9:01:10:01:C9:01:10:3F:C9:01:10:
                  FF:FF:FF:FF:AF:48:2D:E9:F0:4F:0A:26:AD:F1:6C:0D:
                  00:25:00:68:AC:4C:02:90:BD:48:10:96:00:68:14:96:
                  2F:46:04:90:4F:F0:01:08:11:97:04:F1:68:00:13:97:
                  04:F1:20:0B:8D:F8:04:50:00:F1:41:01:03:91:B5:49:
                  CD:F8:48:80:86:1D:09:68:B4:4B:05:91:B2:49:15:96:
                  99:46:06:91:56:30:16:90:16:31:07:91:4F:F4:61:61:
                  08:91:29:46
Dump(Tx):
0000:01 B6 FD F8 00 00 3D 00 00 00 00 00 4F 41 44 20 ......=.....OAD 
0010:49 4D 47 20 D4 A6 0B 74 01 01 FE 00 FF FF 01 01 IMG ...t........
0020:FF FF FF FF 35 1B 01 00 50 00 00 00 30 30 30 31 ....5...P...0001
0030:34 1B 01 00 2C 00 FF FF 00 FE 00 FF 18 00 00 00 4...,...........
0040:00 40 01 00 01 C0 01 00 20 05 00 20 68 3C 00 20 .@...... .. h<. 
0050:01 FE 00 FF F1 1A 01 00 00 00 00 00 68 3C 00 20 ............h<. 
0060:E1 E0 00 00 01 C9 01 10 01 C9 01 10 01 C9 01 10 ................
0070:01 C9 01 10 01 C9 01 10 01 C9 01 10 01 C9 01 10 ................
0080:01 C9 01 10 01 C9 01 10 01 C9 01 10 01 C9 01 10 ................
0090:01 C9 01 10 3F C9 01 10 FF FF FF FF AF 48 2D E9 ....?........H-.
00A0:F0 4F 0A 26 AD F1 6C 0D 00 25 00 68 AC 4C 02 90 .O.&..l..%.h.L..
00B0:BD 48 10 96 00 68 14 96 2F 46 04 90 4F F0 01 08 .H...h../F..O...
00C0:11 97 04 F1 68 00 13 97 04 F1 20 0B 8D F8 04 50 ....h..... ....P
00D0:00 F1 41 01 03 91 B5 49 CD F8 48 80 86 1D 09 68 ..A....I..H....h
00E0:B4 4B 05 91 B2 49 15 96 99 46 06 91 56 30 16 90 .K...I...F..V0..
00F0:16 31 07 91 4F F4 61 61 08 91 29 46             .1..O.aa..)F
--------------------------------------------------------------------
[539] : <Rx> - 06:10:38.554
-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         : 0xFDB6 (GATT_WriteNoRsp)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 B6 FD 00                      .........
--------------------------------------------------------------------
[540] : <Rx> - 06:10:48.573
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x0E (14) bytes(s)
 Event          : 0x051B (1307) (ATT_HandleValueNotification)
 Status         : 0x00 (0) (SUCCESS)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x08 (8)
 Handle         : 0x0041 (65)
 Value          : 12:00:01:00:00:00
Dump(Rx):
0000:04 FF 0E 1B 05 00 00 00 08 41 00 12 00 01 00 00 .........A......
0010:00                                              .
--------------------------------------------------------------------
[541] : <Tx> - 06:10:48.573
-Type           : 0x01 (Command)
-OpCode         : 0xFDB6 (GATT_WriteNoRsp)
-Data Length    : 0xF8 (248) byte(s)
 ConnHandle     : 0x0000 (0)
 Handle         : 0x003D (61)
 Value          : 01:00:00:00:09:91:4F:F4:96:61:0A:91:29:46:0B:91:
                  3C:21:0C:91:29:46:0D:91:A9:4F:0E:91:46:46:0F:91:
                  DE:E3:02:2E:00:F0:A6:83:03:2E:00:F0:88:83:05:2E:
                  00:F0:7D:83:0D:2E:00:F0:6F:83:04:2E:00:F0:02:83:
                  06:2E:00:F0:C0:82:07:2E:0F:F2:FC:2A:00:F0:88:82:
                  08:2E:00:F0:11:82:0A:2E:00:F0:D9:81:0E:2E:00:F0:
                  C8:81:0B:2E:00:F0:B2:81:43:2E:00:F0:89:81:40:2E:
                  00:F0:6E:81:42:2E:00:F0:25:81:C0:48:00:68:15:2E:
                  00:F0:F4:80:13:2E:00:F0:E9:80:02:98:12:2E:00:F0:
                  D2:80:48:2E:00:F0:C9:80:89:2E:40:F0:C4:80:06:F0:
                  BF:FC:01:28:02:D0:13:20:05:F0:2C:FC:0E:F0:12:FC:
                  87:F8:12:80:40:46:07:F0:6F:FB:AA:46:0E:F0:0A:FC:
                  14:E0:21:20:0D:F0:46:FC:F8:7C:01:28:14:BF:09:20:
                  40:46:07:F0:61:FB:04:98:19:99:00:F0:95:FC:0E:F0:
                  F9:FB:97:F8:2A:60:0E:B1:06:F0:CA:FF:F8:79:00:28:
                  E7:D0:40:46
Dump(Tx):
0000:01 B6 FD F8 00 00 3D 00 01 00 00 00 09 91 4F F4 ......=.......O.
0010:96 61 0A 91 29 46 0B 91 3C 21 0C 91 29 46 0D 91 .a..)F..<!..)F..
0020:A9 4F 0E 91 46 46 0F 91 DE E3 02 2E 00 F0 A6 83 .O..FF..........
0030:03 2E 00 F0 88 83 05 2E 00 F0 7D 83 0D 2E 00 F0 ..........}.....
0040:6F 83 04 2E 00 F0 02 83 06 2E 00 F0 C0 82 07 2E o...............
0050:0F F2 FC 2A 00 F0 88 82 08 2E 00 F0 11 82 0A 2E ...*............
0060:00 F0 D9 81 0E 2E 00 F0 C8 81 0B 2E 00 F0 B2 81 ................
0070:43 2E 00 F0 89 81 40 2E 00 F0 6E 81 42 2E 00 F0 C.....@...n.B...
0080:25 81 C0 48 00 68 15 2E 00 F0 F4 80 13 2E 00 F0 %..H.h..........
0090:E9 80 02 98 12 2E 00 F0 D2 80 48 2E 00 F0 C9 80 ..........H.....
00A0:89 2E 40 F0 C4 80 06 F0 BF FC 01 28 02 D0 13 20 ..@........(... 
00B0:05 F0 2C FC 0E F0 12 FC 87 F8 12 80 40 46 07 F0 ..,.........@F..
00C0:6F FB AA 46 0E F0 0A FC 14 E0 21 20 0D F0 46 FC o..F......! ..F.
00D0:F8 7C 01 28 14 BF 09 20 40 46 07 F0 61 FB 04 98 .|.(... @F..a...
00E0:19 99 00 F0 95 FC 0E F0 F9 FB 97 F8 2A 60 0E B1 ............*`..
00F0:06 F0 CA FF F8 79 00 28 E7 D0 40 46             .....y.(..@F
--------------------------------------------------------------------
[542] : <Rx> - 06:10:48.633
-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         : 0xFDB6 (GATT_WriteNoRsp)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 B6 FD 00                      .........
--------------------------------------------------------------------
[543] : <Info> - 06:10:48.662
OAD ImageControl Response
Command ID = 0x12 (ImageBlockWriteRsp)
Status = 0x05 (OAD_NOT_STARTED)
--------------------------------------------------------------------
[544] : <Rx> - 06:10:48.662
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x0E (14) bytes(s)
 Event          : 0x051B (1307) (ATT_HandleValueNotification)
 Status         : 0x00 (0) (SUCCESS)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x08 (8)
 Handle         : 0x0041 (65)
 Value          : 12:05:00:00:00:00
Dump(Rx):
0000:04 FF 0E 1B 05 00 00 00 08 41 00 12 05 00 00 00 .........A......
0010:00                                              .
--------------------------------------------------------------------
[545] : <Error> - 06:10:48.662
OAD Download Failed
--------------------------------------------------------------------
[546] : <Info> - 06:10:48.662
OAD - Restore Connection Settings
--------------------------------------------------------------------
[547] : <Error> - 06:10:48.662
OAD Download Not Successful
--------------------------------------------------------------------
[548] : <Tx> - 06:10:48.662
-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                               .. ...
--------------------------------------------------------------------
[549] : <Rx> - 06:10:48.713
-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       : 0x00000000000000FD (253) (
                  Encryption
                  Reject_Extended_Indication
                  Slave_Features_Exchange
                  Ping
                  Data_Packet_Length_Extension
                  Privacy
                  Extended_Scanner_Filter_Policies)
Dump(Rx):
0000:04 3E 0C 04 00 00 00 FD 00 00 00 00 00 00 00    .>.............
--------------------------------------------------------------------
[550] : <Tx> - 06:10:48.713
-Type           : 0x01 (Command)
-OpCode         : 0xFE11 (GAP_UpdateLinkParamReq)
-Data Length    : 0x0A (10) byte(s)
 ConnHandle     : 0x0000 (0)
 IntervalMin    : 0x0050 (80)
 IntervalMax    : 0x0050 (80)
 ConnLatency    : 0x0000 (0)
 ConnTimeout    : 0x07D0 (2000)
Dump(Tx):
0000:01 11 FE 0A 00 00 50 00 50 00 00 00 D0 07       ......P.P.....
--------------------------------------------------------------------
[551] : <Rx> - 06:10:48.743
-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                      .........
--------------------------------------------------------------------
[552] : <Rx> - 06:10:48.833
-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   : 0x0050 (80)
 ConnLatency    : 0x0000 (0)
 ConnTimeout    : 0x07D0 (2000)
Dump(Rx):
0000:04 FF 0B 07 06 00 00 00 50 00 00 00 D0 07       ........P.....
--------------------------------------------------------------------

Best regards

Viggo

  • Hi Viggo,
    I'm assigning this thread to one of our OAD experts. Stay tuned for an answer. Meanwhile, any chance you have a sniffer capture as well?
  • Hi Viggo,

    Do you know what might have changed from when the OAD was successful?

    Please attach a full BTool log to your reply so I may assist better.

    Regards,
    Yuval

  • Hi, I will post the sniffer log during today

    Best regards,
    Viggo
  • Hi,

    I updated the CCS to newer version before the problems started happening. But we reinstalled everything back to the old versions to make sure that there was no difference from the last build.

    The strange thing is that this is happening with the old software, and the app_image that we built with the previous setup. We have done a lot of OAD tests with this app_image(bin file) and old firmware, and it has worked fine earlier. But when we test it in BTool now, we get this error.

    I will attach a btool log later, together with the sniffer log.

    Best regards,
    Viggo

  • Hi,

    Please find full Btool log:

    This time the first OAD completed successfully, but the second failed, and it failes every time from here on.

    I'm thinking this could be some problem with storage in flash? NV or external

    Is there image data somewhere that should be removed before a new OAD can be done?

    Best regards

    Viggo

    1581.btoollog.txt

  • Hi Viggo,

    Thanks for sending the full log!

    I believe that what happens is a connection inactivity timeout because of the time that separates the 2 commands in the BTool log. The time is almost precisely 10s which is the OAD default timeout:

    --------------------------------------------------------------------
    [1035] : <Rx> - 10:55:22.558
    -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         : 0xFDB6 (GATT_WriteNoRsp)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 B6 FD 00                      .........
    --------------------------------------------------------------------
    [1036] : <Rx> - 10:55:32.468
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x0E (14) bytes(s)
     Event          : 0x051B (1307) (ATT_HandleValueNotification)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x08 (8)
     Handle         : 0x0041 (65)
     Value          : 12:00:01:00:00:00
    Dump(Rx):
    0000:04 FF 0E 1B 05 00 00 00 08 41 00 12 00 01 00 00 .........A......
    0010:00                                              .
    --------------------------------------------------------------------

    To verify this theory, I would suggest debugging oadInactivityTimeout.

    The thing is, since you are successfully managing a single OAD download and therefore resetting the device, when the device will reset, the connection to the debugger will be lost and the breakpoint lost.

    What you can try to do to still catch this is to add a led flash inside this function (that should never be reached).

    This would verify that the timeout is what is causing the OAD to fail the second time around.

    If we go even one step back to what could be causing this timeout, my best guess would be that the connectionParamsUpdate didn't go through the second time you tried the OAD and so the timeout did not get updated before you started the OAD process. To eliminate this cause, all it would require is for you to replicate your scenario again but this time, after the first successful OAD, wait a couple of seconds for the connection parameter update event notification to be shown on the BTool log before you start the OAD the second time.

    It would  be super informative if you have any sniffer logs to verify this.

    Best Regards,
    Yuval

  • Hi all,

    Thank you for the help, we figured it out:

    EFL_PAGE_SIZE in ext_flash_layout.c had the wrong size, this bug had snuck in and size was defined as only 0x100. Correcting to correct page size fixed problem.

    The problem appeared after the first OAD

    // Page size
    #define EFL_PAGE_SIZE 0x1000

    Best regards
    Viggo
  • Great! Thank you for the info. We had a problem with the flash page size, which had snuck in during updating of the board files to fit a custom board.

    After updating to correct info, I think all data was where it was supposed to be, flash was empty where it should be or crash in handling ext flash did not happen. Have to look more into exactly what happened. But all is working as it should now

    I guess the flash data was corrupted due to this, and OAD failed and got the timeout

    Thanks for the info, good to have for future debugging