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: CC32XX, cannot read all GPIO pins

Part Number: CC3220SF


I have a program based on the local_ota example from simplelink_cc32xx_sdk_5_20_00_06.

I am now using simplelink_cc32xx_sdk_5_30_00_08 and CCS 11

When I added 4 new switches to the software, only 1 got operational. Running an old program on the same hardware the buttons work. There must be an conflict somewhere that I cannot find.

GPIO12, GPIO13 & GPIO15 (pin 3,4,6) works, 

GPIO5, GPIO6 & GPIO7 (pin 60,61,62)) does not

This is the syscfg file:

/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "CC3220SF" --package "Default" --part "Default" --rtos "tirtos" --product "simplelink_cc32xx_sdk@5.30.00.08"
* @versions {"tool":"1.10.0+2163"}
*/

/**
* Import the modules used in this configuration.
*/
const DriverLib = scripting.addModule("/ti/devices/DriverLib");
const Display = scripting.addModule("/ti/display/Display");
const Display1 = Display.addInstance();
const ADC = scripting.addModule("/ti/drivers/ADC", {}, false);
const ADC1 = ADC.addInstance();
const Board = scripting.addModule("/ti/drivers/Board");
const Crypto = scripting.addModule("/ti/drivers/Crypto");
const Crypto1 = Crypto.addInstance();
const DMA = scripting.addModule("/ti/drivers/DMA");
const GPIO = scripting.addModule("/ti/drivers/GPIO");
const GPIO1 = GPIO.addInstance();
const GPIO2 = GPIO.addInstance();
const GPIO3 = GPIO.addInstance();
const GPIO4 = GPIO.addInstance();
const GPIO5 = GPIO.addInstance();
const GPIO6 = GPIO.addInstance();
const GPIO7 = GPIO.addInstance();
const GPIO8 = GPIO.addInstance();
const GPIO9 = GPIO.addInstance();
const PWM = scripting.addModule("/ti/drivers/PWM", {}, false);
const PWM1 = PWM.addInstance();
const Power = scripting.addModule("/ti/drivers/Power");
const SPI = scripting.addModule("/ti/drivers/SPI");
const Timer = scripting.addModule("/ti/drivers/Timer");
const Timer1 = Timer.addInstance();
const Timer2 = Timer.addInstance();
const Timer3 = Timer.addInstance();
const Watchdog = scripting.addModule("/ti/drivers/Watchdog");
const Watchdog1 = Watchdog.addInstance();
const SimpleLinkWifi = scripting.addModule("/ti/drivers/net/wifi/SimpleLinkWifi");
const JSON = scripting.addModule("/ti/utils/JSON");

/**
* Write custom configuration values to the imported modules.
*/
Display1.$name = "CONFIG_Display_0";
Display1.useUART2 = false;
Display1.uart.$name = "CONFIG_UART_0";
Display1.uart.useDMA = true;
Display1.uart.uart.$assign = "UART0";
Display1.uart.uart.txPin.$assign = "ball.55";
Display1.uart.uart.rxPin.$assign = "ball.57";
Display1.uart.uart.txDmaChannel.$assign = "UDMA_CH9";
Display1.uart.uart.rxDmaChannel.$assign = "UDMA_CH8";

ADC1.$name = "CONFIG_ADC_0";
ADC1.adc.adcPin.$assign = "ball.58";

Crypto1.$name = "CONFIG_Crypto_0";

GPIO1.mode = "Output";
GPIO1.$name = "CONFIG_GPIO_LED_0";
GPIO1.outputStrength = "Low";
GPIO1.gpioPin.$assign = "ball.21";

GPIO2.$name = "CONFIG_GPIO_LED_1";
GPIO2.mode = "Output";
GPIO2.outputStrength = "High";
GPIO2.gpioPin.$assign = "ball.1";

GPIO3.$name = "CONFIG_GPIO_LED_2";
GPIO3.mode = "Output";
GPIO3.outputStrength = "High";
GPIO3.gpioPin.$assign = "ball.2";

GPIO4.$name = "CONFIG_GPIO_BUTTON_1";
GPIO4.pull = "Pull Down";
GPIO4.gpioPin.$assign = "ball.3";

GPIO5.$name = "CONFIG_GPIO_BUTTON_2";
GPIO5.pull = "Pull Down";
GPIO5.gpioPin.$assign = "ball.4";

GPIO6.$name = "CONFIG_GPIO_BUTTON_3";
GPIO6.pull = "Pull Down";
GPIO6.gpioPin.$assign = "ball.60";

GPIO7.$name = "CONFIG_GPIO_BUTTON_4";
GPIO7.pull = "Pull Down";
GPIO7.gpioPin.$assign = "ball.6";

GPIO8.$name = "CONFIG_GPIO_BUTTON_5";
GPIO8.pull = "Pull Down";
GPIO8.gpioPin.$assign = "ball.61";

GPIO9.$name = "CONFIG_GPIO_BUTTON_6";
GPIO9.pull = "Pull Down";
GPIO9.gpioPin.$assign = "ball.62";

PWM1.$name = "CONFIG_PWM_0";
PWM1.timer.$assign = "Timer2";
PWM1.timer.pwmPin.$assign = "ball.64";

Power.ioRetentionShutdown = ["GRP_1"];
Power.parkPins.$name = "ti_drivers_power_PowerCC32XXPins0";

Timer1.$name = "CONFIG_TIMER_0";
Timer1.timerType = "32 Bits";
Timer1.timer.$assign = "Timer0";

Timer2.$name = "CONFIG_TIMER_1";
Timer2.timer.$assign = "Timer1";

Timer3.$name = "CONFIG_TIMER_2";
Timer3.timer.$assign = "Timer1";

Watchdog1.$name = "CONFIG_WATCHDOG_0";
Watchdog1.watchdog.$assign = "WATCHDOG0";

/**
* Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
* version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
* re-solve from scratch.
*/
ADC1.adc.$suggestSolution = "ADC0";

  • Hi Finn,

    Can you do a comparison of the generated output files from Syscfg to find what is different between the two versions?

    BR,

    Vince 

  • Thank you, there are many differences between these files. Originally the pin configuration was created with the Pinmux program back in 2015. The file CC3220SF_LAUNCHXL.c has been modified to be compiled with later versions of the CCS and SDK.

    The old program is now compiled with CCS10 and  CC32xx SDK 4.20.00.07, the buttons can be polled with GPIO_Read(). Originally they were configured to use interrupt.

    I am now trying to get the program updated to use the .syscfg with CCS 11 and latest SDK. Started from scratch with the local_ota example from simplelink_cc32xx_sdk_5_20_00_06. The program is running but not all buttons are operational.

    Regards

    Finn

  • Hi Finn,

    I believe there was something additional you need to do in the latest SDK to get button interrupts to behave as expected. I am looping in a colleague to help here.

  • I have not tried to use interrupt, we have some experience from the older SW that it may trigger multiple times dependent on the quality of the switch.

    But I tried to switch between "pull up" and "pull down" and I can read back the expected value. But still no sensitivity to the input, and I can read thiese with GPIO_Read in the older SW.

    I am afraid that I have an error in the syscfg file.

    I do have a Warning when I compile and link he program, I have not found any fix for this: But the program compiles and link!

    Description Resource Path Location Type
    Invalid project path: Include path not found (C:\ti\simplelink_cc32xx_sdk_5_30_00_08\.;C::\ti\ccs1100\xdctools_3_62_01_16_core\packages). MnsCC32xxWiFi pathentry Path Entry Problem

  • the invalid project path is not an issue.

    Can you take the syscfg from a 5.30 example and do your changes on top of it.

    5.30 added the support for Button (and LEDs) in syscfg.  

  • Thanks,

    I started with the empty demo and removed the connection to the LaunchPad hardware and added a few GPIOs

    /**
    * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
    * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
    * @cliArgs --device "CC3220SF" --package "Default" --part "Default" --rtos "tirtos" --product "simplelink_cc32xx_sdk@5.30.00.08"
    * @versions {"tool":"1.10.0+2163"}
    */

    /**
    * Import the modules used in this configuration.
    */
    const GPIO = scripting.addModule("/ti/drivers/GPIO");
    const GPIO1 = GPIO.addInstance();
    const GPIO2 = GPIO.addInstance();
    const GPIO3 = GPIO.addInstance();
    const GPIO4 = GPIO.addInstance();
    const GPIO5 = GPIO.addInstance();
    const GPIO6 = GPIO.addInstance();
    const Power = scripting.addModule("/ti/drivers/Power");

    /**
    * Write custom configuration values to the imported modules.
    */
    GPIO1.mode = "Output";
    GPIO1.$name = "CONFIG_GPIO_LED_GREEN";
    GPIO1.gpioPin.$assign = "ball.2";

    GPIO2.$name = "CONFIG_GPIO_LED_RED";
    GPIO2.mode = "Output";
    GPIO2.gpioPin.$assign = "ball.1";

    GPIO3.$name = "CONFIG_GPIO_BUTTON_1";
    GPIO3.gpioPin.$assign = "ball.3";

    GPIO4.$name = "CONFIG_GPIO_BUTTON_2";
    GPIO4.gpioPin.$assign = "ball.4";

    GPIO5.$name = "CONFIG_GPIO_BUTTON_3";
    GPIO5.gpioPin.$assign = "ball.60";

    GPIO6.$name = "CONFIG_GPIO_BUTTON_4";
    GPIO6.gpioPin.$assign = "ball.6";

    Power.parkPins.$name = "ti_drivers_power_PowerCC32XXPins0";

    The empty.c was modified to :

    void *mainThread(void *arg0)
    {
    /* 1 second delay */
    uint32_t time = 1;
    int i1,i2,i3,i4;
    int ibutt0,ibutts;

    /* Call driver init functions */
    GPIO_init();
    // I2C_init();
    // SPI_init();
    // UART_init();
    // Watchdog_init();

    /* Configure the LED pin */
    GPIO_setConfig(CONFIG_GPIO_LED_GREEN, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
    GPIO_setConfig(CONFIG_GPIO_LED_RED, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);

    /* Turn on user LED */
    GPIO_write(CONFIG_GPIO_LED_GREEN, CONFIG_GPIO_LED_ON);
    GPIO_write(CONFIG_GPIO_LED_RED, CONFIG_GPIO_LED_OFF);
    i1 = GPIO_read(CONFIG_GPIO_BUTTON_1);
    i2 = GPIO_read(CONFIG_GPIO_BUTTON_2);
    i3 = GPIO_read(CONFIG_GPIO_BUTTON_3);
    i4 = GPIO_read(CONFIG_GPIO_BUTTON_4);
    ibutt0 = i1+i2+i3+i4;

    while (1) {
    sleep(time);
    GPIO_toggle(CONFIG_GPIO_LED_GREEN);

    i1 = GPIO_read(CONFIG_GPIO_BUTTON_1);
    i2 = GPIO_read(CONFIG_GPIO_BUTTON_2);
    i3 = GPIO_read(CONFIG_GPIO_BUTTON_3);
    i4 = GPIO_read(CONFIG_GPIO_BUTTON_4);
    ibutts = i1+i2+i3+i4;
    if (ibutts == ibutt0)
    GPIO_write(CONFIG_GPIO_LED_RED, CONFIG_GPIO_LED_OFF);
    else
    GPIO_write(CONFIG_GPIO_LED_RED, CONFIG_GPIO_LED_ON);

    }
    }

    I have sensitivity on buttons 1,2 & 4 but not on button 3(pin 60) .

    I do have pin 60 working on older SW with the same hardware?

    Regards

    Finn

  • Thanks, I used an old version of the empty demo and used my version of the pinmux output. I then realized that the drawings I am using did not match the hardware. Using the correct drawings did fix the problem.