Galileo Quark SoC X1000 Getting Started Manual page 16

Table of Contents

Advertisement

Custom Arduino Sketch
If you don't have the weird 3.5mm RS-232 interface cables, never fear! You can upload an Arduino
sketch to access the Linux terminal.
One warning here: this sketch does mess with some of the basic workings of the Galileo. You won't
be able to upload another Arduino sketch unless you reset the board or run the few lines at the end
of this section.
Copy the code below into your Arduino IDE. Then upload just as you did the Blink sketch. This is a
slightly modified version of the code found in Intel's
language:c
void setup()
{
system("cp /etc/inittab /etc/inittab.bak"); // Back up inittab
// Replace all "S:2345" with "S0:2345"'s (switching serial ports):
system("sed -i 's/S:2345/S0:2345/g' /etc/inittab");
// Replace all "ttyS1" with "ttyGS0"'s (switching serial ports):
system("sed -i 's/ttyS1/ttyGS0/g' /etc/inittab");
// Replace all "grst" with "#grst"'s to comment that line out:
system("sed -i 's/grst/#grst/g' /etc/inittab");
// Replace all "clld" with "#clld"'s to comment that line out:
system("sed -i 's/clld/#clld/g' /etc/inittab");
system("kill -SIGHUP 1");
}
void loop()
{
}
Once that's uploaded, you'll need to open up a separate serial terminal program (not the Serial
Monitor). Set the serial port to the same as your Galileo, and set the baud rate to 115200. See the
below section
for help using Linux.
Once you're done using this version of the serial terminal, send this trio of commands to revert back
to "Arduino mode":
language:c
rm /sketch/sketch.elf
cp /etc/inittab.bak /etc/inittab
kill -SIGHUP 1
Those will remove your terminal "Arduino sketch", revert back to the old
the
process. Your Galileo will revert back to the way it was, and you can upload an Arduino
init
sketch once again.
Using the Linux Terminal
When you first open your Linux terminal, press enter. You'll the be prompted to log in, use the user
name root (no password, by default). Welcome to the shell!
example code
Page 16 of 20
samples.
procedure, and reboot
init

Advertisement

Table of Contents
loading

Table of Contents