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: Cannot pass compilation

Part Number: CC2640R2F
Other Parts Discussed in Thread: SYSCONFIG, CC2640

regards,

  • Hi,

    Can you provide me a screen shot of the includes in your project explorer.

    Did you add some code to the empty project ? Or even the original project does not build ?

    Regards,

  • HI  

    I'll tell you some of the work I've done.

    1.I use SYSCONFIG to generate the board file, and add the custom hardware code, the "empty" project can run perfectly.

    2.I want to control custom hardware via smartphone, but SYSCONFIG does not support BLE configuration, I generate ""simple_periphera"" project and modify it according to custom hardware: "board.h ", "CC2640R2_LAUNCHXL.c", "CC2640R2_LAUNCHXL.h". ""simple_periphera" project is not working properly.

    3.In order to verify the correctness of the modified board file, I replaced the modified "board.h", "CC2640R2_LAUNCHXL.c", "CC2640R2_LAUNCHXL.h". Replace "board.h" and "board.h" in the "empty" project.it does not pass the compilation

  • Hi,

    You're right, the empty project is not supported BLE.

    If you want to connect your Smartphone you have to use the simple peripheral project. Does the bug on this project is the same than the one on the empty project?

    I had a look at your code and some parameters of your TRNGCC26XX_HWAttrs structure doesn't exist in the TRNGCC26XX.h file, also your TRNGCC26XX_Config structure is undefined in the same file. Did you change this file since your first attempt on empty project ?

    Thanks and Regards,

  • HI Guillaume

    1."simple peripheral" can complete compilation.

    2.I have never modified   "TRNGCC26XX.h".

    Regards,

    tdy

  • Hi,

    Can you detail a bit much what's "not working properly" means for the simple peripheral example.

    For the first time the empty project works properly, did you add your custom files?

    On your file CC2640R2_LAUNCHXL.c (see below) you need to add the right include.

    /*
     *  ========================= TRNG begin ====================================
     */
    //#include <ti/drivers/trng/TRNGCC26XX.h> // Here you need to add #include <ti/drivers/TRNG.h>
    #include <TRNGCC26XX.h>

    /* TRNG objects */
    TRNGCC26XX_Object trngCC26XXObjects[CC2640R2_LAUNCHXL_TRNGCOUNT];

    /* TRNG configuration structure, describing which pins are to be used */
    const TRNGCC26XX_HWAttrs TRNGCC26XXHWAttrs[CC2640R2_LAUNCHXL_TRNGCOUNT] = {
        {
            .powerMngrId    = PowerCC26XX_PERIPH_TRNG,
        }
    };

    /* TRNG configuration structure */
    const TRNGCC26XX_Config TRNGCC26XX_config[] = {
        {
             .object  = &trngCC26XXObjects[0],
             .hwAttrs = &TRNGCC26XXHWAttrs[0]
        },
        {NULL, NULL}
    };

    ================================================================

    Moreover, the structure TRNGCC26XX_HWAttrs trngCC26X2HWAttrs does not have the right parameters, you need to initialize

    these three parameters

    .intPriority       = ~0,
    .swiPriority       = 0,
    .samplesPerCycle   = 240000,

    rather than

    .powerMngrId    = PowerCC26XX_PERIPH_TRNG,

    Regards,

  • HI Guillaume

    This is the"simple peripheral" code.

    2816.simple_peripheral.zip

    1.The questions of "simple peripheral" are as follows:

    I want to run step over debug.

    However, some code was not executed when the execution reached here

    Next there is no way to execute step over.

    The code jumps to the inside of the function

    2. first time the empty project works properly, I add  custom files ,but board file is generated by SYSCONFIG.

  • HI Guillaume

    Is the "TRNG" module used in the "empty"   project and can I remove it? 

    Regards,

    tdy

  • A small tweet. I love everything about TI: devices, training, development guides, services for engineers .... Except for the MCU development environment.
    I don't want to waste anyone's time coming to the forum to ask questions about even the simplest GPIO configuration, and it would be great if there was documentation or tools to help beginners with those basics! Just like ST CUBEMX, of course maybe CC2640 is an obsolete product and TI doesn't want to spend effort to maintain it anymore.

  • Hi,

    I'm taking in consideration your feedback about CC2640 and I opened a discussion on this point.

    Concerning the simple peripheral project :

    This error appears only in debug mode, or the code is not running when you flash it as well?

    On debug mode, due to the delay function it could impact the working process (time in debug doesn't necessarily match with the real time delay).

    Could you try to run your code without the delay() functions?

    Concerning the empty project :

    The TRNG.h file is used in the empty project. If you remove it, the project will not work properly.

    Regards,

  • HI Guillaume

    1.The following "empty" project code works perfectly on my custom hardware.The board file is generated by SYSCONFIG. By modifying the board file, it also runs on LAUNCHXL-CC2640.

    3731.empty_CC2640R2_LAUNCHXL_tirtos_ccs.zip

    There is no code for "TRNG" in the board file.But the project code can run.And it also uses delay() functions.

    2.I used a logic analyzer to observe the SPI bus of the "simple peripheral" project and the code was not executed correctly, but I had no way to locate what was wrong because I could not set breakpoints in many places during debugging.

    3.I want to know why I can't  step over execution and set breakpoints?

    4.I guess where the problem might come from, "empty" and "simple peripheral"  difference is that the "empty" board file is generated by SYSCONFIG and it must be correct, while the "simple peripheral" board file is modified by me and I can't confirm its correctness.

    And "empty" only one main thread is running,"simple peripheral"   are several threads running.Do they affect the execution of my threads?

    I look forward to hearing from you, thanks!

    Regards,

    Tdy

  • Hi,

    For debugging issues, breakpoints are not always easy to set due to timing and optimization: I advise you to have a look at the debugging guide of your SDK: docs>ble5stack>ble_user_guide>ble5stack-debugging, section about breakpoints. 

    You can also use Uart an print it on the serial terminal, it's very useful for debugging: Or just using GPIOs to know if a specific part of code  has been run or not.

    Did you try to generate the board by sysconfig on the simple peripheral example?

    It's possible that some tasks are taking a higher priority that others, make sure that the BLEstack have always the higher one.

    Can you ensure me that all the task are running properly? (You can use the ROV tool on CCS during debugging mode to do so)

    regards,

  • Hi,

     I tried to use the board file generated by SYSCONFIG  on the simple peripheral example.

    The steps are as follows:

    1.Create a new simple peripheral project

    2.Copy board.c and board.h in startup Folders

    3.Add the code for "Crypto" in  board.c.

    But I don't know how to add the correct code for "TRNG".

    No matter how I change it, the compilation will be wrong

    Here is the modified project file:

    7510.empty_CC2640R2_LAUNCHXL_tirtos_ccs.zip

    I would be very grateful for your help!

    regards,

    Tdy

  • Hi,

    My apologies for the delayed answer, I'm currently debugging your code.

    I can't reproduce your issue as I mentioned in previous response, the code doesn't pass compilation for me due to the wrong implementation of the TRNG include. I'm in touch with the right expert to help you on this one.

    Regards,

  • Hi,

    Did you succeed to implements the modification on the CC2640R2_LAUNCHXL.c of your project to fit with the CC2640R2_LAUNCHXL.c of the empty project of the SDK?

    In particularly on the TRNG section?

    Regards,

  • Hi,Guillaume

     The problem persists, and I'm waiting for your reply while I work on other tasks, which are frustratingly also experiencing very basic problems. (You can read my other posts)


    Most of the work these days is in solving development tool problems rather than in my own application, and without the help of TI engineers, beginners can't solve these problems by themselves.

    Can you give some advice on how to solve the problems you are currently encountering?

    Regards,

    TDY

  • Hi,

    I take your feedback in consideration, make sure to open a new thread for each issue you will face.

    Concerning the one mentioned on this thread, I'll suggest you to try again with this empty.c (download it below) project which I modified to pass the compilation with your features.

    8883.empty_CC2640R2_LAUNCHXL_tirtos_ccs.zip

    Regards,

  • Hi,Guillaume

    Thank you very much for your reply and sorry for taking up your work time.

    I compiled the code you provided and they run successfully.

    I'm reading the TRNG part of the documentation and will follow up with you later.

    I am trying to port the board files to the "Simple Peripherals" project.

    Regards,

    Tdy