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 misfunction with Ruby On Rails

Other Parts Discussed in Thread: AM3352

Hi everyone

I'm developing a C-written application on a custom board based on AM3352 microprocessor and equipped with a customized linux poky distribution. On the board is also running a ruby on rails application acting as a web server.

My application writes out a bit stream toward another board and, to synchronize this output, reads the value of a gpio pin controlled by the board that receives bit stream acting as an authorization to write:

0 = can write;

1 = don't write;

What I see is: in stationary conditions everything works well but when I start rails application or choose another page to be displayed via web browser, the electric value of the pin controlled by the extern board goes to ground for about 500ms so is read a 0 value and starts an unwanted sequence of data stream packets sending.

The gpio pin on the AM3552 board is correctly configured via device tree file and is correctly (I think) exported by the application and can be seen in /sys/class/gpio/gpio44 directory. Content of value file varies accondingly to what I see on oscilloscope. I also tryed both mapping /dev/mem file into memory with mmap() and reading directly from value file, but the behaviour is the same.

What I think is that rails can “override” gpio settings or is messing with memory but both things seems to me very unlikely in a linux environment.

Any one has some suggestions about where to debug?

Thank in advance, Mirko.