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.

RTOS/LAUNCHXL-CC26X2R1: PIN module for SYS_CFG

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: SYSCONFIG

Tool/software: TI-RTOS

Hi,

We use the project_zero to develop our application on latest SDK(syscfg_preview version).

We would like add the input pin(DIO11) into project_zero, but we always got high level for DIO11(we already connect DIO11 to ground). please see the following photo. 

For SYS_CFG setting, please refer to following photo:

For modification code:

+/* Pin driver handles */
+static PIN_Handle QRMInputPinHandle;
+static PIN_State QRMInputPinState;
+
+
+PIN_Config QRMInputPinTable[] = {
+ QRM_SYS_ON_DET | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
+ PIN_TERMINATE
+};

static void ProjectZero_init(void)

{

+
+
+ QRMInputPinHandle = PIN_open(&QRMInputPinState, QRMInputPinTable);
+ if(!QRMInputPinHandle)
+ {
+ Log_error0("Error initializing QRM input pins");
+ Task_exit();
+ }
+
+
+ uint32_t IoInit = PIN_getInputValue(QRM_SYS_ON_DET);
+
+
+ if(IoInit)
+ {
+ Log_info0("High");
+
+ }
+ else
+ {
+ Log_info0("Low");
+ }
+

}

Do you have any suggestions to us?

Thank.

BR

Trevor

  • Hi Trevor,

    Did you build the project in order to trigger SysConfig to generate the configuration code? Can you check the gpioPinConfigs array in Board.c/.h (and share a picture) to ensure that the gpio was configured correctly?

    Thanks,
    Alexis
  • Hi Alexis, 

    About Board.c/.h, please see the following photos. in this example, it uses the PIN module(not GPIO module). I also found one thing that it doesn't contain PIN module driver example in SDK exmpale(ti/simplelink_cc13x2_26x2_sdk_3_10_00_53/examples/syscfg_preview/rtos/CC26X2R1_LAUNCHXL/drivers).

    For Board.h

    For Board.c 

    Thanks.

    BR

    Trevor

  • Add more information, if I run the example(/examples/syscfg_preview/rtos/CC26X2R1_LAUNCHXL/drivers/gpiointerrupt).
    Regarding DIO11, it can work properly. but it uses the GPIO module(not PIN module).
    Thanks.

    BR
    Trevor
  • Hi Alexis,

    Based on previous SYS_CFG, if I just change PIN module to GPIO module, the ProjectZero can work properly. It seems that PIN module can't work with SYS_CFG?

    Could you help to check? 

    static void ProjectZero_init(void)
    {
    
        GPIO_init();
        GPIO_setConfig(QRM_SYS_ON_DET, GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING);
    
    
        if(!GPIO_read(QRM_SYS_ON_DET))
        {
            Log_error0("QRM_SYS_ON_DET LOW !!!!!!");
        }
    
    
    }

    Thanks.

    BR

    Trevor

  • Hi Alexis,

    Could you reproduce this issue on your side???

    Thanks.

    BR

    Trevor

  • Hi 

    Do you have any update?

    BR

    Trevor

  • Hi Alexis,

    Could you help to update the status about this thread?

    Thanks.

    BR

    Trevor

  • Hi Trevor, 

    I'm glad you were able to get your project working with the GPIO module. 

    As for the pin module...have you tried using the BoardGpioInitTable[] created by sys_cfg in Board.c/.h instead of the one you created when performing your Pin_open() function call? 

    Do you get any errors?

    Thanks,

    Alexis

  • Hi Alexis, 

    Thanks for your reply, about the following code, if I replace QRM_SYS_ON_DET with Board_PIN6, the PIN module will work. 

    But I think the "QRM_SYS_ON_DET" macro is more readable than "Board_PIN6", how to configure the macro name in SYS_CFG(for example: Board_PIN_Button0 and Board_PIN_GLED)?

    +/* Pin driver handles */
    +static PIN_Handle QRMInputPinHandle;
    +static PIN_State QRMInputPinState;
    +
    +
    +PIN_Config QRMInputPinTable[] = {
    + Board_PIN6 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
    + PIN_TERMINATE
    +};
    
    static void ProjectZero_init(void)
    
    {
    
    +
    +
    + QRMInputPinHandle = PIN_open(&QRMInputPinState, QRMInputPinTable);
    + if(!QRMInputPinHandle)
    + {
    + Log_error0("Error initializing QRM input pins");
    + Task_exit();
    + }
    +
    +
    + uint32_t IoInit = PIN_getInputValue(Board_PIN6);
    +
    +
    + if(IoInit)
    + {
    + Log_info0("High");
    +
    + }
    + else
    + {
    + Log_info0("Low");
    + }
    +
    
    }

    Thanks.

    BR

    Trevor

  • Hi Trevor,

    Using SYS_CFG, no this isn't really possible. To do this, you would have to add it to the defines in Board.h

    /*
     *  ======== GPIO ========
     */
    
    #define Board_BUTTON0          0
    #define Board_BUTTON1          1
    #define Board_LED0                  2
    #define Board_LED1                  3
    #define Board_GPIO0                4

    But any changes you make yourself to Board.c or Board.h will be overwritten next time you build SYS_CFG.

    Basically, if you want to change this you would have to remove SYS_CFG from your project and configure your Board.c or Board.h yourself. 

    Thanks,

    Alexis

  • Hi Alexis, 

    If you open the SYS_CFG file with a text editor, you can see the macro name is defined in pinInstance.name field. So I think TI should add this field in System Configuration Editor(Just a suggestion).

    Thanks.

    BR

    Trevor