CreatorDev / board-test

This repository contains simple scripts for testing peripherals
0 stars 4 forks source link

Fix or improve GPIO pin tests #19

Closed nikhil-zinjurde-imgtec closed 7 years ago

nikhil-zinjurde-imgtec commented 7 years ago

The following tests do not seem to work properly or give any valid results

Tested by finding out the MFIO number using command:

ls /sys/class/gpio/
export       gpiochip16   gpiochip48   gpiochip64   unexport
gpiochip0    gpiochip32   gpiochip504  gpiochip80

Then, running each of the above tests, e.g.:

./test_get_pin.sh 16
./test_set_pin.sh 80 1
./test_toggle_pin.sh -i 504 -d 10000
ghost commented 7 years ago

@nikhil-zinjurde-imgtec These gpios are already used by other drivers. GPIO 16 is used by the sdhost controller as SDHOST_CMD, GPIO 80 is the AUDIO_PWR_ON and GPIO 504 is one the LED's. Do not use ls /sys/class/gpio this will give you only the list of GPIO's currently exported. Instead, have a look at the schematics. Could you try with gpio 21 (MIKROBUS 1 INT) ?

nikhil-zinjurde-imgtec commented 7 years ago

@francois-berder-imgtec the reason I checked what's inside /sys/class/gpio is because the tests themselves use this to get, set and toggle gpio.

And anyway, trying with gpio 21 does not give any proper feedback i.e. get_pin should have returned the pin status, but the test just doesn't do anything

Ham22 commented 7 years ago

@nikhil-zinjurde-imgtec this will never work and is not expected to. The board-test package is just a port of production functional tests. This test is only used to test spare gpio loopback pairs that can't be tested functionally.

For some boards we create a secondary device tree which doesn't allocate the io to specific drivers but this can't be done for all pins as then the board wouldn't boot and peripherals wouldn't work.

Note that in general some of these tests will only work in the production JIG, for example gpio loopback, uart loopback, audio loopback tests. Basically any test that needs the JIG to create a loopback.

This comment goes for all the tests in this repo, please review and close any tickets that are caused by this.