1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00
elua/doc/en/installing_at91sam7x.html
James Snyder bd1465ca50 Merge 0.6 branch to trunk.
Conflicts:
	SConstruct
	doc/en/arch_platform.html
	doc/en/comunity.html
	doc/en/overview.html
	doc/en/refman.html
	doc/en/refman_gen.html
	doc/en/status.html
	doc/en/tut_bootstick.html
	doc/images/lng_pt.png
	doc/images/minusnode.png
	doc/images/next.png
	doc/images/node.png
	doc/images/nodelast.png
	doc/images/plusnode.png
	doc/images/plusnodelast.png
	doc/images/previous.png
	doc/images/showall.png
	doc/images/sync.png
	doc/images/vertline.png
	doc/pt/arch.html
	doc/pt/arch_coding.html
	doc/pt/arch_con_term.html
	doc/pt/arch_newport.html
	doc/pt/arch_overview.html
	doc/pt/arch_platform.html
	doc/pt/arch_tcpip.html
	doc/pt/building.html
	doc/pt/comunity.html
	doc/pt/dl_binaries.html
	doc/pt/dl_old.html
	doc/pt/dl_sources.html
	doc/pt/downloads.html
	doc/pt/examples.html
	doc/pt/faq.html
	doc/pt/installing_i386.html
	doc/pt/installing_lm3s.html
	doc/pt/news.html
	doc/pt/overview.html
	doc/pt/refman_dep.html
	doc/pt/refman_gen.html
	doc/pt/status.html
	doc/pt/tc_386.html
	doc/pt/toolchains.html
	doc/pt/tut_openocd.html
	doc/pt/using.html
	romfs/LM3S.lua
	romfs/led.lua
	romfs/morse.lua
	romfs/pong.lua
	src/lua/linit.c
	src/modules/auxmods.h
	src/platform/lm3s/platform.c
	src/platform/lm3s/platform_conf.h
	src/platform/sim/platform_conf.h
2009-10-13 02:14:27 +00:00

48 lines
5.0 KiB
HTML

$$HEADER$$
<h3>Using <b>eLua</b> with the AT91SAM7X CPUs from Atmel</h3>
<p><a href="http://www.atmel.com">Atmel</a> is a company that doesn't need any kind of introduction :) Their huge product range include some quite nice ARM7TDMI core implementations.
Among them are the <a href="http://www.atmel.com/dyn/products/Product_card.asp?part_id=3755">AT91SAM7X256</a> and
<a href="http://www.atmel.com/dyn/products/Product_card.asp?part_id=4104">AT91SAM7X512</a> CPUs. The only difference between them is the ammount of internal memory (256k Flash+64k RAM for
AT91SAM7X256 vs. 512k Flash+128k RAM for AT91SAM7X512). Loaded with peripherals, and accompanied by a good support package, they make a perfect host for <b>eLua</b>. For this tutorial
I'm going to use the <a href="http://www.olimex.com/dev/sam7-ex256.html">SAM7-EX256</a> development board from <a href="http://www.olimex.com">Olimex</a>. It's quite a
decent board, and also reasonably priced, although it lacks a proper documentation package in my oppinion. It is equipped with an AT91SAM7X256 CPU. As much as I'd like to get
my hands on a board with a AT91SAM7X512 CPU, this didn't happen so far, so I'm going to stick with AT91SAM7X256. Of course, you can still try this tutorial if you have
a different AT91SAM7X256 development board. Plus, the instructions should be quite similar for AT91SAM7X512 CPUs.
</p>
<h3> Prerequisites</h3>
<p>Before you'll be able to use <b>eLua</b> on the AT91SAM7X256 CPU, make sure that:</p>
<ul>
<li>you're using Windows. This isn't actually a strict requirement, it just makes life a bit easier. As the Atmel CPU is supported by the <a href="http://openocd.berlios.de/web/">OpenOCD</a> package, programming it from Linux is definitely possible, as OpenOCD runs equally well on Windows and Linux. However, since I'm forced to use Windows anyway because of the restrictions of
some of my other development boards, I'm going to take advantage of this and cover the Atmel programming tool instead of OpenOCD. The advantage is that you don't need a JTAG "dongle"
to program your board (which would be the case if you were using OpenOCD). The disadvantage, of course, is that the Atmel tool runs only on Windows. Plus, I personally find OpenOCD
tedious to use. If you still want to use it though, you might want to check the forementioned <a href="http://www.olimex.com/dev/sam7-ex256.html">Olimex page</a>, they have some OpenOCD related links there.
That said, from now on I'm going to assume that you use Windows. I'm using XP, Vista should work too.</li>
<li>you have installed the <a href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3883">AT91 In-system Programmer (ISP)</a> package from Atmel.</li>
<li>you already have your <b>eLua</b> image for the AT91SAM7X256 CPU (<a href="building.html">built</a> or <a href="downloads.html">downloaded</a>).</li>
</ul>
<h3>Programming eLua on the SAM7-EX256 board</h3>
<p>This involves some jumper tricks, but it's still easy enough to do. We'll need to play with four jumpers: the "USB/EXT" jumper (located to the right of the USB connector
from the bottom left part of the board in its close proximity), the "ERASE" jumper (located at the right of the "UEXT" header connector in the top-left
part of the board, right ahead the quartz), and the block of two jumpers located right under the "RS232" connector on the board (the one that is adjacent to the Ethernet connector on its right side,
<b>NOT</b> the one labeled "CAN" that is closer to the right edge of the board). </p>
<ul>
<li>connect your board to your PC using a suitable USB cable.</li>
<li>if you have a terminal emulation program connected to the board, close it (or at least disconnect it from its port).</li>
<li>make sure that the the block of two jumpers mentioned before is set to positions "RXD0" and "TXD0" respectively, <b>NOT</b> "DRXD" and "DTXD".</li>
<li>make sure that the "USB/EXT" connector is set to "USB" (position 1-2) and that the "ERASE" jumper is disconnected.</li>
<li>connect the "ERASE" jumper and wait one second or more.</li>
<li>disconnect the "USB/EXT" jumper completely, then disconnect the "ERASE" jumper too.</li>
<li>connect the "USB/EXT" jumper back in the "USB" position (1-2).</li>
<li>fire up the Atmel programming tool. If you haven't installed your board yet, you'll be asked to do so at this point.</li>
<li>select "\usb\ARMx" as the connection (for me it's \usb\ARM0) and "AT91SAM7X256-EK" as the board.</li>
<li>select the "Flash" tab from the middle tab of the window.</li>
<li>in the "Send file name" box select your <b>eLua</b> bin file that you got from the compilation step and then press "Send File".</li>
<li>wait for the file to be sent and answer "No" to the "Lock region(s)" dialog.</li>
<li>in the window section below ("Scripts") select "Boot from Flash (GPNVM2)" then press "Execute".</li>
<li>exit the application.</li>
</ul>
<p>That's it! A bit tricky, but <b>eLua</b> is now programmed in the CPU, so you can start your terminal emulator and enjoy it, as described in <a href="using.html">using eLua</a>.
</p>
$$FOOTER$$