Linux gpio debug log (am335x)

Source: Internet
Author: User

Mail: bookworepeng@Hotmail.com

QQ: 196568501

Author: drivemonkey

Undertake various embedded outsourcing projects (phone: 13410905075)

Two tools are available for Linux to debug gpio.

Dubugfs

The other is the gpio driver framework of Linux.

First, debugfs's usage for gpio debugging

1. debugfs on Mount

 
Mount-T debugfs/sys/kernel/debug

2. Find the Pin Multi-path configuration option

My path is ../debug/omap_mux

You can view all the configurations of the current gpio.

Another method is to debug in the driver framework provided by the Linux kernel.

1. Find the file interface path provided by the driver to the application

/Sys/class/gpio

The usage of each file in gpio is as follows:

 
$ Echo 30>/sys/class/gpio/Export
Change the gpio pin direction to in/out
 
$ Echo "out">/sys/class/gpio/gpio30/Direction

Or

 
$ Echo "in">/sys/class/gpio/gpio30/Direction
Change the value
 
$ Echo 1>/sys/class/gpio/gpio30/value

Or

 
$ Echo 0>/sys/class/gpio/gpio30/value
Unexport the gpio pin
 
$ Echo 30>/sys/class/gpio/unexport

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.