{"id":234269,"date":"2024-09-29T20:26:35","date_gmt":"2024-09-29T20:26:35","guid":{"rendered":"https:\/\/www.emtrion.de\/gpios-on-emcon-rz-g1x-under-linux-2\/"},"modified":"2024-10-24T07:35:40","modified_gmt":"2024-10-24T07:35:40","slug":"gpios-on-emcon-rz-g1x-under-linux-2","status":"publish","type":"page","link":"https:\/\/www.emtrion.de\/en\/gpios-on-emcon-rz-g1x-under-linux-2\/","title":{"rendered":"GPIOs on emCON-RZ\/G1x under Linux"},"content":{"rendered":"<p>Please see the following table for the translation from baseboard pin to CPU pin:<\/p>\n<p>&nbsp;<\/p>\n<p>Under Linux you can use sysfs to access gpios.<\/p>\n<p>To get access to an GPIO pin, first, write the GPIO number to \/sys\/class\/gpio\/export<\/p>\n<pre class=\"code\">echo 34 [gt] \/sys\/class\/gpio\/export<\/pre>\n<p>Now you should find a directory in \/sys\/class\/gpio to access your GPIO pin. Write in or out to direction to change the direction of the pin:<\/p>\n<pre class=\"code\">echo out [gt] \/sys\/class\/gpio\/gpio34\/direction<\/pre>\n<p>The value (0 for off, 1 for on) of the pin is in the value file. To read or change it, read the file or write to it.<\/p>\n<pre class=\"code\">echo 1 [gt] \/sys\/class\/gpio\/gpio34\/value<\/pre>\n<pre class=\"code\">cat \/sys\/class\/gpio\/gpio34\/value<\/pre>\n<p>The list of GPIO numbers can be found below.<\/p>\n<p>&nbsp;<\/p>\n<p>If the used kernel is compiled with CONFIG_DEBUG_FS you can get a list of the GPIOs with the command:<\/p>\n<pre class=\"code\">cat \/sys\/kernel\/debug\/gpio<\/pre>\n<p>Remark: emtrion compiles the Linux Kernel 4.x for emCON-RZ\/G1x boards with CONFIG_DEBUG_FS.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2><a id=\"verno_3_verno_4_cadun\" name=\"verno_3_verno_4_cadun\"><\/a>emCON-RZ\/G1E on Avari<\/h2>\n<div class=\"level2\">\n<p>There are 8 GPIOs on J27 with a signal level of 3.3V.<\/p>\n<p>&nbsp;<\/p>\n<table class=\"inline\">\n<tbody>\n<tr>\n<th>Connector<\/th>\n<th>Pin<\/th>\n<th class=\"leftalign\">Signal<\/th>\n<th class=\"leftalign\">Signal on RZ\/G1E<\/th>\n<th>Bank and pin<\/th>\n<th>GPIO Number<\/th>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">8<\/td>\n<td class=\"leftalign\">GPIO_1<\/td>\n<td class=\"leftalign\">GPIO_1<\/td>\n<td class=\"leftalign\">0-1<\/td>\n<td class=\"leftalign\">993<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">10<\/td>\n<td class=\"leftalign\">GPIO_2<\/td>\n<td class=\"leftalign\">GPIO_2<\/td>\n<td class=\"leftalign\">0-2<\/td>\n<td class=\"leftalign\">994<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">12<\/td>\n<td class=\"leftalign\">GPIO_3<\/td>\n<td class=\"leftalign\">GPIO_3<\/td>\n<td class=\"leftalign\">5-4<\/td>\n<td class=\"leftalign\">846<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">14<\/td>\n<td class=\"leftalign\">GPIO_4<\/td>\n<td class=\"leftalign\">GPIO_4<\/td>\n<td class=\"leftalign\">4-31<\/td>\n<td class=\"leftalign\">901<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">16<\/td>\n<td class=\"leftalign\">GPIO_5<\/td>\n<td class=\"leftalign\">GPIO_5<\/td>\n<td class=\"leftalign\">4-26<\/td>\n<td class=\"leftalign\">896<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">18<\/td>\n<td class=\"leftalign\">GPIO_6<\/td>\n<td class=\"leftalign\">GPIO_6<\/td>\n<td class=\"leftalign\">4-29<\/td>\n<td class=\"leftalign\">899<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">20<\/td>\n<td class=\"leftalign\">GPIO_7<\/td>\n<td class=\"leftalign\">not connected<\/td>\n<td class=\"leftalign\">&nbsp;<\/td>\n<td class=\"leftalign\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">22<\/td>\n<td class=\"leftalign\">GPIO_8<\/td>\n<td class=\"leftalign\">not connected<\/td>\n<td class=\"leftalign\">&nbsp;<\/td>\n<td class=\"leftalign\">&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<h2><a id=\"verno_3_verno_4_cadun\" name=\"verno_3_verno_4_cadun\"><\/a>emCON-RZ\/G1M on Avari<\/h2>\n<div class=\"level2\">\n<p>There are 8 GPIOs on J27 with a signal level of 3.3V.<\/p>\n<p>&nbsp;<\/p>\n<table class=\"inline\">\n<tbody>\n<tr>\n<th>Connector<\/th>\n<th>Pin<\/th>\n<th class=\"leftalign\">Signal<\/th>\n<th class=\"leftalign\">Signal on RZ\/G1M<\/th>\n<th>Bank and pin<\/th>\n<th>GPIO Number<\/th>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">8<\/td>\n<td class=\"leftalign\">GPIO_1<\/td>\n<td class=\"leftalign\">GP4_13<\/td>\n<td class=\"leftalign\">4-13<\/td>\n<td class=\"leftalign\">883<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">10<\/td>\n<td class=\"leftalign\">GPIO_2<\/td>\n<td class=\"leftalign\">GP4_14<\/td>\n<td class=\"leftalign\">4-14<\/td>\n<td class=\"leftalign\">884<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">12<\/td>\n<td class=\"leftalign\">GPIO_3<\/td>\n<td class=\"leftalign\">GP4_15<\/td>\n<td class=\"leftalign\">4-15<\/td>\n<td class=\"leftalign\">885<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">14<\/td>\n<td class=\"leftalign\">GPIO_4<\/td>\n<td class=\"leftalign\">GP4_16<\/td>\n<td class=\"leftalign\">4-16<\/td>\n<td class=\"leftalign\">886<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">16<\/td>\n<td class=\"leftalign\">GPIO_5<\/td>\n<td class=\"leftalign\">GP4_17<\/td>\n<td class=\"leftalign\">4-17<\/td>\n<td class=\"leftalign\">887<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">18<\/td>\n<td class=\"leftalign\">GPIO_6<\/td>\n<td class=\"leftalign\">GP4_18<\/td>\n<td class=\"leftalign\">4-18<\/td>\n<td class=\"leftalign\">888<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">20<\/td>\n<td class=\"leftalign\">GPIO_7<\/td>\n<td class=\"leftalign\">GP4_19<\/td>\n<td class=\"leftalign\">4-19<\/td>\n<td class=\"leftalign\">889<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">22<\/td>\n<td class=\"leftalign\">GPIO_8<\/td>\n<td class=\"leftalign\">GP4_20<\/td>\n<td class=\"leftalign\">4-20<\/td>\n<td class=\"leftalign\">890<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<h2><a id=\"verno_3_verno_4_cadun\" name=\"verno_3_verno_4_cadun\"><\/a>emCON-RZ\/G1H on Avari<\/h2>\n<div class=\"level2\">\n<p>There are 8 GPIOs on J27 with a signal level of 3.3V.<\/p>\n<p>&nbsp;<\/p>\n<table class=\"inline\">\n<tbody>\n<tr>\n<th>Connector<\/th>\n<th>Pin<\/th>\n<th class=\"leftalign\">Signal<\/th>\n<th class=\"leftalign\">Signal on RZ\/G1H<\/th>\n<th>Bank and pin<\/th>\n<th>GPIO Number<\/th>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">8<\/td>\n<td class=\"leftalign\">GPIO_1<\/td>\n<td class=\"leftalign\">GP1_0<\/td>\n<td class=\"leftalign\">1-0<\/td>\n<td class=\"leftalign\">960<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">10<\/td>\n<td class=\"leftalign\">GPIO_2<\/td>\n<td class=\"leftalign\">GP1_1<\/td>\n<td class=\"leftalign\">1-1<\/td>\n<td class=\"leftalign\">961<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">12<\/td>\n<td class=\"leftalign\">GPIO_3<\/td>\n<td class=\"leftalign\">GP1_2<\/td>\n<td class=\"leftalign\">1-2<\/td>\n<td class=\"leftalign\">962<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">14<\/td>\n<td class=\"leftalign\">GPIO_4<\/td>\n<td class=\"leftalign\">GP1_3<\/td>\n<td class=\"leftalign\">1-3<\/td>\n<td class=\"leftalign\">963<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">16<\/td>\n<td class=\"leftalign\">GPIO_5<\/td>\n<td class=\"leftalign\">GP1_10<\/td>\n<td class=\"leftalign\">1-10<\/td>\n<td class=\"leftalign\">970<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">18<\/td>\n<td class=\"leftalign\">GPIO_6<\/td>\n<td class=\"leftalign\">GP1_11<\/td>\n<td class=\"leftalign\">1-11<\/td>\n<td class=\"leftalign\">971<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">20<\/td>\n<td class=\"leftalign\">GPIO_7<\/td>\n<td class=\"leftalign\">GP1_13<\/td>\n<td class=\"leftalign\">1-13<\/td>\n<td class=\"leftalign\">973<\/td>\n<\/tr>\n<tr>\n<td class=\"leftalign\">J27<\/td>\n<td class=\"leftalign\">22<\/td>\n<td class=\"leftalign\">GPIO_8<\/td>\n<td class=\"leftalign\">GP1_14<\/td>\n<td class=\"leftalign\">1-14<\/td>\n<td class=\"leftalign\">974<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Please see the following table for the translation from baseboard pin to CPU pin: &nbsp; Under Linux you can use sysfs to access gpios. To get access to an GPIO pin, first, write the GPIO number to \/sys\/class\/gpio\/export echo 34 [gt] \/sys\/class\/gpio\/export Now you should find a directory in \/sys\/class\/gpio to access your GPIO pin. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-234269","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>GPIOs on emCON-RZ\/G1x under Linux - emtrion<\/title>\n<meta name=\"description\" content=\"Learn how to access GPIOs on the emCON-RZ\/G1x under Linux with sysfs, including GPIO mapping for Avari, Bvari, and Lothron boards.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.emtrion.de\/en\/gpios-on-emcon-rz-g1x-under-linux-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GPIOs on emCON-RZ\/G1x under Linux - emtrion\" \/>\n<meta property=\"og:description\" content=\"Learn how to access GPIOs on the emCON-RZ\/G1x under Linux with sysfs, including GPIO mapping for Avari, Bvari, and Lothron boards.\" \/>\n<meta property=\"og:site_name\" content=\"emtrion\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-24T07:35:40+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.emtrion.de\\\/en\\\/gpios-on-emcon-rz-g1x-under-linux-2\\\/\",\"url\":\"https:\\\/\\\/www.emtrion.de\\\/en\\\/gpios-on-emcon-rz-g1x-under-linux-2\\\/\",\"name\":\"GPIOs on emCON-RZ\\\/G1x under Linux - emtrion\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.emtrion.de\\\/en\\\/#website\"},\"datePublished\":\"2024-09-29T20:26:35+00:00\",\"dateModified\":\"2024-10-24T07:35:40+00:00\",\"description\":\"Learn how to access GPIOs on the emCON-RZ\\\/G1x under Linux with sysfs, including GPIO mapping for Avari, Bvari, and Lothron boards.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.emtrion.de\\\/en\\\/gpios-on-emcon-rz-g1x-under-linux-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.emtrion.de\\\/en\\\/gpios-on-emcon-rz-g1x-under-linux-2\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.emtrion.de\\\/en\\\/gpios-on-emcon-rz-g1x-under-linux-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.emtrion.de\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GPIOs on emCON-RZ\\\/G1x under Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.emtrion.de\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/www.emtrion.de\\\/en\\\/\",\"name\":\"emtrion\",\"description\":\"Embedded Software and Hardware Development\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.emtrion.de\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GPIOs on emCON-RZ\/G1x under Linux - emtrion","description":"Learn how to access GPIOs on the emCON-RZ\/G1x under Linux with sysfs, including GPIO mapping for Avari, Bvari, and Lothron boards.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.emtrion.de\/en\/gpios-on-emcon-rz-g1x-under-linux-2\/","og_locale":"en_US","og_type":"article","og_title":"GPIOs on emCON-RZ\/G1x under Linux - emtrion","og_description":"Learn how to access GPIOs on the emCON-RZ\/G1x under Linux with sysfs, including GPIO mapping for Avari, Bvari, and Lothron boards.","og_site_name":"emtrion","article_modified_time":"2024-10-24T07:35:40+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.emtrion.de\/en\/gpios-on-emcon-rz-g1x-under-linux-2\/","url":"https:\/\/www.emtrion.de\/en\/gpios-on-emcon-rz-g1x-under-linux-2\/","name":"GPIOs on emCON-RZ\/G1x under Linux - emtrion","isPartOf":{"@id":"https:\/\/www.emtrion.de\/en\/#website"},"datePublished":"2024-09-29T20:26:35+00:00","dateModified":"2024-10-24T07:35:40+00:00","description":"Learn how to access GPIOs on the emCON-RZ\/G1x under Linux with sysfs, including GPIO mapping for Avari, Bvari, and Lothron boards.","breadcrumb":{"@id":"https:\/\/www.emtrion.de\/en\/gpios-on-emcon-rz-g1x-under-linux-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.emtrion.de\/en\/gpios-on-emcon-rz-g1x-under-linux-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.emtrion.de\/en\/gpios-on-emcon-rz-g1x-under-linux-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.emtrion.de\/en\/"},{"@type":"ListItem","position":2,"name":"GPIOs on emCON-RZ\/G1x under Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.emtrion.de\/en\/#website","url":"https:\/\/www.emtrion.de\/en\/","name":"emtrion","description":"Embedded Software and Hardware Development","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.emtrion.de\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.emtrion.de\/en\/wp-json\/wp\/v2\/pages\/234269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.emtrion.de\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.emtrion.de\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.emtrion.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.emtrion.de\/en\/wp-json\/wp\/v2\/comments?post=234269"}],"version-history":[{"count":1,"href":"https:\/\/www.emtrion.de\/en\/wp-json\/wp\/v2\/pages\/234269\/revisions"}],"predecessor-version":[{"id":234270,"href":"https:\/\/www.emtrion.de\/en\/wp-json\/wp\/v2\/pages\/234269\/revisions\/234270"}],"wp:attachment":[{"href":"https:\/\/www.emtrion.de\/en\/wp-json\/wp\/v2\/media?parent=234269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}