Hi,
I am running Colibri VF61 with BSP version 2.6, Qt for Application Development.
I have often use of GPIO Get/Set, ADC Read and PWM Enable Disable in flow of Application.
I use normal file operations to perform above scenarios. A sample code for GPIO Read is given below:
bool GPIO::GetPinStatus()
{
int nPinFile;
int n8retVal;
char caPinValue[5];
char caPortValueFile[50]="";
sprintf(caPortValueFile,"/sys/class/gpio/gpio%d/value",u_n8GPIONumber);
nPinFile=open(caPortValueFile, O_RDONLY);
if(-1 == nPinFile)
{
nGPIOStatus = GPIO_STATUS_UNABLE_TO_OPEN_FILE;
return 0;
}
n8retVal = read(nPinFile, &caPinValue, 1);
if(1 != n8retVal)
{
nGPIOStatus = GPIO_STATUS_UNABLE_TO_READ_FILE;
return 0;
}
n8retVal = close(nPinFile);
return caPinValue[0]-'0';
}
Similar Algorithm is used for all peripherals mentioned below
Issue We are facing is following:
After running the application for some time above mentioned algorithm will have no control over peripherals.
All File operations open,read,write etc returns successful but corresponding GPIOs,ADC and PWM does not respond to algorithm. All other peripherals like UART,SPI,I2C which are not handle file operations from user space are working fine.
What could be the issue?
Am I doing these peripheral operations correctly?
Is it an issue with Linux Image?
Regards,
Aneesh