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.

TMS320F280049: GPIO configuration as SCI-A TX And RX

Part Number: TMS320F280049
Other Parts Discussed in Thread: SYSCONFIG

Hi Everyone,

I am trying to configure GPIO 28 and GPIO 29 as RX and TX with below example code snippet:

GPIO_SetupPinMux(28, GPIO_MUX_CPU1, 1);
GPIO_SetupPinOptions(28, GPIO_INPUT, GPIO_PUSHPULL);
GPIO_SetupPinMux(29, GPIO_MUX_CPU1, 1);
GPIO_SetupPinOptions(29, GPIO_OUTPUT, GPIO_ASYNC);

But while compiling code i am getting below error:

undefined            first referenced     
  symbol                  in file          
 ---------            ----------------     
 GPIO_SetupPinMux     ./main_Demo_OCP_A.obj
 GPIO_SetupPinOptions ./main_Demo_OCP_A.obj
 
error #10234-D: unresolved symbols remain

I have included header file for respective GPIO's functions that is "f28004x_globalprototypes.h"  but still error is persisting, please let me know if I am doing it in correct way or I need to modify something.

Thanks and Regards,

Tyagi

  • Hello Tyagi,

    Are you trying to use driverlib? Driverlib has no such functions, do you mean to use GPIO_setPadConfig and GPIO_setPinConfig?

  • Hi Amir,

    I was referring above example code from below support file:

    C:\ti\c2000\C2000Ware_4_00_00_00\device_support\f28004x\examples\sci\sci_ex1_echoback

    Since it is giving error, please let me know if we can configure these GPIO's as SCI-A TX And RX using:

    GPIO_setPadConfig()
    GPIO_setPinConfig()

    or 

    Using GpioCtrlRegs.

    Thanks and Regards,

    Tyagi

  • Hello Tyagi,

    I see, you're using the bitfield example, I misunderstood. The functions here are fine, the example builds when I import it, are you using that example or basing your project off it? If you're just creating a project from scratch, then you might have to verify you have the proper Include options, File Search Path options, and the F28x_Project.h #included in your source file where you plan to call the functions.

    Since it is giving error, please let me know if we can configure these GPIO's as SCI-A TX And RX using:

    You can if you plan to use driverlib. Otherwise, if you need to use bitfields then you can try to use the GpioCtrlRegs. I recommend using driverlib/SysConfig since the UI for SysConfig will do additional error checking on configurations you use and will make any future device migrations very easy.

  • Hello Amir,

    Thanks you for suggestions,  I have configured the GPIO's using GpioCtrlRegs with below settings:

     GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 1;  // Set GPIO28 AS SCI-A Rx
     GpioCtrlRegs.GPAODR.bit.GPIO28 = 0;   // Enable pullup on GPIO28
     GpioCtrlRegs.GPADIR.bit.GPIO28 = 0;   // GPIO20 = input
    
     GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 1;  // Set GPIO29 AS SCI-A Tx
     GpioCtrlRegs.GPAQSEL2.bit.GPIO29 = 3; // Enable async on GPIO29
     GpioCtrlRegs.GPADIR.bit.GPIO29 = 1;   // GPIO29 = output

    and we tested on board so its working fine.

    Thanks And Regards

    Tyagi