Test all the RB interfaces in 10 mins in command Line

Refer the Hardware and System reference manual to check out the PIN Numbers and PORT numbers etc. of respective interfaces.

Hardware manual

In case of any doubts you can Ask questions in RuggedBoard forum.

Targeted Hardware

SOM : phyCORE - i.MX 6UL

CB : RuggedBoard - i.MX6UL

Targeted Software

- barebox v2022.02.0

- Linux Mainline Kernel v5.15.35(LTS kernel)

- Yocto 4.0.1 (kirkstone)

Description

  • To test the GPIO Device functionality in Kernel.

Required Hardware

  • RuggedBoard - i.MX6UL

Test Case:

Step-1: To export the gpio

$ echo 43 > /sys/class/gpio/export

Step-2: To set the in/output of the gpio to the file direction.

$ echo out > /sys/class/gpio/gpio43/direction

Step-3: To set the gpio value to 1 (off) , indicating the GPIO pin to be set to a active low level.

$ echo 1 > /sys/class/gpio/gpio43/value

Step-4: To set the gpio value to 0 (on) , indicating the GPIO pin to be set to a active low level.

$ echo 0 > /sys/class/gpio/gpio43/value
  • Here GPIO value can be calculated as :

VALUE = ( GPIO_BANK - 1)*32 + GPIO_Value

VALUE = (2 - 1)*32 + 11

= 32 + 11

= 43

Note : GPIO calculation will vary for board to board crosscheck with boards TRM.

Expected o/p



    root@ruggedboard-imx6ul:~# echo 43 > /sys/class/gpio/export
    root@ruggedboard-imx6ul:~# echo out > /sys/class/gpio/gpio43/direction
    root@ruggedboard-imx6ul:~# echo 1 > /sys/class/gpio/gpio43/value 
    root@ruggedboard-imx6ul:~# echo 0 > /sys/class/gpio/gpio43/value 
    root@ruggedboard-imx6ul:~# echo 1 > /sys/class/gpio/gpio43/value 
********************************************************************************
    


    root@ruggedboard-imx6ul:~# echo 44 > /sys/class/gpio/export
    root@ruggedboard-imx6ul:~# echo out > /sys/class/gpio/gpio44/direction
    root@ruggedboard-imx6ul:~# echo 1 > /sys/class/gpio/gpio44/value 
    root@ruggedboard-imx6ul:~# echo 0 > /sys/class/gpio/gpio44/value 
    root@ruggedboard-imx6ul:~# echo 1 > /sys/class/gpio/gpio44/value 

You can use remaining two user LED or any GPIO PIN mentioned in the Hardware manual with the same method. In case of any doubt post your detailed question into the RuggedBoard forum.

Last updated