<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.compulab.com/w/index.php?action=history&amp;feed=atom&amp;title=CM-FX6%3A_Android%3A_Accessing_OS_interfaces</id>
	<title>CM-FX6: Android: Accessing OS interfaces - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.compulab.com/w/index.php?action=history&amp;feed=atom&amp;title=CM-FX6%3A_Android%3A_Accessing_OS_interfaces"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.compulab.com/w/index.php?title=CM-FX6:_Android:_Accessing_OS_interfaces&amp;action=history"/>
	<updated>2026-09-02T08:47:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://mediawiki.compulab.com/w/index.php?title=CM-FX6:_Android:_Accessing_OS_interfaces&amp;diff=1997&amp;oldid=prev</id>
		<title>Grinberg: /* UART */</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.compulab.com/w/index.php?title=CM-FX6:_Android:_Accessing_OS_interfaces&amp;diff=1997&amp;oldid=prev"/>
		<updated>2015-06-15T15:06:43Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;UART&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 15:06, 15 June 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l33&quot; &gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Transmitter side:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Transmitter side:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*# Setup:&amp;lt;pre&amp;gt;# busybox stty /dev/ttymxc1 115200&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*# Setup:&amp;lt;pre&amp;gt;# busybox stty /dev/ttymxc1 115200&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*# &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Receive&lt;/del&gt;:&amp;lt;pre&amp;gt;# echo &amp;quot;some text&amp;quot; &amp;gt; /dev/ttymxc1&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*# &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Transmit&lt;/ins&gt;:&amp;lt;pre&amp;gt;# echo &amp;quot;some text&amp;quot; &amp;gt; /dev/ttymxc1&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== CAN bus ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== CAN bus ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Grinberg</name></author>
		
	</entry>
	<entry>
		<id>https://mediawiki.compulab.com/w/index.php?title=CM-FX6:_Android:_Accessing_OS_interfaces&amp;diff=1992&amp;oldid=prev</id>
		<title>Grinberg: /* See also */</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.compulab.com/w/index.php?title=CM-FX6:_Android:_Accessing_OS_interfaces&amp;diff=1992&amp;oldid=prev"/>
		<updated>2015-06-15T14:23:43Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;See also&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Overview =&lt;br /&gt;
Being Linux under the hood, Android enables access to OS interfaces such as GPIO, serial port, etc. The interfaces may be accessed from the command line, via terminal emulation application, ADB or start-up script, or programmatically from Android application.&amp;lt;br&amp;gt;&lt;br /&gt;
It is assumed that each respective interface pin is multiplexed correctly for the required functionality by the kernel code.&lt;br /&gt;
&lt;br /&gt;
= Command line access =&lt;br /&gt;
&lt;br /&gt;
== GPIO ==&lt;br /&gt;
&lt;br /&gt;
GPIO control workflow is comprised of&lt;br /&gt;
# exporting GPIO&lt;br /&gt;
# setting GPIO direction: '''in'''/'''out'''&lt;br /&gt;
# reading or setting GPIO value, according to direction&lt;br /&gt;
&lt;br /&gt;
For example controlling GPIO 206 would look the following way:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /sys/class/gpio&lt;br /&gt;
# echo 206 &amp;gt; export&lt;br /&gt;
# echo in &amp;gt; gpio206/direction&lt;br /&gt;
# cat gpio206/value&lt;br /&gt;
0&lt;br /&gt;
# echo out &amp;gt; gpio206/direction&lt;br /&gt;
# echo 1 &amp;gt; gpio206/value&lt;br /&gt;
# echo 206 &amp;gt; unexport&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== UART ==&lt;br /&gt;
UART configuration can be performed with the aid of '''stty''' utility.&amp;lt;br/&amp;gt;&lt;br /&gt;
For example, reception and transmission via CM-FX6 UART2 (SB-FX6 P32A or Utilite P16 back RS232) connected to 115200 baud rate line:&lt;br /&gt;
* Receiver side:&lt;br /&gt;
*# Setup:&amp;lt;pre&amp;gt;# busybox stty /dev/ttymxc1 115200&amp;lt;/pre&amp;gt;&lt;br /&gt;
*# Receive:&amp;lt;pre&amp;gt;# cat /dev/ttymxc1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Transmitter side:&lt;br /&gt;
*# Setup:&amp;lt;pre&amp;gt;# busybox stty /dev/ttymxc1 115200&amp;lt;/pre&amp;gt;&lt;br /&gt;
*# Receive:&amp;lt;pre&amp;gt;# echo &amp;quot;some text&amp;quot; &amp;gt; /dev/ttymxc1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CAN bus ==&lt;br /&gt;
CM-FX6 Android release prepacks some useful CAN utilities:&lt;br /&gt;
* candump&lt;br /&gt;
* cansend&lt;br /&gt;
* cangen&lt;br /&gt;
* canplayer&lt;br /&gt;
* cansniffer&lt;br /&gt;
&lt;br /&gt;
Additional tools of {{filename|can-utils}} package may be included by adding the required tool name to the {{filename|device/compulab/andromeda/andromeda.mk}} make file, and rebuilding the Android package.&amp;lt;br/&amp;gt;&lt;br /&gt;
To test CAN bus functionality, two SB-FX6 evaluation boards can be connected to the same bus, running the following commands:&amp;lt;br/&amp;gt;&lt;br /&gt;
* Device A - receiver&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ip link set can0 type can bitrate 125000 triple-sampling on&lt;br /&gt;
# ifconfig can0 up&lt;br /&gt;
# candump can0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Device B - transmitter&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ip link set can0 type can bitrate 125000 triple-sampling on&lt;br /&gt;
# ifconfig can0 up&lt;br /&gt;
# cansend can0 5A1#11.22.33.44.55.66.77.88&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The receiver device will receive everything being transmitted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[CM-FX6: Linux: Debian#GPIO access|CM-FX6 Linux GPIO access]]&lt;br /&gt;
* [https://www.kernel.org/doc/Documentation/gpio/sysfs.txt  GPIO access in Linux kernel documentation]&lt;br /&gt;
* [http://falsinsoft.blogspot.co.il/2012/11/access-gpio-from-linux-user-space.html  GPIO access article]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/SocketCAN  Wikipedia SocketCAN article]&lt;br /&gt;
* [https://developer.ridgerun.com/wiki/index.php/How_to_configure_and_use_CAN_bus#Power_on_CAN_hardware  CAN bus introduction]&lt;/div&gt;</summary>
		<author><name>Grinberg</name></author>
		
	</entry>
</feed>