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.

GPIO Configuration as Output not working with PSP

Other Parts Discussed in Thread: OMAPL138

Hi,

I'm using the following tools:

- CCSv5

- PSP 01.30.01

- DSP/BIOS 5.41.11.38

- EDMA3 01.11.03.01

 

I started with the PSP included GPIO example which has the GPIO4[0] setup as Input. I was able to build this example and ran it successful. Now I was trying to modifiy this example to toggle an another pin as output, GPIO2[0] - but this fail and at the moment I don't know why..

See the code i used below:

#define GPIO_BANK_2               2u
#define GPIO2_0_PIN                 33u

sysRegs->PINMUX6 = ((CSL_SYSCFG_PINMUX6_PINMUX6_31_28_GPIO2_0) << (CSL_SYSCFG_PINMUX6_PINMUX6_31_28_SHIFT));

/* lock the pinmux registers                                              */
sysRegs->KICK0R = 0x00000000;
sysRegs->KICK1R = 0x00000000;

gpioParams.instNum = 1;
gpioParams.BankParams[GPIO_BANK_2].inUse = Gpio_InUse_No;
gpioParams.BankParams[GPIO_BANK_2].hwiNum  = 8u;
gpioParams.BankParams[GPIO_BANK_2].PinConfInfo[0].inUse = Gpio_InUse_No;

/* open the GPIO driver to get a handle to it */
gpio1 = Gpio_open(&gpioParams);

PWRM_setDependency(PWRM_RSRC_GPIO);

/* Configure GPIO(GPIO2_0_PIN) as an output                                */
pinCmdArg.pin   = GPIO2_0_PIN;
pinCmdArg.value = Gpio_Direction_Output;
Gpio_setPinDir(gpio1, &pinCmdArg);

pinCmdArg.value = PinVal;
Gpio_setPinVal(gpio1, &pinCmdArg);

while(1)  
{       
PinVal = !PinVal;       
pinCmdArg.value = PinVal;      
Gpio_setPinVal(gpio1, &pinCmdArg);      
TSK_sleep(2000);
 }

 What I'm doing wrong here?

Maybe, has anybody an working examplecode for this? 

 

Thanks a lot for your help in advanced

Christian