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.

CCS/CC2640R2F: OAD for simple peripheral problems

Part Number: CC2640R2F
Other Parts Discussed in Thread: UNIFLASH

Tool/software: Code Composer Studio

Hello!

I wanted to add to my custom board with custom simple_peripheral app an OAD. For adding - used this: http://dev.ti.com/tirex/explore/node?node=APgDxfpPQjPebRJTChVmkg__krol.2c__LATEST   

chanigng all the multi role names to simple peripheral. Main app linker changed from cc26xx_app.cmd to cc26xx_app_oad.cmd

Using simplelink SDK 3.30 version, CCS 9.01, XSCTools 3.55.2.22, Compiler TI v18.12.3.LTS 

But i got problems with app compilation(linking). Attaching the logs to this thread.

app_build.txtstack_build.txt


Best regards, Dmitriy.

  • And the very strange thing as for me - i have generated ccs_linker_defines.cmd in stack project, i've added this in linker files/paths for app project, but when linking app project - it says that there are no defines of ICALL_STACK0_START and so on. 

  • Hello Dmitriy,

    Did you compile the stack project first?

    Did you follow the simplelink guide to ad Adding OAD to the stack? I did this exercise recently on sdk3.30 which worked well. But you have to follow every step very thoroughly.

  • Hello Eirik!

    Thank you for your answer - yes, i compile stack project first.

    Yes, i followed the guide i gave a link to. The guide is for multi role project, so there are some difference in stack part configuration. On screenshots you can see that i say to app part to use link.cmd from stack part, but app part doesn't see it..

    And more of that i have problems with these:

    undefined first referenced
    symbol in file
    --------- ----------------
    GATT_SendRsp <whole-program>
    HAL_SYSTEM_RESET <whole-program>
    simple_peripheral_UnRegistertToAllConnectionEvent <whole-program>

    Is it becouse of wrong stack configuration?

    Maybe it's better to attach my .project files?

    Best regards, Dmtiriy.

  • Hi Dmitriy,

    (We do have a simplelink OAD example - maybe it would be easier for you to use this as a starting point and add your custom application on top?)

    http://dev.ti.com/tirex/explore/node?node=AGdUy.2vNuW8gKwK6lpEPg__krol.2c__LATEST

    Please use cc26xx_app_oad.cmd as the app linker command file.

  • Hello, Marie!

    To be honest - my custom application is big enough and i had to use cache as ram option. And as i understand - the offchip oad example project is bigger then base simple peripheral project and have many things that i have cutted in my custom one - so if it is possible it would be pleasure if you can help me to add oad part to my custom project.

    Best regards, Dmitriy.

  • Hello! 

    All i wrote above - was my attempts to add oad to simple peripheral in CCS 9.01 version on my laptop.

    Today i do all the same exactly from my personal computer with CCS 9.1 version and i have no problems with linker in case of taken dependencies from stack project.

    Now i have only one problem of linking, it is:

    undefined first referenced
    symbol in file
    --------- ----------------
    GATT_SendRsp <whole-program>

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "simple_peripheral_cc2640r2lp_app.out" not built

    How can i fix it?

    Best regards, Dmitiry

  • just for experiment i 've commented gatt_sendrsp where it used and linked and builded the project again.

    It successfully builds, but when i try to debug CCS programms my cc2640r2 mcu using my XDS110 debug probe, but after this nothing happens , i have all buttons in debug mode deactivated, i can't see the entry point of project( on screenshot you can see a main from previous debug session ) why does this happens too?

  • Hi Dmitriy,

    GATT_SendRsp() is defined in the BLE library, i.e. it's an ICall API. Did you include icall.h and icall_ble_api.h?Did you call it before ICall_registerApp()?

    I don't understand your question, can you please re-phrase.

  • Hi Marie!

    Yeah, i do include icall.h and icall_ble_api.h - maybe that's a reason that i have this error in linker step, not in build.

    I call it on SimplePeripheral_processConnEvt - like in standart simpleperipheral example. And at the ICall_registerApp() is the first function i call in  SimplePeripheral_init. So this error with undefined GATT_SendRsp is appears after adding OAD steps, like in guide i've attached. How can i fix it?

    The question about debuggin - when i press debug button in code composer studio i have next:

    building if necessary 

    linking

    downloading code to flash

    and after that i expect to be able to run the code - but all debug buttons are inactive - looks like debugger doesn't understand where i have main() function.

    How to debug this project in such case? I found that all this happens after i add CACHE_AS_RAM option. If i delete this in predefined and linker - i can debug, if i add - i can't. But there was no such problems when i debugged no oad simple_peripheral application - CACHE_AS_RAM doens't affect debugging and working of project. 

    And how can i create oad_merged.bin ?

    And is it possible and how to add CACHE_AS_RAM option to BIM?

    Best regards, Dmitiry.

  • Hello, Marie!

    Are there any possibilities to resolve this problem?

    Best regards, Dmitiry.

  • Hi Dmitry,

    Thanks for posting the screen shot. The errors showed are not linker errors but error between CCS and the Debugger. 

    What debugger are you using?

    Also, can you try using a different USB port?

    Can you use Flash Programmer 2 to Mass erase your device and retry?

    http://www.ti.com/tool/flash-programmer

     

  • Hi Marie!

    I use XDS110 debugger.

    I tried to use different usb ports - no differ.

    Yeah, i tried to mass erase via Uniflash and via flash programmer 2 before flashing new oad with cache as ram and it didn't help too.

    So when i try to add cache as ram i have this problem, if not - debugger works as usuall.

    Best regards, Dmitiry.

  • Hi Dmitriy,

    To use Cache As RAM with oad you will need to change the CCFG in the BIM project. Please see:

    RTOS/CC2640R2F: Cache As Ram with OAD examples - Bluetooth forum - Bluetooth®︎ - TI E2E support foru

    e2e.ti.com
    Part Number: CC2640R2F Tool/software: TI-RTOS Hi Guys, Is there a solution to using Cache As Ram with the OAD examples? Building with Cache As Ram causes the

  • Hello, Marie!

    Thanks for that post, i saw it when searched for my problem.

    So i did next:

    1. Add to ccfg of BIM project 

    #ifdef CACHE_AS_RAM
      #define SET_CCFG_SIZE_AND_DIS_FLAGS_DIS_GPRAM  0x0 /* Enable GPRAM */
    #endif //CACHE_AS_RAM
    

    2. Add to BIM project linker CACHE_AS_RAM=1 , add to app project predefined symbols CACHE_AS_RAM

    3. Add to .cmd of BIM project all the code from point 7 of original instruction

    4. Add to app project linker CACHE_AS_RAM=1 , add to app project predefined symbols CACHE_AS_RAM

    5. Add to main() of app :

    #ifdef CACHE_AS_RAM
    // retain cache during standby
    Power_setConstraint(PowerCC26XX_SB_VIMS_CACHE_RETAIN);
    Power_setConstraint(PowerCC26XX_NEED_FLASH_IN_IDLE);
    #else
    // Enable iCache pre-fetching
    VIMSConfigure(VIMS_BASE, TRUE, TRUE);
    // Enable cache
    VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);
    #endif //CACHE_AS_RAM

    6. Add to .cmd of app project all the code from point 7 of original instruction

    7. Clean all projects - bim,stack,app

    8. Build all projects - bim, stack, app

    9. Fully erase chip memory

    10. Flash and enjoy


    After all of this BIM works, but app craches after   BIOS_start();


    Where am i wrong? May we ask to come someone of TI guys who have tested cache as ram in oad projects, @, or @, or @?

    Best regards, Dmitriy.



    UPD: updated instruction of adding CACHE_AS_RAM to cc2640r2


  • Hi Dmitriy,

    Did you add the CACHE_AS_RAM compiler and linker define to the BIM project? (I would also clean and rebuild the whole project after adding these changes, not just press the build button.)

  • Hello, Marie!

    Yeah, i did it. Sorry that i forgot to write this point. And i cleaned all 3 projects ( bim, stack, app ) and then build them ( bim, stack, app ).

    Is it necessary to add code from point 7 of instruction to CMD files of bim and app ?

    Best regards, Dmitriy.

  • Hi Dmitriy,

    Yes you will need to alter the linker command file for both the BIM and app (and add the linker define CACHE_AS_RAM=1).

  • Hello Marie!

    Thank you for your time and help!

    I checked everything again, cleaned all projects, build it again, erased all chip memory, builded bim,stack,app projects and now OAD with CACHE_AS_RAM works!

    Thank you again:)

    For everyone looking this post - full instruction is at post from Jan 19, 2020 7:17 PM

    Best regards, Dmitiry.