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.

CC2640R2F: power levels definition for custom board not reachable in UBLE include files

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2650, BLE-STACK,

Hi!

I am trying to adapt the code of an existing project to use a custom board. The application is using the Micro-BLE stack and is based on the micro-eddystone example project.

SDK is 4.40 (checked this also with SDK 5.3 - made no difference)

The issue I am running into is that I define the symbol CC2650EM_7ID in my board file in order to select the RF-setup for differential frontend with internal bias. As soon as I remove the symbol CC2640R2_LAUNCHXL from the project symbols the compiler cannot find anymore the definitions for the power levels, like TX_POWER_0_DBM.

As far as I can see these are defined in urfc.h. However there they are defined only for

#if defined(CC2650_LAUNCHXL) || defined(CC2640R2_LAUNCHXL) || defined(CC2650DK_7ID)

As a test I did:

  1. importe into a fresh workspace the eddystone project
  2. add directory with new board files (exact copy of CC2640R2_LAUNCHXL files with all macros renamed to something like MYBOARD)
  3. add MYBOARD into local board.c
  4. remove symbol CC2640R2_LAUNCHXL in project
  5. add symbol MYBOARD
  6. compile

=> exact same errors:

"C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/blestack/microstack/uble.c", line 113: error #20: identifier "TX_POWER_0_DBM" is undefined

"C:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/blestack/target/board.h", line 69: fatal error #35: #error directive: "***ERROR*** Invalid Board Specified! Please see board.h for options."

Where are the power levels defined for the CC2650EM_7ID ?

Am I missing a symbol declaration or include file?

Is the BLE-stack code relying on the definition of a development board? Must I use the symbol CC2640R2_LAUNCHXL just to get the stack working? (if yes it would make the board choice invalid again in othe rinclude files)

Thanks for any pointers!
Cheers
JR

  • Maybe to simplify the question:
    The method described in Running the SDK on Custom Hardware works (with some extras) for the BLE-stack.

    For the uBLE stack this method does not work. See errors above.

    What needs to be done to add custom hardware as target/board to the project?

    Thanks!

  • Hi JR,

    I have assigned your query to a relevant expert and they will provide a response soon.

    Best Regards,

    Jan

  • Hi JR,

    Could you run a quick test as a sanity check while the expert gets a chance to respond? Could you try following the custom hardware instructions in an unmodified simple_peripehral project? Afterwards, can you see if you are able to successfully compile the project?

    Best Regards,

    Jan

  • Yes, it works like a charm.

    Here is what I do (might be of interest to others that are trying to avoid editing the SDK to get custom board code to work):

    1. delete the link to board.c in the startup folder of the project
    2. copy the board.h and board.c from the {yourSDKpath}\source\ti\blestack\boards\CC2640R2_LAUNCHXL\ into the startup folder of the project
    3. create a folder /boards in the project - do not add this folder to the include list in the project!
    4. copy my custom board files as a folder into /boards (e.g. {project}/boards/myboard containing:
      - Board.h - identical to Board.h of CC2640R2_LAUNCHXL - containing the BOARD_.... macros to abstract the pins and other symbols
      - myboard.c - identical to CC2640R2_LAUNCHXL.c
      - myboard.h - identical to CC2640R2_LAUNCHXL.h
      - myboard_fxns.c - identical to CC2640R2_LAUNCHXL_fxns.c - in case you have a need for such extra functions for your hardware
    5. in all of my board files I add the conditional #ifdef MYBOARD at the very beginning and #endif {replace with the symbol of your custom board} - this is only needed if the board files are directly in the project folder. In case you keep them in a central location and do not use a soft link to put them into the project this is not needed (just like the TI board files dont need this as they are not inside your project and therefore not by default included in the build)
    6. add the #elif defined(MYBOARD) together with the path to your board.c and board.h files in the startup folder - in my example the board.c would look like this:
      #if defined(CC2640R2DK_CXS) || defined (CC2640R2DK_4XS) \
      || defined (CC2640R2DK_5XD) || defined (CC2640R2DK_7ID)
      #include "./cc2640r2em/cc2640r2em_board.c"
      #elif defined(CC2640R2_LAUNCHXL)
      #include "./cc2640r2lp/cc2640r2lp_board.c"
      #elif defined(CC2640R2_RC)
      #include "./cc2640r2rc/cc2640r2rc_board.c"
      #elif defined(MYBOARD)
      #include "boards/myboard/myboard.h"
      #else // unknown board
      #error "***ERROR*** Invalid Board Specified! Please see board.h for options."
      #endif
    7. replace the symbol CC2640R2_LAUNCHXL with your board symbol (e.g. MYBOARD) in the Project properties > Build > Arm compiler > predefined symbols

    Build! :-)


    This procedure is practically the same as recommended by TI, just with the difference that you can keep the custom board files in the project instead of editing the TI-SDK.

    Now, for the eddystone example project (which is using the uBLE stack) this does not work. The problem is it does not find some includes that seem to be hardcoded somewhere in the SDK.

    I am looking forward to see how to make the uBLE stack wirk with different boards!
    cheers
    JR

  • Hi,

    Thank you for reaching out.

    #include "boards/myboard/myboard.h"

    It looks like this include is not correct. As this is an extract of board.c, you should include the .c file.

    Could it explain the missing file and the link error?

    If not, I would recommend to (temporary) get rid of the conditional includes in order to spot the one not properly working.

    I hope this will help,

    Best regards,

  • Hi Clement!

    The includes are correct. For TI boards it would include myboard.c and myboard.h at that point because TI brings the example boards inside the SDK = outside the project (the CC2640R2_LAUNCHXL include option also just includes a file that includes those files). If you want to make it look like a *.c file one would simply write an #include "boards/myboard.h" into myboard_main_include_file.c, which is what the cc2640r2lp_board.c is in fact doing.

    In my case the include here is omitted because the files are already inside the project - see my point 5.

    Thanks for checking!
    Cheers
    JR

  • ping....

    any news on this one?

  • Hi,

    Could you try following the custom hardware instructions in an unmodified simple_peripehral project? Afterwards, can you see if you are able to successfully compile the project?

    Best regards,

  • Dear Clement,

    in the very beginning Jan has pointed that out and requested already.
    I have followed the TI instructions to edit inside the SDK for custom board as well as my own slightly modified instructions to edit inside project for custom board. Both based on simple_peripheral project.

    How do I correctly setup the uBLE stack?
    Is there something in the docs that I missed?

    Thanks!

  • Hi JeanR,

    I supposed you import the micro ble stack example program and modify. I have tested it before using launchpad works. For the board files I copy all to Startup folder for portability works. Then modify the board files according to your custom board.

    -kel

  • Hi Markel!
    This solution works well for one custom PCB which can have the launchpad defines inside. As soon as I have multiple PCBs (revisions, other products) that I need to switch between, it does not do the job unfortunately.

    @TI ar there any updates on how to properly setup the uBLE stack for custum boards? I have tried to include the urfi.c/.h files into the project but that caused lots of redeclaration or defines not found errors. Basically the same as before. At the end of the day the includes in the stack files are getting messed up as soon as certain files go into the project scope.

    Thanks for any hints!

  • This solution works well for one custom PCB which can have the launchpad defines inside. As soon as I have multiple PCBs (revisions, other products) that I need to switch between, it does not do the job unfortunately.

    This is my CC2640R2_LAUNCHXL.h renamed to CC2640R2_BOARD.h to work for 4x4 CC2640R2F custom board. If you are referring to #define CC2640R2_LAUNCHXL, since I am using a custom board I do not need this define so I will delete it. Anyway, it is up to you to decide how to do it.

    -kel

  • Dear Markel,

    have you tried to delete the define CC2640R2_LAUNCHXL?

    Once I do that, the build runs into the above mentioned problems. The reason is quite simple, there are no power levels defined for CC2650EM_7ID in the uBLE stack. Only by defining the launchpad macro it works, because then the launchpad values are used. However that runs into issues when using multiple custome boards (plus the launchpad as prototyping setup).

    @TI, @Clément, @Jan: is there anyone still on this issue or have you given up on it? At least I would like to know what the odds are that there is going to be any input. Thanks!

    Cheers
    JR

  • have you tried to delete the define CC2640R2_LAUNCHXL?

    For simple peripheral based program yes. I guess the same does not apply for micro ble stack, I just tried it.

    Regarding your issue do not remove the CC2640R2_LAUNCHXL predefined symbol. By default the CC2650EM_7ID is set at CC2640R2_LAUNCHXL.h. Without changing anything you do not have a problem am I correct? I am using micro_eddystone_beacon as reference.

    -kel

  • Yes, for the TI uBLE stack the world seems to turn differently. ;-)

    Yes, when I dont remove the CC2640R2_LAUNCHXL things work.

    It does colide with using a second custom board.
    Also I noticed that a custom urfi.c/.h makes the SDK run into the problem of not finding the includes, even though the project finds them. It looks like the SDK is somehow hardwired to use only the urfi.c/.h from the SDK properly. :-(

    JR

  • Hi Clément!

    Yes, this has been done, with results as described above.

    What is the state on this issue? By now I need the support urgently.

    JR

  • check this out. This is eddystone beacon using simple peripheral as base project. https://github.com/mtrobregado/TI-CC2640R2F-Eddystone-Beacon