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.

LAUNCHXL-CC2640R2: on-chip oad fails when ported to CC2640R2 4XS

Part Number: LAUNCHXL-CC2640R2
Other Parts Discussed in Thread: UNIFLASH

Dears,

I am using on-chip oad example from sdk3.10.00.15. and I am using cc2640r2 4xs chip.

OAD process fails when BTool send right oad bin file. I test same code on CC2640R2 Launchpad, it works and won't fail.

Would you please help me to address what could I do wrong?

Here is what I already did to modify sdk example to run on my custom board:

1. modify simple_peripheral_cc2640r2lp_oad_onchip_app board file, modify IOID for UART/LED and something else on IOID.

Board.h
CC2640R2_LAUNCHXL.c
CC2640R2_LAUNCHXL.h
CC2640R2_LAUNCHXL_fxns.c

2. same modifications for persistent_app_cc2640r2lp

update 1:

I think the issue happens at reboot procedure after I remove simple_gatt_profile.c.

before I remove simple_gatt_profile, after 0x01 writen to reboot service, it reboot to persisten_app immediately.

after I removed simple_gatt_profile, after 0x01 writen to reboot service, there is 2 situations:

1. after I write 0x01 to reboot service manually, it halt; when I pressed reset button, it boot to persistent app

2. when I start oad process with btool, it just reboot to simple_peripheral app immediately.

update 2:

same as update 1, after removed simple_gatt_profile.c(other things untouched, just remove simple_gatt_profile.c and all comment out calls to it in simple_peripheral_oad_onchip.c),

oad process can not be finished even on CC2640R2 Launchpad, it reboot to simple_profile app not persisten app.

update 3:

Now I am focusing to find out why it jumps to user application after I removed simple_gatt_profile.c

I traced the jump process after btool send out a 0x01 to reset service, here is what I found:

add some print in SimplePeripheral_processOadResetEvt in simple_peripheral_oad_onchip.c:

  // Set the bim_var based on the command ID
  if(cmdID == OAD_RESET_CMD_START_OAD)
  {
    // Set the BIM variable to jump to persistent application
    _bim_var = 0x00000001;
    Display_print0(dispHandle, 4, 0, "jump to persistent application");
  }
  else
  {
    // Set BIM variable to jump back to user application
    _bim_var = 0x00000101;
    Display_print0(dispHandle, 5, 0, "jump to user application");
  }

when oad process starts, it goes to "jump to user application";

btool log shows like below which means btool want device go to 0x01(persisten application)

[47] : <Tx> - 04:06:07.799
-Type : 0x01 (Command)
-OpCode : 0xFD96 (GATT_WriteLongCharValue)
-Data Length : 0x07 (7) byte(s)
ConnHandle : 0x0000 (0)
Handle : 0x001E (30)
Offset : 0x0000 (0)
Value : 01
Dump(Tx):
0000:01 96 FD 07 00 00 1E 00 00 00 01 ...........
--------------------------------------------------------------------

So in short words, this issue is "after remove simple_gatt_profile.c, on-chip oad reboot process goes to user application not persisten application".

  • Hi,
    I am not certain on-chip oad from sdk3.10.00.15 should be doable due to the decreased flash availability in the last couple of SDK releases. Did you run it successfully on one of the stock CC2640R2 launchpads first?
  • Hi J,
    on-chip oad example from sdk3.10.00.15 works fine on launchpad.
    it does not jump to persistent app on my custom board with cc2640r2 4xs.
  • Hi J,

    I found something might be useful.
    cause the flash size is a constraint so I removed simple_gatt_profile.
    after I remove this profile, after 0x01 writen to reboot service, it reboot to simple_peripheral instead of persistent_app.
    if I roll back code to add simple_gatt_profile, oad procedure works fine.
  • Hi LeoSun,

    Theoretically speaking, if these are the only changes you made this should not happen.

    That being said, can you please post a longer BTool log?
    Also, do you have a sniffer capture of the OAD process?

    Best Regards,
    Yuval
  • Hi Yuval,

    Thank you for your patience.

    I think I made some mistakes on previous tests. So I pull a new example and start it all over again.

    The problem is still there: the same code works fine on the launchpad, but can not jump to oad-persistent-app on my customized board.

    And the thing I bring up to you that when reset service triggered device does not goes to “jump to oad-persistent-app”, does not happen. I think that's my fault my mistakes.

    Here is what I did in short words:

    1. pull a new oad-on-chip example from SDK v3.10.00.15
    2. do some portable settings, moving all 4 projects to my own location under git
    3. change board type flag from "CC2640R2_LAUNCHXL" to "CC2640R2DK_4XS"(both for user app and persistent app) cause my custom board hardware is more likey 4XS
    4. and I port board files to project directory from simplelink_cc2640r2_sdk_3_10_00_15\source\ti\blestack\boards\CC2640R2DK_4XS\(both for user app and persistent app), cause I may modify hardware settings and I want leave SDK untouched.
    5. do some minor modifications on IO settings, basically, just disable some IOIDs that I am not using for now.

    After that, I test like this:

    1. erase entire flash on target device with uniflash
    2. load images with uniflash with these files all from un-secure directory.
    • persistent_app_unsecure.hex 
    • simple_peripheral_cc2640r2lp_oad_onchip_stack_FlashROM_unsecure.bin 
    • simple_peripheral_cc2640r2lp_oad_onchip_app_FlashROM_unsecure_oad.bin
    • bim_oad.hex

    like this 

    Then I reset the board and do tests:

    1. on launchpad, oad works perfectly
    2. on my own board, oad can not jump to oad-persistent-app, after Btool send out reset and wait, device just halt. If I reset my board manually, the board can boot to persistent-app.

    At last, I attach the test projects and btool log file, hope it helps.

    /cfs-file/__key/communityserver-discussions-components-files/538/7848.oad_5F00_4xs_5F00_almost_5F00_same_5F00_as_5F00_example.zip

    /cfs-file/__key/communityserver-discussions-components-files/538/4xs_5F00_oad_5F00_fail.zip

  • Hi Yuval,
    update one thing, I followed this post
    e2e.ti.com/.../2583555

    but this does not cover my issue.
    B.R.
  • Hi LeoSun,

    I browsed through your BTool but couldn't see anything out of the ordinary.
    If you have any sniffer captures please post them and I'll try to take a look.

    I would recommend going through the chapter in the BLE stack User's Guide about running on a custom board(link).

    Best Regards,
    Yuval

  • Thank you, Yuval,
    We did a lot of tests on this issue. Only one sample of our boards have this issue.
    I am still watching this issue, expected this is only an isolated hardware issue.

    Thank you again for your help.