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: RSM package - trouble in properly initializing GPIOs

Part Number: CC2640R2F

Hi

I have a custom board with the RSM (10 GPIO pin) package. I am trying to make the GPIOs work properly by making appropriate modifications (shown below) to the board files. Compilation is error free but I am not able to put the GPIOs in the state that I want to. 

I modified the empty_CC2640R2_LAUNCHXL_tirtos_ccs project. 

const PIN_Config BoardGpioInitTable[] = {
    PIN_TERMINATE
};

Commented out the Board_initHook since it did not seem relevant and also it uses a GPIO pin that is not present in the package.

/*
 *  ======== CC2640R2_LAUNCHXL_initGeneral ========
 */
void CC2640R2_LAUNCHXL_initGeneral(void)
{
    Power_init();

    if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) {
        /* Error with PIN_init */
        while (1);
    }

    /* Perform board-specific initialization */
//    Board_initHook();
}

GPIO_PinConfig gpioPinConfigs[] = {

    GPIOCC26XX_DIO_02 | GPIO_DO_NOT_CONFIG,  /* FXTH_BGND */
    GPIOCC26XX_DIO_07 | GPIO_DO_NOT_CONFIG,  /* FXTH_RST */

};

typedef enum CC2640R2_LAUNCHXL_GPIOName {
    CC2640R2_LAUNCHXL_GPIO_FXTH_BGND = 0,
    CC2640R2_LAUNCHXL_GPIO_FXTH_RST,
    CC2640R2_LAUNCHXL_GPIOCOUNT
} CC2640R2_LAUNCHXL_GPIOName;

Commented out existing definitions that pointed to IOID_2 and IOID_7

/* UART Board */
//#define CC2640R2_LAUNCHXL_UART_RX               IOID_2          /* RXD */

/*LEDs*/
#define CC2640R2_LAUNCHXL_PIN_GLED              PIN_UNASSIGNED //was IOID_7

And, created these two new definitions

#define FXTH_RST                                IOID_7
#define FXTH_BGND                               IOID_2

In the main thread, I do the following:

void *mainThread(void *arg0)
{
    /* 1 second delay */
    uint32_t time = 1;

    /* Call driver init functions */
    GPIO_init();

    GPIO_setConfig(FXTH_BGND, GPIO_CFG_OUT_STD|GPIO_CFG_OUT_HIGH);
    GPIO_setConfig(FXTH_RST, GPIO_CFG_OUT_STD|GPIO_CFG_OUT_LOW);


    while (1) {
        sleep(time);

        GPIO_write(FXTH_BGND, 1);
        GPIO_write(FXTH_RST, 1);
    }
}

When I measure the voltages at the DIO 2 and the DIO 7 pins, they are not in their intended states. It seems that the GPIO_setConfig and the GPIO_write is having no effect. 

Can you please help me debug this?

Thanks

Tushar

  • Hi Tushar,

    FXTH_BGND & FXTH_RST should map to CC2640R2_LAUNCHXL_GPIO_FXTH_BGND & CC2640R2_LAUNCHXL_GPIO_FXTH_RST respectively.  Please further review the default Board.h file and let me know whether this resolves your issue.  I also suggest looking through the "Running the SDK on Custom Hardware" section of the BLE-Stack User's Guide.

    Regards,
    Ryan