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: Simple Peripheral works only in ccs debug

Part Number: CC2640R2F


Hello,

I need help with simple_peripheral.

I created a project using simple_peripheral as a base.

The project works correctly when being programmed using ccs debug.

When programming the hex (or out file) with the flash programmer the bluetooth connection does not maintain the connection.

I have already tested the hardware with smartRF and the signal is ok. Transmission occurs without errors.

Does anyone know how to solve this problem?

simplelink_cc2640r2_sdk_4_20_00_04
Code Composer Studio Version: 10.1.0.00010

  • Hi Dhiego,

    Have you tested the original simple peripheral from SDK 4.20? Are you able to flash the hex file of the simple peripheral to the Launchpad and test it?

    -kel

  • Hello Markel Robregado,

    I don't have a launchpad with cc2640r2. I am using a custom board without 32kHz crystal and RF single ended.

    If I just import the simple_peripheral, change the build to RCOSC and change the RF config, the symptom already occurs. 

  • Hi Dhiego,

    Are you using an OAD version of simple_peripheral and have you followed all README instructions?  Perhaps the Quick Start Guide and SimpleLink Academy Labs would also be helpful.

    Regards,
    Ryan

  • Hello Ryan,

    I'm using that one:

    simplelink_cc2640r2_sdk_4_20_00_04\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral

  • Hello Ryan Brown1,

    README instructions = Do not have information about how my problem.

    Quick Start Guide and SimpleLink Academy Labs = I'm using BLE5. All the files and functions of BLE4 are different.

    The custom board instruction does not work also.

    Same error of e2e.ti.com/.../928812

  • I did the programming through the CCS and the flash programmer. After I read the flash f both cases.

    The only difference in memory for both settings is in the "0001d000 NV_FLASH" region.

    The ccs memory that works have the values:

    00 00 00 00 02 00 10 00 91 BB 72 2C 76 E1 12 4B
    91 81 E3 69 6B 41 EB F0 03 00 10 00 00 11 01 00

    The flash programmer, version that does not work have:

    00 00 00 00 02 00 10 00 7D 1D 54 B9 A3 87 AD EF
    A0 76 19 54 BF DD 1C BB 03 00 10 00 00 11 01 00

    I already deleted the entire sdk and reinstalled the entire environment. The error always persists, even when creating a project from scratch.

    The latest version of sdk (4.40) also generates the same error.

  • I've asked a BLE expert to comment.  Do you erase all device memory before programming?  There is a BLE5-Stack Quick Start Guide and you may be interested in this Application Report if you aren't already aware of it.

    Regards,
    Ryan

  • Hi Dhiego,

    If you are using a custom board, then you would also need to modify the board files. It would help if you have the launchpad. You can test the example program first with the launchpad then modify the example program to work with the custom board.

    -kel

  • Before programming with flash programmer the command "Force Mass erase" is executed. Nothing changes.

  • Hi Dhiego,

    I read your other post again. Try flashing this hex file using Smart RF Flash Programmer 1.8.0. Use exactly this version.

    This hex file is modified ble5 simple peripheral from SDKv4.10, set 32Khz crystal less, Single Ended RF Ext Bias, IO pins not initialized. So should work with your custom board. The relevant pins for 2 pin JTAG programming are JTAG_TMS, JTAG_TCK, nRESET, GND.

    3771.ble5_simple_peripheral_cc2640r2lp_app.rar

  • Dhiego,

    I'm the engineer assigned to help you.

    If I understand correctly, you are trying to load the same hex file with two different methods but the result is different? Can you please confirm?

    I just want to make sure that you are using the exact same hex, and not the pre-compiled that is included in the SDK.

    Please go through the User's Guide section on how to run the SDK on custom hardware

    Thanks,

    Luis

  • Hello Markel,

    After programming the hex file you sent with flash programmer 1.8.0, I could not detect a bluetooth device.

    The rf setting for my board should be (RF_FE_SINGLE_ENDED_RFP | RF_FE_EXT_BIAS ).

  • Hi Dhiego,

    Can you do this at your side modify the ble5 simple peripheral example program to work for your board. Make sure set it at 32khz crystal less. I am suggesting this to make sure the base example program from the SDK works with your custom board. After modification rebuild all then flash the hex file.

    Make sure you set the correct RF configuration here at CC2640R2_LAUNCHXL.h. If you set this wrong you will have problem with your RF.

    /*
     *  ============================================================================
     *  RF Front End and Bias configuration symbols for TI reference designs and
     *  kits. This symbol sets the RF Front End configuration in ble_user_config.h
     *  and selects the appropriate PA table in ble_user_config.c.
     *  Other configurations can be used by editing these files.
     *
     *  Define only one symbol:
     *  CC2650EM_7ID    - Differential RF and internal biasing
                          (default for CC2640R2 LaunchPad)
     *  CC2650EM_5XD    – Differential RF and external biasing
     *  CC2650EM_4XS    – Single-ended RF on RF-P and external biasing
     *  CC2640R2DK_CXS  - WCSP: Single-ended RF on RF-N and external biasing
     *                    (Note that the WCSP is only tested and characterized for
     *                     single ended configuration, and it has a WCSP-specific
     *                     PA table)
     *
     *  Note: CC2650EM_xxx reference designs apply to all CC26xx devices.
     *  ==========================================================================
     */
    #define CC2650EM_7ID

    At CC2640R2F_LAUNCHXL.c, comment out the pin initialization. Like this below.

    const PIN_Config BoardGpioInitTable[] = {
    
        //CC2640R2_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,       /* LED initially off */
        //CC2640R2_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,       /* LED initially off */
        //CC2640R2_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS,          /* Button is active low */
        //CC2640R2_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS,          /* Button is active low */
        //CC2640R2_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN,  /* External flash chip select */
        //CC2640R2_LAUNCHXL_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN,                                              /* UART RX via debugger back channel */
        //CC2640R2_LAUNCHXL_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,                         /* UART TX via debugger back channel */
        //CC2640R2_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN,                                            /* SPI master out - slave in */
        //CC2640R2_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN,                                            /* SPI master in - slave out */
        //CC2640R2_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN,                                             /* SPI clock */
    
        PIN_TERMINATE
    };

    -kel

  • Exactly. When programming with the ccs the code works, but when using the hex with the flash programmer the bluetooth does not work.

    I am using the HEX that is created at the end of the compilation in the "FlashROM_StackLibrary_RCOSC" folder.

    The OUT file have the same problem.

    I already followed all the guide for custom boards. The duplication of boards files doesn't work as explanned at  e2e.ti.com/.../928812

    Luis M said:

    Dhiego,

    I'm the engineer assigned to help you.

    If I understand correctly, you are trying to load the same hex file with two different methods but the result is different? Can you please confirm?

    I just want to make sure that you are using the exact same hex, and not the pre-compiled that is included in the SDK.

    Please go through the User's Guide section on how to run the SDK on custom hardware

    Thanks,

    Luis

  • Hello Markel,

    In the initialization I used:

      Power_init();
    
      if (PIN_init(RCGpioInitTable) != PIN_SUCCESS) {
          while (1);
      }

    const PIN_Config RCGpioInitTable[] = {

    CC2640R2_CLOSE_PIN | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS,
    CC2640R2_OPEN_PIN | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS,
    CC2640R2_LIGHT_PIN | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS,
    CC2640R2_LED_PIN | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,

    PIN_TERMINATE
    };

    I removed "Board_initHook()" because I dont have external flash.

    This problem doesn't smell like something related to the functional code because the product works when programmed with CCS.

    This is looking like linker configuration.

  • Markel,

    I commented RCGpioInitTable and removed "Board_initKeys(SimplePeripheral_keyChangeHandler)".

    The bluetooth worked.

  • The file CC2640R2_LAUNCHXL.c also need a fix.

    The USE_RCOSC wasn't applied in this file.

    const PowerCC26XX_Config PowerCC26XX_config = {
    .policyInitFxn = NULL,
    .policyFxn = &PowerCC26XX_standbyPolicy,
    .calibrateFxn = &PowerCC26XX_calibrate,
    .enablePolicy = true,
    //#ifdef USE_RCOSC
    .calibrateRCOSC_LF = true,
    //#else
    // .calibrateRCOSC_LF = false,
    //#endif
    .calibrateRCOSC_HF = true,
    };

  • The gpio was not the problem.

    The "calibrateRCOSC_LF=True" fixed the flash programmer problem. Now the HEX file works with flash programmer.

    But it only works with the 4-wire jtag board.

    The 2-wire jtag board continues with the problem. Only an old HEX file compiled with an unkown SDK works with both boards.

    Now we return to the initial problem described at:
    e2e.ti.com/.../3628621

  • The 2-wire JTAG board always returns the warnings at page 28 and 30.

    >Start flash erase ...

    >Erase finished successfully.

    >Start flash programming ...

    >Programming finished successfully.

    >Start flash verify ...

    >Skip verification of unassigned page: 28.

    >Skip verification of unassigned page: 30.

    >Page: 0 verified OK.

    >Page: 1 verified OK.

    >Page: 2 verified OK.

    >Page: 3 verified OK.

    >Page: 4 verified OK.

    >Page: 5 verified OK.

    >Page: 6 verified OK.

    >Page: 7 verified OK.

    >Page: 8 verified OK.

    >Page: 9 verified OK.

    >Page: 10 verified OK.

    >Page: 11 verified OK.

    >Page: 12 verified OK.

    >Page: 13 verified OK.

    >Page: 14 verified OK.

    >Page: 15 verified OK.

    >Page: 16 verified OK.

    >Page: 17 verified OK.

    >Page: 18 verified OK.

    >Page: 19 verified OK.

    >Page: 20 verified OK.

    >Page: 21 verified OK.

    >Page: 22 verified OK.

    >Page: 23 verified OK.

    >Page: 24 verified OK.

    >Page: 25 verified OK.

    >Page: 26 verified OK.

    >Page: 27 verified OK.

    >Page: 29 verified OK.

    >Page: 31 verified OK.

    >Verification finished successfully.

    >Reset target ...

    >Reset of target successful.

  • Dhiego Silva said:

    But it only works with the 4-wire jtag board.

    The 2-wire jtag board continues with the problem. Only an old HEX file compiled with an unkown SDK works with both boards.

    I had no problem programming a custom board with 2 wire JTAG. But when I try to program another Launchpad with 2 wire JTAG I encounter some issues. It will work though with 4 wire JTAG. I suspected this has something to do with the circuitry of the Launchpad. Maybe shortening the JTAG wires will work.

    -kel

  • Dhiego,

    Has your issue been resolved?

    Was the key calibrateRCOSC_LF=True to make the hex work?

    Thanks,

    Luis

  • It fixed one issue. Now I have another one with the 2 and 4 wire jtag.

    Should I close this question and open another one for the jtag?

  • For clarity, that might be best. Please do. Can you please mark this thread as resolved?

    Thanks,
    Luis