Menu Close

Using PetaLinux echo to Implement GPIO for Device Tree Driver

This article talks about how to use the echo command in user space to implement GPIO for a device tree driver.

For related subjects, please refer to the SOC Table of Contents.


We will now start testing and configuring the system. We can start by mounting both the SD card partitions.

cd /mnt
mkdir sd_1
mount /dev/mmcblk0p1 /mnt/sd_1
mkdir sd_2
mount /dev/mmcblk0p2 /mnt/sd_2

As we can see, both the partitions are now successfully mounted and accessible.

We can now test to see if the /dev directory has successfully loaded the fii-dt-driver driver by executing the following:

cd /mnt/sd_2
ls -l /dev/fii-dt-driver

If it exists, it means that the driver was successfully loaded.

Next, we will go on to set up the DDR by using the following commands:

echo d 0000 > /dev/fii-dt-driver

Posted in Textbook and Training Project

Related Articles

Leave a Reply

Your email address will not be published.

Leave the field below empty!