2014-09-01 23:19:24 +01:00
|
|
|
Galileo Gen 2 - Rev H {#galileorevh}
|
|
|
|
|
=====================
|
2014-07-24 16:59:53 +01:00
|
|
|
|
2014-11-24 10:51:27 +00:00
|
|
|
Galileo is a microcontroller board based on the Intel(R) Quark(TM) SoC X1000
|
2014-07-24 16:59:53 +01:00
|
|
|
Application Processor, a 32-bit Intel Pentium-class system on a chip.
|
|
|
|
|
|
2014-09-01 23:19:24 +01:00
|
|
|
The Gen 2 board has the following limitations in libmraa:
|
2014-07-24 16:59:53 +01:00
|
|
|
|
2014-11-07 15:05:23 +00:00
|
|
|
- i2c is set at 400Khz speed cannot be changed without reloading kernel module,
|
|
|
|
|
the driver is intel_qrk_gip_i2c and the parameter is i2c_std_mode which must
|
|
|
|
|
be set to 1 in order to set the i2c bus speed to 100Khz
|
|
|
|
|
- i2c bus is shared with multiple devices in kernel space, scanning it usually
|
|
|
|
|
fails
|
2014-07-24 16:59:53 +01:00
|
|
|
- pwm period is set globally for all pwm channels, when changed this will halt
|
|
|
|
|
all pwm channels
|
2014-09-22 14:52:18 +01:00
|
|
|
- adc kernel module will return 12bit number but the ADC itself only has an
|
|
|
|
|
accuracy of 10bits.
|
2014-11-21 11:58:08 +00:00
|
|
|
- AIO pins are treated as 0-5 in mraa_aio_init() but as 14-19 for everything
|
|
|
|
|
else. Therefore use mraa_gpio_init(14) to use A0 as a Gpio
|
2016-03-21 14:57:37 +00:00
|
|
|
- To explicitly use GPIO 10 for SPI and allow the kernel to handle the chip select, set
|
|
|
|
|
`intel_qrk_plat_galileo_gen2.gpio_cs=1` on the kernel line in the boot config on the
|
|
|
|
|
galileo, this can be found at `/media/mmcblk0p1/boot/grub/grub.conf`
|
|
|
|
|
- if done correctly it should look similiar to this:
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
title Quark X1000 kernel-MassStorage iot-devkit on SD IMR-On IO-APIC/HPET NoEMU debug
|
|
|
|
|
root (hd0,0)
|
|
|
|
|
kernel /bzImage root=/dev/mmcblk0p2 <b>intel_qrk_plat_galileo_gen2.gpio_cs=1</b> rootwait console=ttyS1,115200n8 earlycon=uart8250,mmio32,0x8010f000,115200n8 reboot=efi,warm apic=debug rw LABEL=boot debugshell=5
|
|
|
|
|
</pre>
|
2015-07-28 09:32:12 +01:00
|
|
|
|
|
|
|
|
Uart 1 on gen2
|
|
|
|
|
--------------
|
|
|
|
|
|
|
|
|
|
Uart 1 is connected to the FTDI header and the linux console. It's also
|
|
|
|
|
possible to use it from A2(Rx)/A3(Tx). However mraa does not support this
|
|
|
|
|
directly so you need to enable the muxing manually. Here is an example of how
|
|
|
|
|
this is done, this was tested using an FTDI 3.3V TTL cable:
|
|
|
|
|
|
2016-03-21 14:57:37 +00:00
|
|
|
```
|
2015-07-28 09:32:12 +01:00
|
|
|
$ systemctl stop serial-getty@ttyS1.service
|
|
|
|
|
$ python
|
|
|
|
|
>>> # Configure the Muxes for Uart1 on Aio2/3
|
|
|
|
|
>>> import mraa as m
|
|
|
|
|
>>> p77 = m.Gpio(77, False, True)
|
|
|
|
|
>>> p76 = m.Gpio(76, False, True)
|
|
|
|
|
>>> p16 = m.Gpio(16, False, True)
|
|
|
|
|
>>> p17 = m.Gpio(17, False, True)
|
|
|
|
|
>>> p77.write(1)
|
|
|
|
|
>>> p76.write(1)
|
|
|
|
|
>>> p16.dir(m.DIR_OUT)
|
|
|
|
|
>>> p16.write(0)
|
|
|
|
|
>>> p17.dir(m.DIR_OUT)
|
|
|
|
|
>>> p17.write(1)
|
|
|
|
|
|
|
|
|
|
>>> # For Rx to work correctly switch the level shifter
|
|
|
|
|
>>> p34 = m.Gpio(34, False, True)
|
|
|
|
|
>>> p34.dir(m.DIR_OUT)
|
|
|
|
|
>>> p34.write(1)
|
|
|
|
|
|
|
|
|
|
>>> # Use the uart
|
|
|
|
|
>>> x = m.Uart(1)
|
|
|
|
|
>>> x.setBaudRate(115200)
|
|
|
|
|
>>> x.writeStr('hello')
|
|
|
|
|
>>> x.read(5)
|
|
|
|
|
bytearray(b'dsds\n')
|
2016-03-21 14:57:37 +00:00
|
|
|
```
|