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.

Compiler/CC2640R2F: CC2640R2 simple peripheral observer with OAD

Part Number: CC2640R2F


Tool/software: TI C/C++ Compiler

My custom project is based on SimpleBlePeripheralObserver.

I am using the following 

1)  CC2640R2F Launchpad

2) BLE 4.2   and Ble stack sdk simplelink_cc2640r2_sdk_1_50_00_58

3) Code composer studio version 8.0.0

4) Ti Compiler version 16.9.6

point 1: - describes the problems, I faced during adding OAD to my project according to the following link

dev.ti.com/.../ble_enhanced_oad.html

point 2: - describes the problem, I faced while converting my project from library configuration to split image configuration, and adding OAD 

point 1: - I saw the above link  and I tried to add OAD in my project according to given steps, I followed each step, but as my project is based on library configuration, not split image configuration so I am getting ICALL_STACK0_START undefined error, but I should not get this error as the project is in library configuration. I saw the CC2642 or CC26X2 OAD example project also, and it's stack part of the project is based on library configuration, while the application part of the project is based on debug and release configuration. And provided OAD example (For CC26X2 or CC2642) does not use  ICALL_STACK0_START, because there is a shadow over  ICALL_STACK0_START in oad_image_header_app.c file. 

Que 1: what is the difference between library configuration, debug and release configuration and split image configuration. I know little but now I want to know more about these configurations.   

Que 2: -As ICALL_STACK0_START  not used,  so where and how did you define .stackEntryAddr and .stackEndAddr. 

Que 3: - How can I use/add Frontier Tool in my project to adjusts the respective RAM and flash boundaries based on analysis of the stack linker and map files. So, I think using the frontier tool I will not get  ICALL_STACK0_START error. 

point 2: - As there is an OAD example for CC2640r2f that is based on split image, by studying this OAD example and studying little bit Ti forum and wiki, i successfully converted my Application project into split image configuration, and for stack I could not convert the stack part into split image, so what I did I just used OAD example stack (simple_peripheral_cc2640r2lp_oad_offchip_stack)  in our split image converted main project. Now it's working fine everything initializes (OLED, UART, GPS, IMU) and advertising but the converted project is not scanning the devices. While the project was working fine with library configuration, in my both project(split image configuration and library configuration) profiles and services are same there is no change, while for library configuration its working fine but for the split image configuration it's not scanning.

After converting my custom project to split image i added the OAD functionality in my project, with oad my project is building no error flash is initializing correctly, now i am able to connect with sensortag app and OAD option appear on the APP, after selecting the OAD option no it goes for Enhanced OAD firmware update screen, i am able to select the .bin after selecting the this stuck and the firmware does not update, as in following screenshot

  • Hello,

    Regarding point 1)
    Any content related to the simple link academy training you have linked to dev.ti.com/.../ble_enhanced_oad.html is not relevant for the CC2640R2.
    The training is intended for a different SDK (CC26x2 SDK) and different device (CC26x2). They are not compatible.

    Regarding point 2)
    The device appears to have disconnected during the OAD. Can you perform the following tests:

    - Attach the debugger to the device during the OAD and see at what point it is disconnecting using the debugger. What is the state of the device? has it crashed?
    - If you require more verbosity form the OAD Downloader (phone/central side) then use BTool, the logs are very detailed there and will show exactly which procedure failed. You can attach the log to this post so that we can better help you.
  • Thank You, sir, for the reply, right now I got OAD working on my project. But right now I am struggling with scanning part. After adding OAD, it is not going in scanning event. 

  • Sir this is not only in my project, this is also happening with simpleBLEperipheralObser example. i added simpleBLEperipheralObser project scanning and advertising only (NO OAD added) in the split image converted project, but in this case also scanning is not happening, while in library cnfiguarartion everything is working fine. Sir, may you please check once is there any configuration issue or what exactly is the reason, why it's not working ? i can share my project with you also if you want ? Thank You SIr
  • Hi,

    Yes providing a minimum project that reproduces the issue would be helpful.

    You should be able to attach it here.

    What is the state of the device while scanning? Does it lockup, abort, etc? 

  • https://drive.google.com/open?id=1xOU3cBErqXW6cUODp32MIwaaQCyJ21Ag

    I am sharing my projects. In all the projects I have removed the OAD part, so these are just advertising and scanning. If required I'll send you my complete project. I am using simple_peripheral_offchip_oad_stack stack project for my project, as I was not able to convert the library configuration stack project to split image configuration project. This is the last way which is still left from my side, if I get some guidance then definitely I'll be able to convert library configuration stack project to split image configuration project.

    1. converted_spiltimage_scanning project:- I converted this project from library configuration to split image configuration and advertising is working fine but getting issue while scanning, right now this project should scan and advertise both. 

    2. oad_example_scan :- I just took the simple_peripheral_offchip_oad example project and added the scanning functionality in this project. In this project, oad is working fine but for testing scanning part I removed the oad and all other functionality. So right now scanning is not working in this project also.

    3. peripheral_observer: -  this is simplebleperipheralobserver example provided by texas instruments. and I used this project as a reference project for developing my projects. In this project scanning and advertising is working fine.

    4.  board_file:- this contains the target and board folder of my ble sdk. in this I am using a custom board file CC2640R2_BOARD. So for adding my board file just delete or cut your target and boards folder from blestack folder C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack.  

    5. CC26xx_app_oad.cmd :-  cmd file used in my project.

    simple_peripheral_cc2640r2lp_oad_offchip_stack project is only configured for peripheral only,  i can see in build_config.opt where   -DHOST_CONFIG=PERIPHERAL_CFG is used.

    so for my i uncommented  -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG  but still its not working. if i uncomment  -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG  then in my converted split image project nothing is working no advertising no scanning so, i think there may be issue with stack project.

    thank you so much, sir, for such a great support

    drive.google.com/open

  • Can you share the link to this android app? Thanks.
  • this is sensortag app
  • SIr, i can understand the difference between the library and split image configuration. But what is the difference between debug and release configuration? does debug and release different from library and split image?
  • Sir, did you find any solution? i am waiting for the response.
    Thank You
  • Sir, did you look into my projects which i have shared and did you find any solution, I am waiting for the reply.
  • Hello,

    We have received your projects and are reviewing them, I can provide an update by tomorrow.

    My apologies for the delay.

  • Hi Pradeep,

    The files that you shared are a copy of your CCS workspace and thus do not contain all the files that you may have modified in the SDK.
    From the files you provided I worked with the example where scanning was added to the existing OAD project, these files were located at:
    TI_forum-20180808T051913Z-001\TI_forum\oad_example_scan\testOad5

    I placed these files on top of a vanilla SDK installation for the simple_peripheral_oad_offchip project.

    When running the example I found that GAP_DeviceDiscoveryRequest() was returning 0x12 which is consistent with bleIncorrectMode. Digging further I was able to find that bleIncorrectMode was being returned because GAP_DeviceInit was passed a gapRole_profileRole == GAP_PROFILE_PERIPHERAL when it should be GAP_PROFILE_PERIPHERAL | GAP_PROFILE_OBSERVER if scanning is to be allowed.


    With this change, I am above to hit a breakpoint inside of GAP_DEVICE_INFO_EVENT which means that the scan had detected a nearby device.

    Of course, since the sample app your provided is blasting scan commands to the stack, it is not the most optimal implementation but I can confirm that scans are being received.
  • Thank You so much sir, it is working. Cheers!
    One question:- what is the best way of performing scanning for the devices and performing OAD in one project.

    Thank You so much.
    Pradeep