
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.armadeus.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JulienC</id>
		<title>ArmadeusWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.armadeus.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JulienC"/>
		<link rel="alternate" type="text/html" href="http://www.armadeus.org/wiki/index.php?title=Special:Contributions/JulienC"/>
		<updated>2026-04-30T02:16:12Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=6069</id>
		<title>User:JulienC</title>
		<link rel="alternate" type="text/html" href="http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=6069"/>
				<updated>2009-03-08T16:16:42Z</updated>
		
		<summary type="html">&lt;p&gt;JulienC: /* Change Ethernet MAC address */  Link to more complete page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My name is Julien and I am a French engineer in embedded systems. My interests are in FPGA programming and embedded Linux. I will try to share my experiments on this wiki.&lt;br /&gt;
&lt;br /&gt;
I am new in the FPGA world. I will try to learn and share as much as I can.&lt;br /&gt;
&lt;br /&gt;
== Blinking LED ==&lt;br /&gt;
'''Goal''': Make a LED blink. &lt;br /&gt;
&lt;br /&gt;
I used the [[Une_led_qui_clignote_avec_le_spartan_3|LED blinking page]] VHDL code to generate the FPGA binary file with Xilinx ISE. (more details are needed on this wiki to generate .bit files)&lt;br /&gt;
&lt;br /&gt;
On the hardware side, I connected the 2 FPGA pins L28P and L28N to a [[wikipedia:breadboard|breadboard]] with wires. Those 2 pins are accessible on the DevLight bottom, as mentioned on the [http://www.armadeus.com/_downloads/apf9328DevLight/documentation/dataSheet_APF9328_DevLight_V2.pdf datasheet], page 9. Those 2 pin-holes are too small to solder [http://www.selectronic.fr/article.asp?article_ref_entier=90.0425-9999 &amp;quot;conventional&amp;quot; pins], so my set-up is quite unstable. I need to make it more robust.&lt;br /&gt;
&lt;br /&gt;
On the software side, I don't want (yet) to flash my board with a new software, so I am using the default one provided (Linux kernel 2.6.27.2). Moreover I want to load the FPGA from Linux (and not [[InstallTargetSoftware#FPGA_firmware_installation|from U-boot]]).&lt;br /&gt;
I set-up a [[MultiMediaCard|microSD card]] to transfer my files. to load the FPGA binary file, in addition to the .bit file, I needed the [[FPGA_loader|fpgaloader]] driver script which seems not to be by default on the board. &lt;br /&gt;
&lt;br /&gt;
After booting the board, I use the following commands:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
 # mount -t ext2 /dev/mmcblk0p2 /mnt/mmc&lt;br /&gt;
 # cd /mnt/mmc/root/&lt;br /&gt;
 # ls&lt;br /&gt;
 Clk_div_led.bit  fpgaloader.sh&lt;br /&gt;
 # sh fpgaloader.sh&lt;br /&gt;
 fpgaloader module v0.0.6 successfully loaded !&lt;br /&gt;
 # dd if=Clk_div_led.bit of=/dev/fpga/fpgaloader&lt;br /&gt;
 255+1 records in&lt;br /&gt;
 255+1 records out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And it blinks!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Change Ethernet MAC address ==&lt;br /&gt;
see [[Ethernet MAC address]]&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
Booting from SD card: (links, not tried yet)&lt;br /&gt;
* http://wiki.openmoko.org/wiki/Booting_from_SD&lt;br /&gt;
* http://docwiki.gumstix.org/U-Boot#The_MMC_card&lt;/div&gt;</summary>
		<author><name>JulienC</name></author>	</entry>

	<entry>
		<id>http://www.armadeus.org/wiki/index.php?title=Ethernet_MAC_address&amp;diff=6033</id>
		<title>Ethernet MAC address</title>
		<link rel="alternate" type="text/html" href="http://www.armadeus.org/wiki/index.php?title=Ethernet_MAC_address&amp;diff=6033"/>
				<updated>2009-03-04T09:24:43Z</updated>
		
		<summary type="html">&lt;p&gt;JulienC: Ethernet MAC address details and how to change it on APF9328&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If, for any reasons, you want to change your board Ethernet MAC address, here is the procedure.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Every network card has a [[wikipedia:MAC address|MAC address]] to identify itself on the network. The MAC address first three octets are known as the [[wikipedia:Organizationally Unique Identifier|Organizationally Unique Identifier]]. Armadeus OUI is 00:1E:AC [http://www.coffer.com/mac_find/?string=Armadeus]&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
Armadeus APF9328 board has a separate MAC controller, the DM9000 chip from Davicom [http://www.davicom.com.tw/userfile/24247/DM9000-DS-F03-041906_1.pdf]. The [http://www.armadeus.com/_downloads/apf9328/hardware/apf_schema.pdf APF schematic], page 10, shows the implementation of the chip with an EEPROM chip to store its parameters, including MAC address.&lt;br /&gt;
&lt;br /&gt;
=== U-boot ===&lt;br /&gt;
[[BootLoader|U-boot]] has a parameter containing the Ethernet address. This parameter is independent from the hardware address. The parameter is '''ethaddr'''.&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; printenv ethaddr&lt;br /&gt;
00:1E:AC:XX:XX:XX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
XX:XX:XX being the board specific address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Change MAC address ==&lt;br /&gt;
&lt;br /&gt;
It can happen that the MAC address is wrong (e.g.: 00:00:0E:00:00:00 in my case), empty or that you want to change it.&lt;br /&gt;
&lt;br /&gt;
=== Empty MAC address ===&lt;br /&gt;
If the board MAC address is empty, the procedure is simplified.&lt;br /&gt;
&lt;br /&gt;
In U-boot, simply set the correct value in the parameter '''ethaddr''', ping any address and save the environment.&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv ethaddr 00:1e:ac:XX:XX:XX&lt;br /&gt;
BIOS&amp;gt; ping 1 &lt;br /&gt;
MAC: 00:1e:ac:XX:XX:XX                &lt;br /&gt;
operating at 100M full duplex mode    &lt;br /&gt;
 [Ctrl-C]&lt;br /&gt;
Abort&lt;br /&gt;
ping failed; host 1 is not alive&lt;br /&gt;
BIOS&amp;gt; saveenv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
FIXME: The above message are made-up, don't know if reprogramming message is displayed or not...&lt;br /&gt;
=== Wrong MAC address ===&lt;br /&gt;
If the MAC address is already set but wrong, changing the U-boot parameter ethaddr will not automatically reprogram the EEPROM. It is necessary to indicate to U-boot to reprogram the EEPROM.&lt;br /&gt;
&lt;br /&gt;
This is made possible by a specific patch to U-boot by Armadeus for the DM9000 chip [http://armadeus.svn.sourceforge.net/viewvc/armadeus/trunk/buildroot/target/u-boot/u-boot-1.3.4-111-apf9328-DM9000.patch?revision=1009&amp;amp;view=markup] line 68 and following. Thanks to this patch, setting the ethaddr parameter to ff:ff:ff:ff:ff:ff and ping any IP will provoke the MAC address reprogramming. Then simply set ethaddr parameter again to the correct MAC address and ping any IP address,  as shown below.&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv ethaddr ff:ff:ff:ff:ff:ff&lt;br /&gt;
BIOS&amp;gt; ping 1                          &lt;br /&gt;
Warning: MAC addresses reprogramming..&lt;br /&gt;
MAC: ff:ff:ff:ff:ff:ff                &lt;br /&gt;
operating at 100M full duplex mode    &lt;br /&gt;
 [Ctrl-C]&lt;br /&gt;
Abort&lt;br /&gt;
ping failed; host 1 is not alive&lt;br /&gt;
BIOS&amp;gt; setenv ethaddr 00:1e:ac:XX:XX:XX&lt;br /&gt;
BIOS&amp;gt; ping 1                          &lt;br /&gt;
Warning: MAC addresses reprogramming..&lt;br /&gt;
MAC: 00:1e:ac:XX:XX:XX                &lt;br /&gt;
operating at 100M full duplex mode    &lt;br /&gt;
 [Ctrl-C]&lt;br /&gt;
Abort&lt;br /&gt;
ping failed; host 1 is not alive&lt;br /&gt;
BIOS&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Check your MAC address in Linux ==&lt;br /&gt;
Linux kernel and U-boot do not use the same source to get the board MAC address. As mentioned before, U-boot trusts its parameter ethaddr. Instead, Linux kernel, which uses the DM9000 driver, reads the MAC address from the EEPROM. During Linux boot, the driver prints the MAC address.&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
dm9000 Ethernet Driver, V1.31                                                                                             &lt;br /&gt;
eth0: dm9000e at c1854000,c1856002 IRQ 110 MAC: 00:1e:ac:xx:xx:xx (eeprom)&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When logged on Linux, the tool '''ifconfig''' also displays information about the Ethernet MAC address.&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
# ifconfig eth0&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 00:1E:AC:XX:XX:XX&lt;br /&gt;
          inet addr:192.168.0.10  Bcast:192.168.0.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21e:acxx:xxxx:xx/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000&lt;br /&gt;
          RX bytes:0 (0.0 B)  TX bytes:468 (468.0 B)&lt;br /&gt;
          Interrupt:110 Base address:0x4000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The field HWaddr corresponds to the MAC address read by dm9000 driver and used during communication.&lt;/div&gt;</summary>
		<author><name>JulienC</name></author>	</entry>

	<entry>
		<id>http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=6032</id>
		<title>User:JulienC</title>
		<link rel="alternate" type="text/html" href="http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=6032"/>
				<updated>2009-03-03T22:01:40Z</updated>
		
		<summary type="html">&lt;p&gt;JulienC: /* Change Ethernet MAC address */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My name is Julien and I am a French engineer in embedded systems. My interests are in FPGA programming and embedded Linux. I will try to share my experiments on this wiki.&lt;br /&gt;
&lt;br /&gt;
I am new in the FPGA world. I will try to learn and share as much as I can.&lt;br /&gt;
&lt;br /&gt;
== Blinking LED ==&lt;br /&gt;
'''Goal''': Make a LED blink. &lt;br /&gt;
&lt;br /&gt;
I used the [[Une_led_qui_clignote_avec_le_spartan_3|LED blinking page]] VHDL code to generate the FPGA binary file with Xilinx ISE. (more details are needed on this wiki to generate .bit files)&lt;br /&gt;
&lt;br /&gt;
On the hardware side, I connected the 2 FPGA pins L28P and L28N to a [[wikipedia:breadboard|breadboard]] with wires. Those 2 pins are accessible on the DevLight bottom, as mentioned on the [http://www.armadeus.com/_downloads/apf9328DevLight/documentation/dataSheet_APF9328_DevLight_V2.pdf datasheet], page 9. Those 2 pin-holes are too small to solder [http://www.selectronic.fr/article.asp?article_ref_entier=90.0425-9999 &amp;quot;conventional&amp;quot; pins], so my set-up is quite unstable. I need to make it more robust.&lt;br /&gt;
&lt;br /&gt;
On the software side, I don't want (yet) to flash my board with a new software, so I am using the default one provided (Linux kernel 2.6.27.2). Moreover I want to load the FPGA from Linux (and not [[InstallTargetSoftware#FPGA_firmware_installation|from U-boot]]).&lt;br /&gt;
I set-up a [[MultiMediaCard|microSD card]] to transfer my files. to load the FPGA binary file, in addition to the .bit file, I needed the [[FPGA_loader|fpgaloader]] driver script which seems not to be by default on the board. &lt;br /&gt;
&lt;br /&gt;
After booting the board, I use the following commands:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
 # mount -t ext2 /dev/mmcblk0p2 /mnt/mmc&lt;br /&gt;
 # cd /mnt/mmc/root/&lt;br /&gt;
 # ls&lt;br /&gt;
 Clk_div_led.bit  fpgaloader.sh&lt;br /&gt;
 # sh fpgaloader.sh&lt;br /&gt;
 fpgaloader module v0.0.6 successfully loaded !&lt;br /&gt;
 # dd if=Clk_div_led.bit of=/dev/fpga/fpgaloader&lt;br /&gt;
 255+1 records in&lt;br /&gt;
 255+1 records out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And it blinks!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Change Ethernet MAC address ==&lt;br /&gt;
(TO BE detailed)&lt;br /&gt;
http://armadeus.svn.sourceforge.net/viewvc/armadeus/trunk/buildroot/target/u-boot/u-boot-1.3.4-111-apf9328-DM9000.patch?revision=1009&amp;amp;view=markup line 68+&lt;br /&gt;
&lt;br /&gt;
U-boot:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv ethaddr ff:ff:ff:ff:ff:ff&lt;br /&gt;
BIOS&amp;gt; ping 1                          &lt;br /&gt;
Warning: MAC addresses reprogramming..&lt;br /&gt;
MAC: ff:ff:ff:ff:ff:ff                &lt;br /&gt;
operating at 100M full duplex mode    &lt;br /&gt;
&lt;br /&gt;
Abort&lt;br /&gt;
ping failed; host 1 is not alive&lt;br /&gt;
BIOS&amp;gt; setenv ethaddr 00:1e:ac:XX:XX:XX&lt;br /&gt;
BIOS&amp;gt; ping 1                          &lt;br /&gt;
Warning: MAC addresses reprogramming..&lt;br /&gt;
MAC: 00:1e:ac:XX:XX:XX                &lt;br /&gt;
operating at 100M full duplex mode    &lt;br /&gt;
&lt;br /&gt;
Abort&lt;br /&gt;
ping failed; host 1 is not alive&lt;br /&gt;
BIOS&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Linux boot:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
dm9000 Ethernet Driver, V1.31                                                                                             &lt;br /&gt;
eth0: dm9000e at c1854000,c1856002 IRQ 110 MAC: 00:1e:ac:xx:xx:xx (eeprom)&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
# ifconfig&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 00:1E:AC:XX:XX:XX&lt;br /&gt;
          inet addr:192.168.0.10  Bcast:192.168.0.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21e:acxx:xxxx:xx/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000&lt;br /&gt;
          RX bytes:0 (0.0 B)  TX bytes:468 (468.0 B)&lt;br /&gt;
          Interrupt:110 Base address:0x4000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
Booting from SD card: (links, not tried yet)&lt;br /&gt;
* http://wiki.openmoko.org/wiki/Booting_from_SD&lt;br /&gt;
* http://docwiki.gumstix.org/U-Boot#The_MMC_card&lt;/div&gt;</summary>
		<author><name>JulienC</name></author>	</entry>

	<entry>
		<id>http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=5961</id>
		<title>User:JulienC</title>
		<link rel="alternate" type="text/html" href="http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=5961"/>
				<updated>2009-03-02T15:29:09Z</updated>
		
		<summary type="html">&lt;p&gt;JulienC: Follow WritingRules&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My name is Julien and I am a French engineer in embedded systems. My interests are in FPGA programming and embedded Linux. I will try to share my experiments on this wiki.&lt;br /&gt;
&lt;br /&gt;
I am new in the FPGA world. I will try to learn and share as much as I can.&lt;br /&gt;
&lt;br /&gt;
== Blinking LED ==&lt;br /&gt;
'''Goal''': Make a LED blink. &lt;br /&gt;
&lt;br /&gt;
I used the [[Une_led_qui_clignote_avec_le_spartan_3|LED blinking page]] VHDL code to generate the FPGA binary file with Xilinx ISE. (more details are needed on this wiki to generate .bit files)&lt;br /&gt;
&lt;br /&gt;
On the hardware side, I connected the 2 FPGA pins L28P and L28N to a [[wikipedia:breadboard|breadboard]] with wires. Those 2 pins are accessible on the DevLight bottom, as mentioned on the [http://www.armadeus.com/_downloads/apf9328DevLight/documentation/dataSheet_APF9328_DevLight_V2.pdf datasheet], page 9. Those 2 pin-holes are too small to solder [http://www.selectronic.fr/article.asp?article_ref_entier=90.0425-9999 &amp;quot;conventional&amp;quot; pins], so my set-up is quite unstable. I need to make it more robust.&lt;br /&gt;
&lt;br /&gt;
On the software side, I don't want (yet) to flash my board with a new software, so I am using the default one provided (Linux kernel 2.6.27.2). Moreover I want to load the FPGA from Linux (and not [[InstallTargetSoftware#FPGA_firmware_installation|from U-boot]]).&lt;br /&gt;
I set-up a [[MultiMediaCard|microSD card]] to transfer my files. to load the FPGA binary file, in addition to the .bit file, I needed the [[FPGA_loader|fpgaloader]] driver script which seems not to be by default on the board. &lt;br /&gt;
&lt;br /&gt;
After booting the board, I use the following commands:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
 # mount -t ext2 /dev/mmcblk0p2 /mnt/mmc&lt;br /&gt;
 # cd /mnt/mmc/root/&lt;br /&gt;
 # ls&lt;br /&gt;
 Clk_div_led.bit  fpgaloader.sh&lt;br /&gt;
 # sh fpgaloader.sh&lt;br /&gt;
 fpgaloader module v0.0.6 successfully loaded !&lt;br /&gt;
 # dd if=Clk_div_led.bit of=/dev/fpga/fpgaloader&lt;br /&gt;
 255+1 records in&lt;br /&gt;
 255+1 records out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And it blinks!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
Booting from SD card: (links, not tried yet)&lt;br /&gt;
* http://wiki.openmoko.org/wiki/Booting_from_SD&lt;br /&gt;
* http://docwiki.gumstix.org/U-Boot#The_MMC_card&lt;/div&gt;</summary>
		<author><name>JulienC</name></author>	</entry>

	<entry>
		<id>http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=5955</id>
		<title>User:JulienC</title>
		<link rel="alternate" type="text/html" href="http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=5955"/>
				<updated>2009-03-01T20:58:30Z</updated>
		
		<summary type="html">&lt;p&gt;JulienC: wikipedia links enabled (Thanks!)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My name is Julien and I am a French engineer in embedded systems. My interests are in FPGA programming and embedded Linux. I will try to share my experiments on this wiki.&lt;br /&gt;
&lt;br /&gt;
I am new in the FPGA world. I will try to learn and share as much as I can.&lt;br /&gt;
&lt;br /&gt;
== Blinking LED ==&lt;br /&gt;
'''Goal''': Make a LED blink. &lt;br /&gt;
&lt;br /&gt;
I used the [[Une_led_qui_clignote_avec_le_spartan_3|LED blinking page]] VHDL code to generate the FPGA binary file with Xilinx ISE. (more details are needed on this wiki to generate .bit files)&lt;br /&gt;
&lt;br /&gt;
On the hardware side, I connected the 2 FPGA pins L28P and L28N to a [[wikipedia:breadboard|breadboard]] with wires. Those 2 pins are accessible on the DevLight bottom, as mentioned on the [http://www.armadeus.com/_downloads/apf9328DevLight/documentation/dataSheet_APF9328_DevLight_V2.pdf datasheet], page 9. Those 2 pin-holes are too small to solder [http://www.selectronic.fr/article.asp?article_ref_entier=90.0425-9999 &amp;quot;conventional&amp;quot; pins], so my set-up is quite unstable. I need to make it more robust.&lt;br /&gt;
&lt;br /&gt;
On the software side, I don't want (yet) to flash my board with a new software, so I am using the default one provided (Linux kernel 2.6.27.2). Moreover I want to load the FPGA from Linux (and not [[InstallTargetSoftware#FPGA_firmware_installation|from U-boot]]).&lt;br /&gt;
I set-up a [[MultiMediaCard|microSD card]] to transfer my files. to load the FPGA binary file, in addition to the .bit file, I needed the [[FPGA_loader|fpgaloader]] driver script which seems not to be by default on the board. &lt;br /&gt;
&lt;br /&gt;
After booting the board, I use the following commands:&lt;br /&gt;
 # mount -t ext2 /dev/mmcblk0p1 /mnt/mmc&lt;br /&gt;
 # cd /mnt/mmc/root/&lt;br /&gt;
 # ls&lt;br /&gt;
 Clk_div_led.bit  fpgaloader.sh&lt;br /&gt;
 # sh fpgaloader.sh&lt;br /&gt;
 fpgaloader module v0.0.6 successfully loaded !&lt;br /&gt;
 # dd if=Clk_div_led.bit of=/dev/fpga/fpgaloader&lt;br /&gt;
 255+1 records in&lt;br /&gt;
 255+1 records out&lt;br /&gt;
&lt;br /&gt;
And it blinks!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
Booting from SD card: (links, not tried yet)&lt;br /&gt;
* http://wiki.openmoko.org/wiki/Booting_from_SD&lt;br /&gt;
* http://docwiki.gumstix.org/U-Boot#The_MMC_card&lt;/div&gt;</summary>
		<author><name>JulienC</name></author>	</entry>

	<entry>
		<id>http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=5952</id>
		<title>User:JulienC</title>
		<link rel="alternate" type="text/html" href="http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=5952"/>
				<updated>2009-03-01T00:15:13Z</updated>
		
		<summary type="html">&lt;p&gt;JulienC: Booting from SD card (links to investigate)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My name is Julien and I am a French engineer in embedded systems. My interests are in FPGA programming and embedded Linux. I will try to share my experiments on this wiki.&lt;br /&gt;
&lt;br /&gt;
I am new in the FPGA world. I will try to learn and share as much as I can.&lt;br /&gt;
&lt;br /&gt;
== Blinking LED ==&lt;br /&gt;
'''Goal''': Make a LED blink. &lt;br /&gt;
&lt;br /&gt;
I used the [[Une_led_qui_clignote_avec_le_spartan_3|LED blinking page]] VHDL code to generate the FPGA binary file with Xilinx ISE. (more details are needed on this wiki to generate .bit files)&lt;br /&gt;
&lt;br /&gt;
On the hardware side, I connected the 2 FPGA pins L28P and L28N to a [[wiktionary:wikipedia:breadboard|breadboard]] with wires. Those 2 pins are accessible on the DevLight bottom, as mentioned on the [http://www.armadeus.com/_downloads/apf9328DevLight/documentation/dataSheet_APF9328_DevLight_V2.pdf datasheet], page 9. Those 2 pin-holes are too small to solder [http://www.selectronic.fr/article.asp?article_ref_entier=90.0425-9999 &amp;quot;conventional&amp;quot; pins], so my set-up is quite unstable. I need to make it more robust.&lt;br /&gt;
&lt;br /&gt;
On the software side, I don't want (yet) to flash my board with a new software, so I am using the default one provided (Linux kernel 2.6.27.2). Moreover I want to load the FPGA from Linux (and not [[InstallTargetSoftware#FPGA_firmware_installation|from U-boot]]).&lt;br /&gt;
I set-up a [[MultiMediaCard|microSD card]] to transfer my files. to load the FPGA binary file, in addition to the .bit file, I needed the [[FPGA_loader|fpgaloader]] driver script which seems not to be by default on the board. &lt;br /&gt;
&lt;br /&gt;
After booting the board, I use the following commands:&lt;br /&gt;
 # mount -t ext2 /dev/mmcblk0p1 /mnt/mmc&lt;br /&gt;
 # cd /mnt/mmc/root/&lt;br /&gt;
 # ls&lt;br /&gt;
 Clk_div_led.bit  fpgaloader.sh&lt;br /&gt;
 # sh fpgaloader.sh&lt;br /&gt;
 fpgaloader module v0.0.6 successfully loaded !&lt;br /&gt;
 # dd if=Clk_div_led.bit of=/dev/fpga/fpgaloader&lt;br /&gt;
 255+1 records in&lt;br /&gt;
 255+1 records out&lt;br /&gt;
&lt;br /&gt;
And it blinks!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
Booting from SD card: (links, not tried yet)&lt;br /&gt;
* http://wiki.openmoko.org/wiki/Booting_from_SD&lt;br /&gt;
* http://docwiki.gumstix.org/U-Boot#The_MMC_card&lt;/div&gt;</summary>
		<author><name>JulienC</name></author>	</entry>

	<entry>
		<id>http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=5951</id>
		<title>User:JulienC</title>
		<link rel="alternate" type="text/html" href="http://www.armadeus.org/wiki/index.php?title=User:JulienC&amp;diff=5951"/>
				<updated>2009-02-28T22:12:09Z</updated>
		
		<summary type="html">&lt;p&gt;JulienC: My first FPGA blinking LED !&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My name is Julien and I am a French engineer in embedded systems. My interests are in FPGA programming and embedded Linux. I will try to share my experiments on this wiki.&lt;br /&gt;
&lt;br /&gt;
I am new in the FPGA world. I will try to learn and share as much as I can.&lt;br /&gt;
&lt;br /&gt;
== Blinking LED ==&lt;br /&gt;
'''Goal''': Make a LED blink. &lt;br /&gt;
&lt;br /&gt;
I used the [[Une_led_qui_clignote_avec_le_spartan_3|LED blinking page]] VHDL code to generate the FPGA binary file with Xilinx ISE. (more details are needed on this wiki to generate .bit files)&lt;br /&gt;
&lt;br /&gt;
On the hardware side, I connected the 2 FPGA pins L28P and L28N to a [[wiktionary:wikipedia:breadboard|breadboard]] with wires. Those 2 pins are accessible on the DevLight bottom, as mentioned on the [http://www.armadeus.com/_downloads/apf9328DevLight/documentation/dataSheet_APF9328_DevLight_V2.pdf datasheet], page 9. Those 2 pin-holes are too small to solder [http://www.selectronic.fr/article.asp?article_ref_entier=90.0425-9999 &amp;quot;conventional&amp;quot; pins], so my set-up is quite unstable. I need to make it more robust.&lt;br /&gt;
&lt;br /&gt;
On the software side, I don't want (yet) to flash my board with a new software, so I am using the default one provided (Linux kernel 2.6.27.2). Moreover I want to load the FPGA from Linux (and not [[InstallTargetSoftware#FPGA_firmware_installation|from U-boot]]).&lt;br /&gt;
I set-up a [[MultiMediaCard|microSD card]] to transfer my files. to load the FPGA binary file, in addition to the .bit file, I needed the [[FPGA_loader|fpgaloader]] driver script which seems not to be by default on the board. &lt;br /&gt;
&lt;br /&gt;
After booting the board, I use the following commands:&lt;br /&gt;
 # mount -t ext2 /dev/mmcblk0p1 /mnt/mmc&lt;br /&gt;
 # cd /mnt/mmc/root/&lt;br /&gt;
 # ls&lt;br /&gt;
 Clk_div_led.bit  fpgaloader.sh&lt;br /&gt;
 # sh fpgaloader.sh&lt;br /&gt;
 fpgaloader module v0.0.6 successfully loaded !&lt;br /&gt;
 # dd if=Clk_div_led.bit of=/dev/fpga/fpgaloader&lt;br /&gt;
 255+1 records in&lt;br /&gt;
 255+1 records out&lt;br /&gt;
&lt;br /&gt;
And it blinks!&lt;/div&gt;</summary>
		<author><name>JulienC</name></author>	</entry>

	<entry>
		<id>http://www.armadeus.org/wiki/index.php?title=MMC/SD&amp;diff=5950</id>
		<title>MMC/SD</title>
		<link rel="alternate" type="text/html" href="http://www.armadeus.org/wiki/index.php?title=MMC/SD&amp;diff=5950"/>
				<updated>2009-02-28T16:56:42Z</updated>
		
		<summary type="html">&lt;p&gt;JulienC: /* microSD/TransFlash: */  EMTEC 2 Gbyte (ext2)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How-To connect an MMC/SD adapter/connector to your APF9328&lt;br /&gt;
&lt;br /&gt;
For instructions on how to use MMC/SD on Linux, see [[MultiMediaCard]] page.&amp;lt;br&amp;gt;&lt;br /&gt;
'''SDCard, MiniSD, and Transflash/MicroSD are all the same devices but in different package shapes and are all pin compatible.''' &amp;lt;br&amp;gt;&lt;br /&gt;
On Armadeus boards, MMC are controlled in 1 bit MMC mode and SD/MiniSD/MicroSD in 4 bits SD mode.&lt;br /&gt;
We don't use MMC/SD in slow &amp;amp; error prone SPI mode.&lt;br /&gt;
&lt;br /&gt;
== Adapter board (for DevLight 1.0 or your custom board) ==&lt;br /&gt;
We have designed a small adapter board with a push-pull MMC/SD connector on it.&lt;br /&gt;
You need to connect the signals listed in the table below to the corresponding one on your DevLight board.&lt;br /&gt;
The WP and CD_SW signals are optional and must be connected to free i.MXL GPIOs, if used.&lt;br /&gt;
&lt;br /&gt;
[[Image:MMC_Adapt.jpg|thumb|center|Top view, connector on the left]]&lt;br /&gt;
&lt;br /&gt;
Signals name (Top view with MMC connector on the right):[[Image:MMC_Adapt_pinout.jpg|thumb|Left|]]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; summary=&amp;quot;Signal connections&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
!'''Adapter Pin''' || '''Desc''' || '''Adapter Pin''' || '''Desc'''&lt;br /&gt;
|----------------&lt;br /&gt;
|1 (square) || +3.3V || 2 || SD_DAT2&lt;br /&gt;
|----------------&lt;br /&gt;
|3 || SD_CMD || 4 || SD_DAT3&lt;br /&gt;
|----------------&lt;br /&gt;
|5 || SD_CLK || 6 || SD_DAT0&lt;br /&gt;
|----------------&lt;br /&gt;
|7 || WP (option) || 8 || SD_DAT1&lt;br /&gt;
|----------------&lt;br /&gt;
|9 || CD_SW (option) || 10 || GND&lt;br /&gt;
|----------------&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Remarks: &lt;br /&gt;
* Pin 1 (rectangular/square pad)&lt;br /&gt;
* WP: write protect&lt;br /&gt;
* CD_SW: Card Detect switch&lt;br /&gt;
&lt;br /&gt;
'''If you don't want to buy such an adapter or don't have a MMC slot (and are a hacker ;-) ), you can still try this link:'''&lt;br /&gt;
* http://www.hackaday.com/2006/09/12/floppy-connector-mmc-card-slot/&lt;br /&gt;
&lt;br /&gt;
== On a DevFull board, there is already a MMC/SD connector ==&lt;br /&gt;
&lt;br /&gt;
== On a DevLight 2.0 board, there is already a microSD connector ==&lt;br /&gt;
&lt;br /&gt;
== Supported Cards ==&lt;br /&gt;
Here is a list of the current cards which were tested. Speeds are rounded to the nearest multiple of 5:&amp;lt;br&amp;gt;&lt;br /&gt;
===MMC===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; summary=&amp;quot;MMC&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
!'''Model''' || '''Status''' || '''Speed in kB/sec (read/write)''' || '''Comments'''&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Hama 256 Mbytes''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 895 / 455  ||  Ext2&lt;br /&gt;
|----------------&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===MMC+===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; summary=&amp;quot;MMC+&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
!'''Model''' || '''Status''' || '''Speed in kB/sec (read/write)''' || '''Comments'''&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Kingston 256 Mbytes''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || NA  || &lt;br /&gt;
|----------------&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===SD:===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; summary=&amp;quot;MMC+&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
!'''Model''' || '''Status''' || '''Speed in kB/sec (read/write)''' || '''Comments'''&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Kingston 512 Mbytes''' || style=&amp;quot;background:#00ff00;&amp;quot; |working ||  3275 / 155  || Ext2&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Kingston 256 Mbytes''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || NA  || &lt;br /&gt;
|----------------&lt;br /&gt;
|'''Dane-Elec 2 Gbytes''' || style=&amp;quot;background:#ff0000;&amp;quot; |KO || NA  || OK in 1bit mode. doesn't work : Card recognized but partition table not found in 4bits mode&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Transcend 2 Gbytes (x150)''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || NA  || &lt;br /&gt;
|----------------&lt;br /&gt;
|'''Sandisk 512 Mbytes''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || NA  || formating failure may happen sometimes. Workaround: retry&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Panasonic 16 Mbytes''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || NA  || Ext2&lt;br /&gt;
|----------------&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===MiniSD:===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; summary=&amp;quot;MiniSDs&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
!'''Model''' || '''Status''' || '''Speed in kB/sec (read/write)''' || '''Comments'''&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Corsair 1Gbytes''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 3330 / 365  ||  VFAT&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Sandisk 1Gbytes''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 3300 / 295  || Ext2&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Sandisk 512Mbytes''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 2750 / 215  || VFAT&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Transcend 512Mbytes''' || style=&amp;quot;background:#ff0000;&amp;quot; | not recognized || NA || &lt;br /&gt;
|----------------&lt;br /&gt;
|'''Extreme Memory 512Mbytes''' || style=&amp;quot;background:#ff0000;&amp;quot; |not recognized || NA || &lt;br /&gt;
|----------------&lt;br /&gt;
|'''Dane-Elec 1Gbytes''' || style=&amp;quot;background:#ff0000;&amp;quot; |doesn't work || NA || Card recognized but partition table not found&lt;br /&gt;
|----------------&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===microSD/TransFlash:===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; summary=&amp;quot;MicroSDs&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
!'''Model''' || '''Status''' || colspan=&amp;quot;2&amp;quot; | '''Speed in kB/sec (read/write)'''&amp;lt;br&amp;gt; APF9328  |  APF27 || '''Comments'''&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Sandisk 512 Mbytes''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 3330 / 320 || NT / NT ||  VFAT&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Dane-Elec 1 Gbyte''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 3415 / 130 || NT / NT ||  VFAT&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Sandisk 1 Gbyte''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 3355 / 130 || NT / NT ||  VFAT&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Kingston 1 Gbyte''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 3355 / 130 || NT / NT ||  VFAT&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Kingston 2 Gbyte''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 3355 / 130 || NT / NT ||  VFAT&lt;br /&gt;
|----------------&lt;br /&gt;
|'''EMTEC 2 Gbyte''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 3232 / 1548 || NT / NT ||  EXT2&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Kingston 4 Gbyte''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 3355 / 130 || NT / NT ||  VFAT&lt;br /&gt;
|----------------&lt;br /&gt;
|'''Transcend 4 Gbyte &amp;lt;br&amp;gt; SDHC Class 6''' || style=&amp;quot;background:#00ff00;&amp;quot; |working || 3379 / 2668 || NT / NT ||  VFAT&lt;br /&gt;
|----------------&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Test method===&lt;br /&gt;
Use test script (''mmc_perf.sh'') located in ''armadeus/target/test/mmc/''. Copy it on your target and launch it:&lt;br /&gt;
 # mmc_perf.sh speed&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [[MultiMediaCard|How to use MMC/SD/microSD on Linux]]&lt;br /&gt;
* [http://elm-chan.org/docs/mmc/mmc_e.html How to use MMC/SD]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{LanguageBar|MMC/SD|MMC/SD|MMC/SD}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;br /&gt;
[[Category:MassStorage]]&lt;/div&gt;</summary>
		<author><name>JulienC</name></author>	</entry>

	<entry>
		<id>http://www.armadeus.org/wiki/index.php?title=FPGA_registers_access_from_Linux_userspace&amp;diff=5829</id>
		<title>FPGA registers access from Linux userspace</title>
		<link rel="alternate" type="text/html" href="http://www.armadeus.org/wiki/index.php?title=FPGA_registers_access_from_Linux_userspace&amp;diff=5829"/>
				<updated>2009-02-15T21:55:02Z</updated>
		
		<summary type="html">&lt;p&gt;JulienC: /* the mmap problem */ spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:FPGA]]&lt;br /&gt;
&lt;br /&gt;
= fpgaregs =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== compile ==&lt;br /&gt;
To access FPGA registers a tool named ''fpgaregs'' is available under ''target/linux/module/fpga/dev_tools/'' directory. To compile it for apf9328, use the command above :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
arm-linux-gcc -mcpu=arm920t fpgaregs.c -o fpgaregs&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== use ==&lt;br /&gt;
&lt;br /&gt;
fpgaregs can be used to read and write 16 or 32 bits registers. &lt;br /&gt;
&lt;br /&gt;
'''read 16 bits'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fpgaregs w &amp;lt;address&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;address&amp;gt; is an address relative to fpga mapping in hexadecimal value.&lt;br /&gt;
&lt;br /&gt;
'''write 16 bits'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fpgaregs w &amp;lt;address&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;value&amp;gt; is hexadecimal value to write.&lt;br /&gt;
&lt;br /&gt;
'''read 32 bits'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fpgaregs l &amp;lt;address&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''write 32 bits'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fpgaregs l &amp;lt;address&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= the mmap problem =&lt;br /&gt;
&lt;br /&gt;
First of all, you need to get a file descriptor for ''/dev/mem'' using the ''open()'' function&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
ffpga=open(&amp;quot;/dev/mem&amp;quot;,O_RDWR|O_SYNC);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now you have a valid file descriptor to access your FPGA.&lt;br /&gt;
&lt;br /&gt;
The O_SYNC option is recommended to avoid Linux to cache the content of /dev/mem and delay any modification done in this file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To access fpga register, fpgaregs use the ''mmap()'' system call :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
ptr_fpga = mmap (0, 8192, PROT_READ|PROT_WRITE, MAP_SHARED, ffpga, FPGA_ADDRESS);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thanks to this function, fpga registers are accessible directly on memory with pointer ptr_fpga. To read and write in 16bits or in 32 bits we will cast the pointer value in ''unsigned short'' or ''unsigned int'' :&lt;br /&gt;
&lt;br /&gt;
'''16bits'''&lt;br /&gt;
''write''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        *(unsigned short*)(ptr_fpga+(address)) = (unsigned short)value;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
''read''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
          value = *(unsigned short*)(ptr_fpga+(address));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''32 bits'''&lt;br /&gt;
''write''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        *(unsigned int*)(ptr_fpga+(address)) = (unsigned short)value;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''read''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
          value = *(unsigned int*)(ptr_fpga+(address));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
By default, if the specific ''arm920t'' target is not specified, ''arm-linux-gcc'' will try to generate compatible read/write for all ARM9 model when it access register in 16bits. Indeed it seems that not all ARM9 have 16bits read/write capabilities (''ldrh'' asm instruction).&lt;br /&gt;
&lt;br /&gt;
As the interface between i.MXL and FPGA on APF9328 has no 8bits read/write capabilities, each 8 bits access is recognized by the FPGA as a 16bits access. So on each 16bits access of the i.MXL, FPGA will process two 16bits access instead of 1. That is a problem when accessing a FIFO for example.&lt;br /&gt;
&lt;br /&gt;
To avoid this painful problem don't forget the ''-mcpu=arm920t'' option when compiling ''fpgaregs'' for APF9328.&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* http://sources.redhat.com/ml/crossgcc/2005-08/msg00120.html : Explanation of the problem.&lt;/div&gt;</summary>
		<author><name>JulienC</name></author>	</entry>

	</feed>