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