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.

CC3220SF: GPIO_04 failed, but GPIO_17 success

Part Number: CC3220SF


Hi,

   I am using AWS_demo project. I would like to control GPIO_04. However, the system crash whenever I call GPIO_write( GPIOCC32XX_GPIO_04).

   It is weird that if I change GPIO_04 to another pin GPIO_17, it works well.

Following is my code of GPIO configuration for using GPIO_04. This cause system crash. If I remark GPIO_04 and unremark GPIO_17, the system works well when calling GPIO_write( GPIOCC32XX_GPIO_17).

GPIO_PinConfig gpioPinConfigs[] = {
/* input pins with callbacks */
/* CC3220SF_LAUNCHXL_GPIO_SW2 */
GPIOCC32XX_GPIO_13 | GPIO_CFG_INPUT | GPIO_CFG_IN_INT_NONE,
/* CC3220SF_LAUNCHXL_GPIO_SW3 */
// GPIOCC32XX_GPIO_04 | GPIO_CFG_INPUT | GPIO_CFG_IN_INT_NONE,

/* output pins */
/* CC3220SF_LAUNCHXL_GPIO_LED_D6 */
// GPIOCC32XX_GPIO_17 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
/* CC3220SF_LAUNCHXL_GPIO_LED_D7 */
GPIOCC32XX_GPIO_04 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
/* CC3220SF_LAUNCHXL_GPIO_LED_D5 */
GPIOCC32XX_GPIO_11 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
};

Martin

  • Hi Martin,

    GPIO_write() is expecting an index of the struct gpioPinConfigs (like CONFIG_GPIO_0), not the pin identification. You are likely referencing a reserved memory location by mistake. Please see the TI Drivers API documentation in the CC32xx SDK, or any GPIO example in the CC32xx SDK for correct usage.

    Also note that pin 59 (GPIO4) on the LaunchPad has a voltage divider on-board for ADC usage. You would have to modify the LaunchPad before you can use it as a GPIO output. This would not cause a system fault though, just unexpected output behavior.

    Best regards,

    Sarah