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 failed with simple_peripheral_oad_offchip

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

SDK version is simplelink_cc26x2_sdk_2_30_00_34. I first download the firmware generated from the OAD example project on Launchpad CC26x2R1 with Uniflash, then OAD with Btool from the same SDK. It worked well. Then I used the same firmware on my own PCB. Btool stuck at "OAD Get OAD Block Size", then showed error message "OAD Download Not Successful". My Flash is MX25R8035FZUIL0 and I've made sure it's functional.

Please help!

  • Sean,
    Are you able to debug to figure out where is the process it fails? What happens in the code when "OAD Get OAD Block Size" is executed?
  • Thanks for the reply, Joakim

    ATT_ExchangeMTUReq and ATT_ExchangeMTURsp have been exchanged between master and slave. Then, a GATT_WriteNoRsp command is not responded. Inside the function SimplePeripheral_processGATTMsg of simple_peripheral_oad_offchip.c, ATT_MTU_UPDATED_EVENT rather than ATT_FLOW_CTRL_VIOLATED_EVENT has occured. I don't know where else I can set breakpoint. Please give me a hint.

    The Btool messages are shown as:

    [40] : <Tx> - 05:06:41.580

    -Type : 0x01 (Command)

    -OpCode : 0xFD02 (ATT_ExchangeMTUReq)

    -Data Length : 0x04 (4) byte(s)

    ConnHandle : 0x0000 (0)

    ClientRxMTU : 0x00F7 (247)

    Dump(Tx):

    0000:01 02 FD 04 00 00 F7 00 ........

    --------------------------------------------------------------------

    [41] : <Rx> - 05:06:41.656

    -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 : 0xFD02 (ATT_ExchangeMTUReq)

    DataLength : 0x00 (0)

    Dump(Rx):

    0000:04 FF 06 7F 06 00 02 FD 00 .........

    --------------------------------------------------------------------

    [42] : <Info> - 05:06:41.694

    OAD Get OAD Block Size

    --------------------------------------------------------------------

    [43] : <Rx> - 05:06:41.667

    -Type : 0x04 (Event)

    -EventCode : 0x00FF (HCI_LE_ExtEvent)

    -Data Length : 0x08 (8) bytes(s)

    Event : 0x0503 (1283) (ATT_ExchangeMTURsp)

    Status : 0x00 (0) (SUCCESS)

    ConnHandle : 0x0000 (0)

    PduLen : 0x02 (2)

    ServerRxMTU : 0x00F7 (247)

    Dump(Rx):

    0000:04 FF 08 03 05 00 00 00 02 F7 00 ...........

    --------------------------------------------------------------------

    [44] : <Tx> - 05:06:41.697

    -Type : 0x01 (Command)

    -OpCode : 0xFDB6 (GATT_WriteNoRsp)

    -Data Length : 0x05 (5) byte(s)

    ConnHandle : 0x0000 (0)

    Handle : 0x003A (58)

    Value : 01

    Dump(Tx):

    0000:01 B6 FD 05 00 00 3A 00 01 ......:..

    --------------------------------------------------------------------

    [45] : <Rx> - 05:06:41.755

    -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 .........

    --------------------------------------------------------------------

    [46] : <Error> - 05:07:21.708

    OAD Operation Timed Out

    Operation Name = GATT_WriteNoRsp_GetOadBlockSizeCmd

    --------------------------------------------------------------------

    [47] : <Error> - 05:07:21.719

    OAD Get Block Size Failed

  • Hi Sean,

    It looks like you are getting stuck in the middle of the "GetOadBlockSizeCmd".

    I would suggest putting a breakpoint in the oad.c file, (under the OAD folder) inside the function oadProcessExtControlCmd, under the case of OAD_EXT_CTRL_GET_BLK_SZ.

    If you reach this point it means you target is receiving the message from the distributor. If this is indeed the case try to see if you are returning a valid response.

    Regards,
    Yuval
  • Hi Yuval,

    oadProcessExtControlCmd never got called in my case. I also verified with LaunchPad, oadProcessExtControlCmd did get called there.

  • Hi Sean,

    If you run a debug session with the clean version of simple_peripheral_oad_offchip on the Launchpad (debug configuration for both bim and app projects) the function oadProcessExtControlCmd should be called after you start the OAD process and before any blocks start transferring in order to send the block size.
    Otherwise OAD should not be able to go through.
    Did the OAD go through when the breakpoint was not hit on the Launchpad? - This means the breakpoint was not activated
    Do you have any sniffer logs?
    Either way I would recommend moving to the newer SDK versions and retrying.

    Regards,
    Yuval
  • Hi Yuval,

    Let me describe my situation again. Using LaunchPad and the clean version of simple_Peripheral_OAD_onchip, every thing goes well. OAD succeeded. But, when I use the same firmware on my own made PCB with CC2642R1, I got the issue as mentioned. I have read/write tested the external Flash using this same clean simple_Peripheral_OAD_onchip. The test succeeded.

    According to your guide, I know the bug is cornered. Just need one or two more steps to get it. I can't figure what happened between ATT_ExchangeMTU and oadProcessExtControlCmd.

  • Hi Sean,

    Between ATT_ExchangeMTU and oadProcessExtControlCmd there should be no calls to flash.

    If you could specify any more details of your setup or maybe try to debug around the mentioned functions I can try to help you better.

    Best Regards,
    Yuval

  • Hi Yuval,

    My setup is as following:

    1. Run clean simple_peripheral_oad_offchip project with unsecure configuration on my device.
    2. Unassign all pins except the following re-assignments:
    /* Discrete Inputs */
    #define CC26X2R1_LAUNCHXL_PIN_BTN1 IOID_8 //always keep high
    /* SPI */
    #define CC26X2R1_LAUNCHXL_SPI_FLASH_CS IOID_27
    #define CC26X2R1_LAUNCHXL_SPI0_MISO IOID_30
    #define CC26X2R1_LAUNCHXL_SPI0_MOSI IOID_29
    #define CC26X2R1_LAUNCHXL_SPI0_CLK IOID_28
    3. Uniflash BIM and program.
    4. Btool OAD fails at "OAD Get OAD Block Size".
    5. Run the same setup on LaunchPad.
    6. Unassign all pins except the above 5 pins keep the original assignment.
    7. Uniflash BIM and program.
    8. Btool OAD sucessful.

    Hope these help.

    Regards
    Sean

  • Hi Sean,

    1) When you debug this, how far along do you get?
    It is extremely important that you understand exactly where and if your application stops responding to understand what went wrong. With which IDE are you working? Try to put breakpoints along the OAD process and see how far along you can reach. You mentioned before that you are not receiving the breakpoint at oadProcessExtControlCmd, this should NOT be the case for a successful OAD (I verified this myself just to be sure).

    2) Can you explain your choice of choosing those specific IO pins?
    I believe there is a chance your are interfering with the analog pins with these assignments. Try assigning different pins that are definitely not assigned and connecting your external flash (via SPI) to them.

    Best Regards,
    Yuval

  • Hi Yuval,

    Thanks for the effort of verifying. As I said, it goes well with LaunchPad. I can go deeper for the OAD debugging.

    This is a project upgraded from CC2640R2F. All those pins assignment worked well there. To avoid the possible pin interference, I un-assign all other pins to make a side-by-side comparison with LaunchPad.

     

    Regards

    Sean

  • Hi Sean,

    I'm going to close this post due to inactivity. To reopen this thread, just post a follow up question. Otherwise, after 30-days of inactivity from this post, this thread will lock.

    Best Regards,
    Yuval