Software Archive
Read-only legacy content
17061 Discussões

Enable serial on digital 0&1 on Galileo Gen 2

Michael_M_Intel
Funcionário
2.035 Visualizações

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 Solução
Brendan_L_Intel
Funcionário
2.035 Visualizações

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

Ver solução na publicação original

5 Respostas
Dallas_P_
Novo colaborador I
2.035 Visualizações

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

Michael_M_Intel
Funcionário
2.035 Visualizações

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

 

 

Dushan_C_
Novo colaborador I
2.035 Visualizações

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

NagaVenkat_K_Intel
Funcionário
2.035 Visualizações

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

 

 

Brendan_L_Intel
Funcionário
2.036 Visualizações

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

Responder