Software Archive
Read-only legacy content
17061 Discussions

Enable serial on digital 0&1 on Galileo Gen 2

Michael_M_Intel
Employee
824 Views

We are trying to enable serial (ttys0) on digital 0 & 1 on Galileo gen 2 under WR Linux. I can find zero documentation from Intel on how the GPIOs are mapped in Linux (i.e. schematic vs Linux GPIOs). Based on schematic analysis and using the gpio information from the link below, I believe the proper settings to enable serial is:

http://www.emutexlabs.com/component/content/article?id=203:getting-started-with-intel-galileo-gen-2#43_pin_configuration_options_for_galileo_gen_2

P0_0, on GPIO Expander 1 must be low (pulled up by default—R63) gpio32
P0_1, on GPIO Expander 1 must be tri-stated (or remove R11) gpio33
GPIO3_R from Quark must be tri-stated, gpio11
P1_4, on GPIO Expander 0, must be set low,  gpio28
P1_5, on GPIO Expander 0, must be set tri-state,  gpio29
P1_5, on GPIO Expander 1, must be set high,  gpio45

The problem we have is that under both Yocto and WR Linux, we get an error when trying to set GPIO11. Can you tell me the proper way to enable serial on dig 0&1? Here is the error we get:

root@WR-IntelligentDevice:~# echo -n "11" > /sys/class/gpio/export

root@WR-IntelligentDevice:~# echo -n "out" > /sys/class/gpio/gpio11/direction

root@WR-IntelligentDevice:~# echo -n "hiz" > /sys/class/gpio/gpio11/drive

-sh: echo: write error: Invalid argument

0 Kudos
1 Solution
Brendan_L_Intel
Employee
824 Views

Try libmraa it will then work on both galileo's, edison with & without minibreakout board.

#include "mraa.h"
mraa_uart_context uart;
uart = mraa_uart_init(0);

See: http://iotdk.intel.com/docs/master/mraa/uart_8h.html & http://iotdk.intel.com/docs/master/mraa/classmraa_1_1_uart.html

View solution in original post

0 Kudos
5 Replies
Dallas_P_
New Contributor I
824 Views

+1.  I need an answer to the same question.

0 Kudos
Michael_M_Intel
Employee
824 Views

Since no one else bothered to, I will answer my own question with what I found to work.  To enable serial (ttys0) on digital 0 & 1 on Galileo gen 2 under Yocto or Wind River Linux, set the following GPIO settings:

  • 32 -> value = 1
  • 33 -> value = 1
  • 28 -> value = 0
  • 29 -> drive = hiz
  • 45 -> value = 1

Here's a great primer on configuring Galileo (gen 1) GPIO:

http://www.malinov.com/Home/sergey-s-blog/intelgalileo-programminggpiofromlinux

 

 

0 Kudos
Dushan_C_
New Contributor I
824 Views

Yes , for GPIO related configurations, you can change them in linux

0 Kudos
NagaVenkat_K_Intel
824 Views

For Edison you can run these commands on terminal to enable the serial port on pins 0 and 1

echo 214 > /sys/class/gpio/export 2>&1

echo high > /sys/class/gpio/gpio214/direction

echo low > /sys/class/gpio/gpio214/direction

 

echo 131 > /sys/class/gpio/export 2>&1

echo mode1 > /sys/kernel/debug/gpio_debug/gpio131/current_pinmux

echo 249 > /sys/class/gpio/export 2>&1

echo high > /sys/class/gpio/gpio249/direction

echo 1 > /sys/class/gpio/gpio249/value

echo 217 > /sys/class/gpio/export 2>&1

echo high > /sys/class/gpio/gpio217/direction

echo 1 > /sys/class/gpio/gpio217/value

echo out > /sys/class/gpio/gpio131/direction

echo 0 > /sys/class/gpio/gpio131/value

  

echo 130 > /sys/class/gpio/export 2>&1

echo mode1 > /sys/kernel/debug/gpio_debug/gpio130/current_pinmux

echo 248 > /sys/class/gpio/export 2>&1

echo low > /sys/class/gpio/gpio248/direction

echo 0 > /sys/class/gpio/gpio248/value

echo 216 > /sys/class/gpio/export 2>&1

echo in > /sys/class/gpio/gpio216/direction

echo in > /sys/class/gpio/gpio130/direction

 

echo high > /sys/class/gpio/gpio214/direction

 

 

0 Kudos
Brendan_L_Intel
Employee
825 Views

Try libmraa it will then work on both galileo's, edison with & without minibreakout board.

#include "mraa.h"
mraa_uart_context uart;
uart = mraa_uart_init(0);

See: http://iotdk.intel.com/docs/master/mraa/uart_8h.html & http://iotdk.intel.com/docs/master/mraa/classmraa_1_1_uart.html

0 Kudos
Reply