1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00

- Still strugling with the new hirarchy to satisfy the distro & new site

- This commit brings back some files/content previously migrated to CMS
  This is not the final structure yet
  docdata.lua was edited accordingly
This commit is contained in:
Dado Sutter 2011-05-08 15:04:34 -03:00
parent 17487f9ebe
commit b0339d55f6
16 changed files with 1175 additions and 14 deletions

View File

@ -24,10 +24,93 @@ AND TITLE FIELDS! See the definition of 'forum.html' below for an example of suc
local menu =
{
{ { "eLua Documentation"}, "index.html"},
-- "eLua project" (menu separator)
--[[ { { "eLua project", "Projeto eLua" } },
-- "Overview"
{ { "Overview", "Apresenta<EFBFBD><EFBFBD>o" }, "overview.html",
{
{ { "What is eLua?", "O que <20> eLua ?" }, "overview.html#whatis" },
{ { "Features", "Caracter<EFBFBD>sticas" }, "overview.html#features" },
{ { "Audience", "P<EFBFBD>blico Alvo" }, "overview.html#audience" },
{ { "Authors", "Autores" }, "overview.html#authors" },
{ { "Contacts","Contatos" }, "overview.html#contacts" },
{ { "License", "Licen<EFBFBD>a" },"overview.html#license" },
}
},
-- "Community"
{ { "Community", "Comunidade" }, "comunity.html",
{
{ { "Discussion Lists", "Listas de Discuss<73>o" }, "comunity.html#lists" },
{ "Forums", "comunity.html#forums" },
{ "IRC", "comunity.html#irc" },
{ "Twitter", "comunity.html#twitter" },
{ "Wiki", "comunity.html#userswiki" },
{ { "Credits", "Cr<EFBFBD>ditos" }, "comunity.html#credits" },
{ "Donations", "comunity.html#donations" },
{ nil, "forum.html", nil, "Forum" } -- "hidden" entry (doesn't appear in the menu)
}
},
-- News
{ { "News", "Not<EFBFBD>cias" }, "news.html" },
-- Media
{ "Media", "media.html" },
-- Wiki
{ "eLua Wiki", "http://wiki.eluaproject.net" },
-- Web builder
{ "eLua Web builder", "http://builder.eluaproject.net" },
-- Tracker
{ "eLua bug tracker", "http://tracker.eluaproject.net" },
-- "Status"
{ "Status", "status.html",
{
{ { "Supported platforms", "Plataformas Suportadas" }, "status.html" },
{ { "Modules per platform table", "M<EFBFBD>dulos por plataforma" }, "status.html#plat_modules" },
{ { "Modules overview status", "Vis<EFBFBD>o geral dos m<>dulos" }, "status.html#gen_modules" },
{ { "Roadmap", "Planejamento Futuro" }, "status.html#roadmap" }
}
},
-- "Using eLua" -- Menu Separator
{ { "Using eLua", "Usando eLua"}, nil },
{ "Downloads", "downloads.html", -- ### How come it opens downloads.html without specifying here ? :) Nice but unclear.
{
{ { "Binaries", "Bin<EFBFBD>rios" }, "downloads.html#binaries" },
{ { "Source code", "C<EFBFBD>digo Fonte" }, "downloads.html#source",
{
{ { "Official releases", "Vers<EFBFBD>es Oficiais" }, "downloads.html#official" },
{ "Bleeding edge (SVN)", "downloads.html#svnpublic" },
{ { "Developers", "Desenvolvedores" }, "downloads.html#svndev" },
}
},
{ { "Old versions", "Vers<EFBFBD>es Anteriores" }, "dl_old.html",
{
{ "0.7", "dl_old.html#v070" },
{ "0.6", "dl_old.html#v060" },
{ "0.5", "dl_old.html#v050" },
{ "0.4.1", "dl_old.html#v041" },
{ "0.4", "dl_old.html#v04" },
{ "0.3", "dl_old.html#v03" },
{ "0.2", "dl_old.html#v02" },
{ "0.1", "dl_old.html#v01" },
{ { "Version history", "Hist<EFBFBD>rico das Vers<72>es" }, "versionhistory.html" },
}
},
},
},
--]]
{ { "Introduction"}, "index.html"},
-- "Using eLua" -- Menu Separator
{ { "Generic info", "Doc Genérica" }, "using.html",
{ { "Generic info", "Doc Gen<EFBFBD>rica" }, "using.html",
{
{ { "Using eLua", "Usando eLua" }, "using.html",
{
@ -41,6 +124,8 @@ local menu =
{ "The serial multiplexer", "sermux.html" }
},
},
{ { "Code examples", "Exemplos de C<>digo" }, "examples.html" },
{ { "FAQ", "Perguntas Frequentes (FAQ)" }, "faq.html" },
{ "eLua file systems", "filesystems.html",
{
{ { "Read-Only FS in MCU Flash", "O ROM File System em Flash" }, "arch_romfs.html" },
@ -62,19 +147,32 @@ local menu =
},
},
},
{ { "Platform info", "Doc Espec<65>fica" }, "installing.html",
{
{ "AT91SAM7x", "installing_at91sam7x.html" },
{ "AVR32", "installing_avr32.html" },
{ "i386", "installing_i386.html" },
{ "LM3S", "installing_lm3s.html" },
{ "LPC2888", "installing_lpc2888.html" },
{ "STR7", "installing_str7.html" },
{ "STR9", "installing_str9.html" },
{ "STM32", "installing_stm32.html" },
{ "LPC2468", "installing_lpc2468.html" }
},
},
-- "eLua internals" (menu separator)
{ { "eLua internals" }, "",
{ { "eLua internals" },"",
{
{ -- "Overview"
{ "Overview", "Visão Geral" }, "arch_overview.html",
{ "Overview", "Vis<EFBFBD>o Geral" }, "arch_overview.html",
{
{ { "eLua's Architecture", "Arquitetura de eLua" }, "arch_overview.html#structure" },
{ { "Common code", "Código Básico" }, "arch_overview.html#common" },
{ { "Common code", "C<EFBFBD>digo B<>sico" }, "arch_overview.html#common" },
{ { "Interface architecture", "Interfaceamento" }, "arch_overview.html#platform" },
{ { "Booting eLua", "O Boot de eLua" }, "arch_overview.html#boot" },
{ { "Platforms and ports", "Portabilização" }, "arch_overview.html#platforms" },
{ { "Platforms and ports", "Portabiliza<EFBFBD><EFBFBD>o" }, "arch_overview.html#platforms" },
{ { "Adding a new port", "Portando eLua" }, "arch_newport.html" },
{ "Implementing interrupts", "arch_ints.html",
{
@ -87,12 +185,15 @@ local menu =
{ { "Platform interface", "Interfaceamento" }, "arch_platform.html", "arch_platform" },
-- Other WRITE THE arch_platform_other.html file
{ { "More information", "Informações Adicionais" }, "#",
{ { "More information", "Informa<EFBFBD><EFBFBD>es Adicionais" }, "#",
{
{ { "Consoles and terminals", "Consoles e Terminais" }, "arch_con_term.html" },
{ { "TCP/IP in eLua", "TCP/IP em eLua" }, "arch_tcpip.html" },
{ { "LTR (Lua Tiny RAM) in eLua", "LTR (Lua Tiny RAM) em eLua" }, "arch_ltr.html" },
{ "EGC (Emergency GC) in eLua", "elua_egc.html" },
{ { "Booting on a PC", "Bootando num PC" }, "tut_bootpc.html" },
{ { "Booting from a PenDrive", "Bootando de um Pen-Drive" }, "tut_bootstick.html" },
{ { "Using OpenOCD", "Usando OpenOCD" }, "tut_openocd.html" },
{ { "eLua toolchains", "Toolchains para eLua" }, "toolchains.html" },
{ { "Building toolchains", "Build de Toolchains" }, "tchainbuild.html",
{
@ -101,20 +202,20 @@ local menu =
{ "i386", "tc_386.html" }
},
},
{ { "eLua coding style", "Regras de Codificação" }, "arch_coding.html" },
{ { "eLua coding style", "Regras de Codifica<EFBFBD><EFBFBD>o" }, "arch_coding.html" },
}
},
}
},
{ -- "Reference manual" (menu separator)
{ "Reference Manual", "Manual de Referência" },"",
{ "Reference Manual", "Manual de Refer<EFBFBD>ncia" },"",
{
-- "Generic modules" (automatically generated)
{ { "Generic modules", "Módulos Genéricos" }, "refman_gen.html", "refman_gen" },
{ { "Generic modules", "M<EFBFBD>dulos Gen<65>ricos" }, "refman_gen.html", "refman_gen" },
-- "Platform modules" (automatically generated)
{ { "Platform modules", "Módulos Específicos" }, "refman_dep.html",
{ { "Platform modules", "M<EFBFBD>dulos Espec<65>ficos" }, "refman_dep.html",
{
{ "lm3s", "modules_lm3s.html", "refman_ps_lm3s" },
{ "str9", "modules_str9.html", "refman_ps_str9" },
@ -130,9 +231,9 @@ local menu =
-- defined at the beginning of buildall.lua
local translations =
{
{ "Overview", "Apresentação" },
{ "Overview", "Apresenta<EFBFBD><EFBFBD>o" },
{ "Data structures", "Estrutura" },
{ "Functions", "Funções" },
{ "Functions", "Fun<EFBFBD><EFBFBD>es" },
{ "eLua - Embedded Lua", "eLua - Embedded Lua" },
{ "Search", "Pesquisar" },
{ "Language", "Idioma" }
@ -149,4 +250,3 @@ local fixed =
-- Return our whole data defined above
return menu, translations, fixed

7
doc/en/faq.html Normal file
View File

@ -0,0 +1,7 @@
$$HEADER$$
<h3>eLua Frequently Asked Questions</h3>
<br />
<b>eLua</b> has a list of frequently asked questions maintained by the
community in the <b>eLua Wiki</b> at <a href="http://wiki.eluaproject.net/FAQ">wiki.eluaproject.net/FAQ</a>
$$FOOTER$$

22
doc/en/installing.html Normal file
View File

@ -0,0 +1,22 @@
$$HEADER$$
<h3>Installing eLua</h3>
<p>To use <b>eLua</b> in one of the
<a href="status.html#platforms">supported
platforms</a>, you need to install
it in your target kit/device or, more precisely, to flash the <b>eLua</b>
image into the platform of your choice.<br />
This section shows specific installation instructions and tips, for all the
CPU/boards supported by <b>eLua</b>.<br />
<br />
First, you need to have a suitable <b>eLua</b> image for your target.<br />
You can either download one of our ready to use
<a href="downloads.html">binary images</a> or <a href="building.html">build
eLua</a> to have custom image for your needs.<br />
<br />
Please choose the platform of your interest from the "Platform Info" submenu
for more instructions.</p>
<br />
<br />
<br />
$$FOOTER$$

View File

@ -0,0 +1,47 @@
$$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$$

109
doc/en/installing_avr32.txt Normal file
View File

@ -0,0 +1,109 @@
// $$HEADER$$
Installing eLua on the AVR32 CPUs from Atmel
--------------------------------------------
http://www.atmel.com/products/AVR32/[AVR32] is a family of high performance 32-bit CPUs from http://www.atmel.com[Atmel].
They were built as direct competitors for the various ARM core implementation on the market, and offer very good
performance (91 MIPS @ 66MHz) and power efficiency (1.3mW/MHz). Atmel claims that their AVR32 core outperforms ARMv5
(in ARM and Thumb mode) in terms of both performance and code size. It's a proprietary architecture (so it's only implemented by Atmel),
yet it has a very good support package, and an open source toolchain based on GCC, which made it an ideal candidate for the first
non-ARM (and also the first big-endian) eLua target. Atmel also sells a number of development boards based on their AVR23 CPUs.
The one used for eLua is the _ATEVK1100 board built around the _AT32UC3A0512 AVR32 MCU (512k internal Flash/64k internal ARM).
It's a very powerful board, featuring (among other things) an external 32 MByte SDRAM memory, which is more than enough to run lots and
lots of eLua programs.
NOTE: eLua version 0.8 added support for the AVR32 based _ATEVK1101 and _Mizar32 boards. The instructions below apply for the _ATEVK1101
board too; for _Mizar32 read the note xref:buildnote[here].
Prerequisites
-------------
Before you'll be able to use eLua on the AT32UC3A0512 CPU, make sure that:
* you're using Linux or Windows. It's easier to install and use Atmel's programming software on Windows, so use the Windows version if you want to save
yourself from quite a bit of hassle.
* you've installed Atmel's http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886[FLIP programming software], which is what you will need
in order to burn your eLua image. Installation in easy under Windows (you just need to run a setup package), but it's quite tricky under Linux.
The next paragraph outlines the procedure for installing FLIP on Linux.
* you have your eLua image for the AT32UC3A0512 CPU (link:building.html[built] or link:downloads.html[downloaded]). Note that unlike other
platforms, the ATEVK1100 needs a .hex file for programming and not a .bin.
Installing FLIP in Ubuntu Linux
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[[buildnote]]
IMPORTANT: The instructions below are somewhat hard to put into practice and reports suggest that they don't work well on all Ubuntu versions.
For updated (and simpler) instructions on how to make FLIP work under Linux and for alternative Linux programming software check
http://code.google.com/p/mizar32/wiki/FlashingFirmware[the Mizar32 wiki page].
Follow the steps below to install FLIP under Linux:
1. download the Linux version of FLIP from http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886[the Atmel FLIP page]. Save it
(or move it later) to your _/usr/local/_ directory (you need to have superuser privileges to do that). At the moment of writing this tutorial,
the latest FLIP version is 3.2.1, so this is what we're going to use here.
2. untar the FLIP archive:
+
------------------------------------
$ cd /usr/local
$ sudo tar xvzf flip_linux_3-2-1.tgz
------------------------------------
+
This will create the _/usr/local/flip.3.2.1_ directory.
3. you need to install OpenJDK if it is not installed:
+
------------------------------------
$ sudo apt-get install openjdk-6-jre
------------------------------------
4. edit _/usr/local/flip.3.2.1/bin/batchisp3.sh_ and add the two bolded lines before at the beginning of the file:
+
[subs="quotes"]
-------------------------------------------------
#!/bin/bash -f
*export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/jre/*
*export FLIP_HOME=/usr/local/flip.3.2.1/bin/*
if [ "$FLIP_HOME" = "" ]; then
-------------------------------------------------
5. you need to edit a binary file this time (_/usr/local/flip.3.2.1/libatlibusbdfu.so_). This happens because FLIP comes compiled for RedHat
by default and Ubuntu has different system paths. See http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=viewtopic&amp;t=56562[this topic]
for full details. All you have to do is change all the */sys/bus/usb* strings inside _libatlibusbdfu.so_ to */dev/bus/usb*.
6. add the FLIP directory to your PATH:
+
---------------------------------------------
$ export PATH=/usr/local/flip.3.2.1/bin:$PATH
---------------------------------------------
7. FLIP interferes with a program that comes pre-installed on Ubuntu system, called *brltty*. It's meant to help the visually
impaired, so if you don't need it simply remove it (as it seems to interfere with a lot of other USB devices too):
+
----------------------------
$ sudo apt-get remove brltty
----------------------------
Burning eLua to the EVK1100 board
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After you installed FLIP and added it to your $PATH, burning the eLua image should be quite easy:
* connect your ATEVK1100 board with the PC using an USB cable.
* put your board in DFU mode (this is required for FLIP interaction). To do this:
+
1. press *on* the on-board joystick and keep it pressed
2. press the RESET button on the board briefly
3. release the RESET button
4. release the joystick
* if you're using Windows and it asks you for a driver, you should install it manually from __c:\Program Files\Atmel\Flip <version>\usb__
* execute this from the command line (the command is the same on Windows and Linux, with a single exception: the FLIP executable name is *batchisp3* in Linux
and *batchisp* (without a 3) in Windows):
+
--------------------------------------------------------------------------------------------------------------------------------------------------
$ batchisp3 -hardware usb -device at32uc3a0512 -operation erase f memory flash blankcheck loadbuffer <image name>.hex program verify start reset 0
--------------------------------------------------------------------------------------------------------------------------------------------------
That's all, your eLua image is (finally) installed on your ATEVK1100 board.
// $$FOOTER$$

View File

@ -0,0 +1,15 @@
$$HEADER$$
<h3>Using eLua with Intel i386 (or better) CPUs</h3>
<p>Since the i386 platform was implemented as a proof of concept only, the only things you can do with it are:</p>
<ul>
<li><a href="tut_bootpc.html">Boot your PC in eLua</a></li>
<li><a href="tut_bootstick.html">Boot eLua from a stick</a></li>
</ul>
<p>If you want to do this, <a href="building.html">build your eLua image</a> or download a precompiled image, as explained in the <a href="downloads.html">download page</a>.</p>
<p>However, most of the features that you'd find on an embedded platform won't work. You won't be able to upload programs to your i386 <b>eLua</b> box using the
XMODEM protocol (not because it's impossible, but simply because this doesn't make sense at all on a desktop PC). Also, you won't be able to control the peripherals that you'd normally find in an
embedded CPU (SPI, I2C, PIO and all the others), because they are not present on the i386 platform (they can be emulated via different means, but this is way beyond
the scope of <b>eLua</b>). So, until further notice, i386 will be nothing more than a spectacular demo platform for <b>eLua</b>. If you think that you can make something
more out of it, please feel free to <a href="overview.html#contacts">contact us</a>. I'm actually very interested in this, but I lack the necessary resources to continue it.</p>
$$FOOTER$$

View File

@ -0,0 +1,47 @@
$$HEADER$$
<h3>Using <b>eLua</b> with the LM3S (Cortex-M3) CPUs from Luminary Micro</h3>
<p><a href="http://www.luminarymicro.com">Luminary Micro</a> is the company that produced the world's first silicon implementation of the Cortex-M3 processor. Their
device portfolio is quite impressive, ranging from relatively simple devices to full-featured CPUs (with on-chip USB, EMAC, CAN, and many other peripherals). The support
package for these devices is also very good, with drivers for all the CPU peripherals and ports of 3rd party applications. And, on a personal note, I contacted Luminary Micro
some while ago with a request to support this project with one of their evaluation kits, and their response was excellent (thanks again, Luminary!). That's how a
<a href="http://www.luminarymicro.com/products/lm3s8962_can_ethernet_evaluation_kit.html">EKx-LM3S8962K</a> landed on my desk. This is the development board that I'm going
to use in this tutorial. <b>eLua</b> also supports the <a href="http://www.luminarymicro.com/products/ekk-lm3s6965_ethernet_evaluation_kit.html">EKx-LM3S6965</a> board from Luminary (which can be programmed exactly like the EKx-LM3S8962) and the <a href="http://www.micromint.com/index.php/SBC/eagle-100.html">Eagle 100</a> board from <a href="http://www.micromint.com">Micromint</a>, which uses a different installation procedure.
</p>
<h3>Pre-requisites</h3>
<p>Before you'll be able to use <b>eLua</b> on the LM3S CPU, make sure that:</p>
<ul>
<li>you're using Windows. Yes, I really said <b>Windows</b>. The reason is quite simple: we're going to use Luminary's tools to burn <b>eLua</b> to the board,
and they're Windows specific. This is the case with many CPUs and vendors out there. You can have Windows installed on your HDD, or under
an emulator in Linux, it doesn't matter, you can even try to run it from <a href="http://www.winehq.org/">Wine</a> if you're really, really brave. I'm using XP, Vista should work too.</li>
<li>you have installed the LM Flash Programmer tool from Luminary. Look for it on <a href="http://www.luminarymicro.com/products/ekk-lm3s8962_can_ethernet_evaluation_kit.html">this page</a>,
for example (the link is in the "Software updates" table).</li>
<li>you already have your <b>eLua</b> image for the LM3S8962 CPU (<a href="building.html">built</a> or <a href="downloads.html">downloaded</a>). </li>
</ul>
<h3>Installing <b>eLua</b> on EKx-LM3S8962EK and EKx-LM3S6965</h3>
<p>Fortunately, this is as easy and painless as possible. One of the nicest things about these two kits is they use the on-board USB port for both firmware downloading and for
emulating a serial port (via a hardware USB to UART converter, so you don't need any special software on the CPU to access this UART port). Moreover, it automagically
knows how (and when) to switch from the firmware download mode to the UART emulation mode, so you don't need to move jumpers around or anything like this. It's zero effort
firmware upgrading at its best. So, let's do it:</p>
<ul>
<li>connect your board to your PC using a suitable USB cable. If you didn't install the board drivers yet, you'll be asked to install them now.</li>
<li>if you're already using the USB connection on the board in the UART emulation mode, close your terminal program (or at least disconnect it from the USB COM port).</li>
<li>fire up the "Luminary Micro Flash Programmer" application.</li>
<li>in the "Configuration" tab, select "LM3S8962 Ethernet and CAN Evaluation board" or "LM3S6965 Ethernet Evaluation Board" (depending on your board).</li>
<li>in the "Program" tab, select the <b>eLua</b> .bin file that you got from the compilation step.</li>
<li>select the "Options" as you like (I generally choose "Erase entire flash" and "Reset MCU after program").</li>
<li>hit the "Program" button.</li>
<li>wait until programming is over, then exit the flash programmer application.</li>
</ul>
<p>It's worth to mention that since these boards come with an USB to JTAG converter it should be possible to use OpenOCD (or a similar package) instead of the Luminary tool to program the image. The Luminary Micro forums are a good place to look for information if you're exploring the OpenOCD option.
</p>
<h3>Installing eLua on Eagle 100</h3>
<p>The Eagle 100 board can also be programmed via JTAG, but it doesn't include an on-board USB to JTAG adapter, so you'd need an external adapter if you
want to use JTAG for programming. Fortunately, it also comes with an Ethernet bootloader, so you can upload your image via Ethernet. The only requirement
to use the bootloader is to start your image at address 0x2000 instead of the usual 0x0, since that's where the bootloader jumps. The
<a href="building.html">eLua build system</a> does this automatically if the "board=eagle-100" parameter is given at build time.<br>
For a full description of the Ethernet bootloader consult the <a href="http://www.micromint.com/index.php/Download-document/32-Eagle-100-User-s-Manual.html">Eagle 100 board manual</a>, (look for section 2.7, <b>Firmware Updates using the Ethernet Bootloader</b>).<br />
You still need the LM Flash Tool to use the Ethernet bootloader, but since the board can use JTAG for firmware uploading, it should be possible to use it
with OpenOCD (or a similar package) and an external USB to JTAG adapter. The Luminary Micro forums are a good place to look for information if you're exploring the OpenOCD option.
</p>
$$FOOTER$$

View File

@ -0,0 +1,55 @@
$$HEADER$$
<h3>Installing <b>eLua</b> on the LPC2468 CPU from NXP</h3>
<p>The <a href="http://ics.nxp.com/products/lpc2000/lpc24xx/">LPC2468 CPU</a> from <a href="http://www.nxp.com">NXP</a> is one of the CPUs on which <b>eLua</b> is very happy to run, because of its
very generous resources: 512k of Flash and 96k of SRAM on-chip memory, loads of peripherals, up to 72MHz operating frequency, external memory bus and other goodies. <b>eLua</b> is so happy with
this chip, in fact, that a board designed specifically for <b>eLua</b> was built around it. You can find the full specifications of the board
<a href="http://www.giga.puc-rio.br/site/embedded/eluademoboard">here</a>. This is the board that we're going to use in this tutorial.</p>
<h3>Prerequisites</h3>
<p>Before you'll be able to use <b>eLua</b> on the LPC2468 CPU, make sure that:</p>
<ul>
<li>you're using Windows. Using this board under Linux or other operating systems should be possible, but we're going to cover only Windows here.</li>
<li>you downloaded the latest FTDI VCP drivers from <a href="http://www.ftdichip.com/Drivers/VCP.htm">here</a>.</li>
<li>you downloaded and installed the FTDI FT_PROG tool from <a href="http://www.ftdichip.com/Resources/Utilities.htm">here</a>.</li>
<li>you downloaded and installed the Flash Magic programming software from <a href="http://www.flashmagictool.com/">here</a>.</li>
<li>you already have your <b>eLua</b> image for the LPC2468 CPU (<a href="building.html">built</a> or <a href="downloads.html">downloaded</a>).</li>
</ul>
<h3>Burning <b>eLua</b> to the LPC2468 using the Flash Magic software</h3>
<p>Before actually downloading the <b>eLua</b> image to the CPU, the board must be configured for proper USB operation (note that this should be done only once, not everytime you need to program
a new <b>eLua</b> image). The steps for this procedure are listed below:</p>
<ol>
<li>make sure that jumper JP1 on the board is set to position "USB" (2-3) if you want to power your board from the USB bus.</li>
<li>connect your board to the PC using an USB cable.</li>
<li>if needed, install the FTDI drivers you downloaded earlier.</li>
<li>once the drivers are properly installed, start the FTDI FT_PROG software downloaded earlier and choose "Devices", "Scan and Parse". If everything is OK, your device should show up in the
left part of the FT_PROG window, under "Device Tree".</li>
<li>in "Device Tree", select "USB_Config_Descriptor", then enter "500" in the "Max Bus Power" field in the upper right part of the FT_PROG window. It should look like below:
<img src="images/ft_prog_power.png" alt="FT_PROG power settings" style="margin-top: 10px;" />
</li>
<li><b>(optional)</b> now it's a good time to give your <b>eLua</b> board a good description :) In "Device Tree", select "USB_String_Descriptors", then enter "eluaproject.net" in the
"Manufacturer" field in the upper right part of the FT_PROG window, and "eLua demo board" in the "Product Description" field. It should look like below:
<img src="images/ft_prog_strings.png" alt="FT_PROG strings" style="margin-top: 10px;" />
</li>
<li>choose "Devices", "Program". The new settings will be written to the FTDI chip internal memory, and the board will automatically re-enumerate.</li>
</ol>
<p>Once your board is properly configured (remember, you only need to do this ONCE!), follow the next steps to program your <b>eLua</b> image to the board as many times as you need to:</p>
<ol>
<li>make sure that jumper JP1 on the board is set to position "USB" (2-3) if you want to power your board from the USB bus.</li>
<li>make sure that JP2 (ISP), JP3 (RST), JP6 (RDX0) and JP7 (TDX0) are connected on the board.</li>
<li>connect the board to the PC using an USB cable.</li>
<li>find the serial port used by the board. Open "Device Manager" in Windows, go to "Ports (COM &amp; LPT)" and look for a serial port named "USB serial port" or something similar. If unsure,
simply unplug the board. The serial port that disappears from the list after unplugging the board is your board's serial port.</li>
<li>start Flash Magic and click on "Select Device" under "Step 1 - Communications". In the "Device Database" window that appears, select "ARM7" and then double click on "LPC2468"
(<b>NOT</b> "LPC2468 Ethernet").</li>
<li>select the COM port from step 4 in "COM Port", set the baud rate to 230400, "Interface" to "None (ISP)", and "Oscillator (MHZ)" to 12.</li>
<li>under "Step 2 - Erase", select "Erase blocks used by Hex File".</li>
<li>under "Step 3 - Hex File", select your LPC2468 </b>eLua</b> hex file.</li>
<li><b>(optional)</b> under "Step 4 - Options", select "Verify after programming" if you want to verify your downloaded image.</li>
</ol>
<p>After all the steps above, the Flash Magic windows should look similar to the image below (my LPC2468 serial port is COM14):</p>
<img src="images/flashmagic.png" alt="Flash Magic Settings" style="margin-left: 10px;" />
<p>All that's left to do is hit the "Start" button, and wait (the whole process takes a while). When it's finished, close Flash Magic and remove the JP2 (ISP) and JP3 (RST) jumpers from the
board, then reset it.</p>
<p>That's it! You now have <b>eLua</b> programmed on your board, so you can start your terminal emulator and enjoy it, as described in <a href="using.html">using eLua</a>.</p>
$$FOOTER$$

View File

@ -0,0 +1,36 @@
$$HEADER$$
<h3>Installing <b>eLua</b> on the LPC2888 CPU from NXP</h3>
<p>The <a href="http://www.standardics.nxp.com/products/lpc2000/all/~LPC2888/">LPC2888 CPU</a> from <a href="http://www.nxp.com">NXP</a> packs some interesting features: huge internal 1Mbyte flash memory,
on-chip USB 2.0 high speed interface, and the most complex (by far) clocking network that I've ever seen on an ATM7TDMI chip. Also, it implements the USB DFU (Device Firmware Update) profile over
its USB interface, so it's quite easy to program it in-circuit. I'm using the <a href="http://www.olimex.com/dev/lpc-h2888.html">Olimex LPC-H2888</a> development board built around this chip, which packs
32MBytes of external SDRAM and also 2MBytes of external flash, which is more than enough for my needs. However, it does have its fair share of downsides. For starters, its support package (from NXP) is very poot when
compared to other targets on which <b>eLua</b> runs. You don't even get drivers for all your peripherals, just a a few (quite incomplete) examples. Its datasheet could be much more explit at times, especially when
referring to the clocking section (which is quite complicated). On my board, the DFU download mode (firmware upgrade via USB) stopped working out of the blue, without any apparent reasons, and I was unable to
use DFU on the chip since then, I had to resort to using OpenOCD (and come up with a configuration file, since it was impossible to find one for LPC2888). The CPU itself has a very interesting limitation: because of a silicon
error, it's impossible to run Thumb code from the on-chip flash, you can only run regular ARM code (?!). Also, the board that I got from Olimex completely ignores the fact that this chip can run in DFU mode (it doesn't include
any kind of jumper and/or switch to enable this mode), so I had to build a support board for it. Which is something I had to do also because the board doesn't export a RS232 interface, I had to build one around a MAX232 chip.
All in all, my experience with this chip (and with the Olimex board) wasn't that pleasant, but this doesn't change the fact that the LPC-H2888 is one of the most powerful (resource-wise) boards on which <b>eLua</b> runs.
</p>
<h3>Prerequisites</h3>
<p>Before you'll be able to use <b>eLua</b> on the LPC2888 CPU, make sure that:</p>
<ul>
<li>if you're going to use DFU for firmware programming, you'll need Windows (although I heard reports of Linux programs that can program this chip in DFU mode, but I won't cover them here). If you're going to use OpenOCD, Linux, Windows,
or any other OS that has support for <a href="http://openocd.berlios.de/web/">OpenOCD</a> will do. In this case, you might want to have a look at my <a href="tut_openocd.html">OpenOCD tutorial</a> before continuing.</li>
<li>also, if you're going to use DFU, you'll need a way to boot the chip in DFU firmware upgrade mode. This is done by pulling up (tie to VCC) the P2.3 pin at startup. On my board I included a switch for this. Press the switch, press RESET
while holding the switch pressed, then release the switch. You chip is now in DFU mode.</li>
<li>if you're using DFU, you have installed the LPC2888 flash programming utility from <a href="http://www.standardics.nxp.com/support/documents/microcontrollers/zip/flash.utility.mass.dfu.lpc2888.zip">here</a> (the package also
contains the Windows DFU drivers).</li>
<li>if you're using OpenOCD, you have followed the instructions from my <a href="tut_openocd.html">OpenOCD</a> tutorial.</li>
<li>you already have your <b>eLua</b> image for the LPC2888 CPU (<a href="building.html">built</a> or <a href="downloads.html">downloaded</a>).</li>
</ul>
<h3>Burning <b>eLua</b> to the LPC2888 using the DFU tool from NXP</h3>
<p>The DFU flashing application doesn't work directly on the .bin files you get after building <b>eLua</b>, you need to run them though NXP's "hostcrypt" program (which is part of the LPC2888 DFU package). After you have your <b>eLua</b> .bin file,
do this from a Windows command prompt (make sure that hostcryptv2.exe is in the path):</p>
<pre>C:&gt; hostcryptv2 elua_lua_lpc2888.bin elua.ebn -K0 -F0</pre>
<p>As a result, you'll have a new file (<i>elua.ebn</i>). Now boot your chip in DFU firmware upgrade mode (see above) and use the DFU utility (<i>MassDFUApplication.exe</i>) to load <i>elua.ebn</i> into your chip (the instructions on
using MassDFUApplication are in a PDF file that's included in the LPC2888 DFU package). Reset the board and enjoy.
</p>
<h3>Burning <b>eLua</b> to the LPC2888 using OpenOCD</h3>
<p>If you're as lucky as me and your board refuses to use DFU anymore, follow my <a href="tut_openocd.html">OpenOCD tutorial</a> to burn your image using OpenOCD.</p>
$$FOOTER$$

View File

@ -0,0 +1,53 @@
$$HEADER$$
<h3>Using <b>eLua</b> with the STM32 CPUs from ST</h3>
<p>The <a href="http://www.st.com/mcu/inchtml-pages-stm32.html">STM32 family</a> of MCUs from
<a href="http://www.st.com">ST</a> is a line of Cortex-M3 based chips with a lot of neat features, including (but not limited to) high
amounts of on-chip Flash/RAM (up to 512k Flash and 64k RAM), external memory controller that covers (P)SRAM, NAND Flash and NOR flash, integrated ADC and
DACs, advanced timers and many others. They also feature an integrated serial boot loader, so it's extremely easy to program them from anything that has
a serial port. ST provides a tool that can be used to download a program to the STM32 using this serial bootloader, but it only works in Windows. Their
bootloader protocol is documented in a separate application note though, so one can easily write a programming application for any other OS.</p>
<p><b>eLua</b> currently works on two STM32F103 variants of the STM32 family, specifically on these boards:
<a href="http://www.st.com/mcu/contentid-100-110-STM3210E_EVAL.html">the STM3210E-EVAL</a> from
<a href="http://www.st.com">ST</a> and the
<a href="http://www.futurlec.com/ET-STM32_Stamp.shtml">ETM-STM32 stamp</a>
from <a href="http://www.futurlec.com">Futurlec</a>. Instruction for installing <b>eLua</b> on each of them are provided below.
</p>
<h3> Prerequisites</h3>
<p>Before you'll be able to use <b>eLua</b> on the STM32F103 CPU, make sure that:</p>
<ul>
<li>you're using Windows. As already explained, the software provided by ST for serial firmware downloading works only under Windows. It's quite likely
that similar tools for Linux and other operating systems already exist or will be available shortly.</li>
<li>you have installed the "Flash loader demonstrator" from <a href="http://www.st.com/mcu/modules.php?name=mcu&amp;file=familiesdocs&amp;FAM=110">
this page</a> (look for it in the "Software - PC" section).</li>
<li>you already have your <b>eLua</b> image for the STM32F103 CPU (<a href="building.html">built</a> or <a href="downloads.html">downloaded</a>).</li>
</ul>
<h3>Programming eLUa on the STM3210E-EVAL board</h3>
<p>Follow the steps below to install <b>eLua</b> on your STM3210-EVAL board:</p>
<ul>
<li>make sure you have a proper cable. You need a null modem cable for this board (a cable with two DB-9 female connectors, that connects RX to TX and TX to RX).
<li>connect the board to one of your PC serial ports using the null modem cable.</li>
<li>locate the two adjacent BOOT0 and BOOT1 switches, make sure that BOOT0 is set to 1 and BOOT1 to 0.</li>
<li>reset the board by pressing on the RESET button.</li>
<li>start the ST Flash loader demonstrator. Choose your serial port in the first screen, make sure that the communication parameters are 57600 8E1 and press "Next" 3 times.</li>
<li>select the "Download to device" radio button, then choose your <b>eLua</b> image file and hit "Next".</li>
<li>wait until programming is over and press "Finish".</li>
<li>move the BOOT0 switch to position 0.</li>
<li>reset the board by pressing the RESET button again.</li>
</ul>
<h3>Programming eLua on the ET-STM32 stamp</h3>
<p>Follow the steps below to install <b>eLua</b> on your ET-STM32 stamp:</p>
<ul>
<li>connect the board to one of your PC serial ports using the provided serial cable.</li>
<li>put the BOOT1 jumper on your board in the ISP position (it should come like that from the factory, and must likely you won't need to change this).</li>
<li>press on the BOOT0 switch. The green "BOOT0=1" LED should light up.</li>
<li>reset the board by pressing on the RESET button.</li>
<li>start the ST Flash loader demonstrator. Choose your serial port in the first screen, make sure that the communication parameters are 57600 8E1 and press "Next" 3 times.</li>
<li>select the "Download to device" radio button, then choose your <b>eLua</b> image file and hit "Next".</li>
<li>wait until programming is over and press "Finish".</li>
<li>press on the BOOT0 switch again.</li>
<li>reset the board by pressing the RESET button again.</li>
</ul>
<p>Now you have <b>eLua</b> installed on your board, and you can choose the same port you used for programming as a general purpose serial port for <b>eLua</b> (but remember to use 115200
8N1 as the communication parameters this time).</p>
$$FOOTER$$

View File

@ -0,0 +1,17 @@
$$HEADER$$
<h3>Installing <b>eLua</b> on the STR7 CPU family from ST</h3>
<p><a href="http://www.st.com/mcu/inchtml-pages-str7.html">STR7</a> is a family of ATM7TDMI based CPUs from <a href="http://www.st.com">ST</a>. They are small, low power MCUs, with a well balanced set of on-chip peripherals. I'm using the <a href="http://www.sctec.com.br/content/view/101/30/">MOD711</a> header board from <a href="http://www.sctec.com.br">ScTec</a>. The board is
based on this STR711FR2 variant of the STR7 family. Since this is not a full-fledged development board, I had to add a few things around it: a MAX3232 RS232 to TTL converter for the serial interface, a couple of LEDs and a reset button. After that, the board was ready for some <b>eLua</b> :) </p>
<h3>Prerequisites</h3>
<p>Before you'll be able to use <b>eLua</b> on the STR711FR2 CPU, make sure that:</p>
<ul>
<li>you're using Linux, Windows, or any other OS that has support for <a href="http://openocd.berlios.de/web/">OpenOCD</a>. You might have a look at my <a href="tut_openocd.html">OpenOCD tutorial</a> before continuing.</li>
<li>you already have your <b>eLua</b> image for the STR711FR2 CPU (<a href="building.html">built</a> or <a href="downloads.html">downloaded</a>).</li>
</ul>
<h3>Burning <b>eLua</b> to the MOD711 board</h3>
<p>You need OpenOCD to do this. Just follow the instructions from my <a href="tut_openocd.html">OpenOCD tutorial </a>. On the tutorial page you'll also find links to the OpenOCD
configuration files that I'm using for burning <b>eLua</b> to the MOD711 board. And that's it! <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>
<p><b>IMPORTANT NOTE</b>: for this board you need to set your COM port speed to 38400 baud (as opposed to 115200 baud for the other boards). All the other parameters are the same (8 data bits,
no parity, one stop bit).</p>
$$FOOTER$$

View File

@ -0,0 +1,59 @@
$$HEADER$$
<h3>Installing <b>eLua</b> on the STR9 CPU family from ST</h3>
<p>Among the ARM based MCUs available today, the <a href="http://www.st.com/mcu/inchtml-pages-str9.html">STR9</a> CPUs from <a href="http://www.st.com">ST</a> stand up because of a few unique features.
First, their core is an ARM966-E, as opposed to the very popular ARM7TDMI core. This, together with some cleverly chosen on-chip hardware blocks, allows the CPU to run at 96MHz, which is very fast for a
general purpose MCU. The particular CPU I'm using (STR912FAW44) also has 512k of flash (and another bank of 32k flash) and 96k of internal RAM, so you won't be running out of memory anytime soon. It is accompanied by a very good support library,
and ST provides a lot of nice tools for STR9, including a graphical tool that you can use to configure the chip exactly how you want.
</p>
<h3>Prerequisites</h3>
<p>Before you'll be able to use <b>eLua</b> on the STR912FAW44 CPU, make sure that:</p>
<ul>
<li>you're using Linux, Windows, or any other OS that has support for <a href="http://openocd.berlios.de/web/">OpenOCD</a>.
You might have a look at our <a href="tut_openocd.html">OpenOCD tutorial</a> before continuing.</li>
<li>if you're on Windows, you have installed the STR9-comStick support package from the accompanying CD.</li>
<li>you already have your <b>eLua</b> image for the STR912FAW44 CPU (<a href="building.html">built</a> or <a href="downloads.html">downloaded</a>).</li>
<li>if you're on Linux, you have super-user (sudoer) access to the system</li>
</ul>
<p> The following sections show how to burn <b>eLua</b> on kits based on the STR9 MCU.</p>
<h3>Using <b>eLua</b> on the STR9-comStick</h3>
<p>When we wrote to ST about <b>eLua</b>, they agreed to send us a <a href="http://www.hitex.com/str9-comstick/">STR9-comStick</a> board to run <b>eLua</b> on it. Thank you very much for your help, once again. This is the board that
we're going to use through this tutorial.You need OpenOCD to do this. Just follow the instructions from our <a href="tut_openocd.html">OpenOCD tutorial </a>. On the tutorial page you'll also find links to the OpenOCD
configuration files that I'm using for burning <b>eLua</b> to the comstick.</p>
<p><b>IMPORTANT NOTE</b>: for some very strange reasons (probably related to the on-board USB to JTAG converter) my comstick does NOT start to execute the code from its internal flash after being
powered up via the USB cable (faulty reset sequence?). To overcome this, you'll find a special OpenOCD configuration file on my <a href="tut_openocd.html">OpenOCD tutorial</a> page. It is called <i>comrst.cfg</i>,
and you can use it to reset your comstick after it is powered up.</p>
<h3>Burning <b>eLua</b> to the STR-E912 Olimex boardboard</h3>
<p>To use eLua on the <a href="http://www.olimex.com/dev/str-e912.html">Olimex STR-E912 development
board</a> we are using an <a href="http://www.olimex.com/dev/arm-usb-ocd.html">Olimex programmer</a> to flash the image under
Linux, using OpenOCD.
<ul>
<li>
Copy the binary image file to the scripts' dir of OpenOCD, renaming it to main.bin:
(you can also have a simbolic link on your OpenOCD script's folder, linked
to the binary image on your build dir but it must be named "main.bin")
</li>
<h2>$ cp elua_lua_str912faw44.bin /..yourpath../openocd/scripts/main.bin</h2>
<li>
Connect the Olimex programmer cable on the JTAG connector on the STR-E912
</li>
Run the OpenOCD script as a superuser, from the OpenOCD scripts directory:
</li>
<h2>$ sudo ./openocd -f comstick.cfg</h2>
<li>
Carefully disconnect the Olimex programmer cable on the JTAG connector on the
STR-E912, as unfortunately you will have to do this many times while using
this combination. The terminal will NOT run if the programmer is connected
to the board.
</li>
</ul>
</p>
<p>That's it! <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$$

96
doc/en/tut_bootpc.html Normal file
View File

@ -0,0 +1,96 @@
$$HEADER$$
<h3>Booting your PC in eLua</h3>
<p>That's right: after following this tutorial, your PC will boot
directly into Lua! No OS there (this explains why the boot process is
so fast), just you and Lua. You'll be able to use the regular Lua
interpreter to write your programs and even use "dofile" to execute Lua
code.</p>
<h2>Details</h2>
<p>Booting <b>eLua</b> involves using the well known <a href="http://www.gnu.org/software/grub/">GRUB</a> that will be used to load
a <a href="http://www.gnu.org/software/grub/manual/multiboot/">multiboot</a>
compliant ELF file that contains our <b>eLua</b> code. The code runs in protected mode, so you
have access to your whole memory. The code does not access any kind of
storage device (HDD, CDROM, floppy), so if you're worried that it might
brick your system, you can relax now :) I'm only using some very basic
keyboard and VGA textmode "drivers", so all you're risking is a system freeze
(even this is highly unlikely), nothing a good old RESET can't handle
(be sure to use the hardware reset though, CTRL+ALT+DEL is not handled
by the code). But just in case, see also the next section.</p>
<h2 style="background-color: orangered;">Disclaimer</h2>
<p>As already mentioned, the code won't try to access any kind
of storage (HDD, CDROM, floppy), not even for reading, so you don't
need to worry about that. Also it doesn't try to reprogram your video
card registers, so it can't harm it or your monitor. It only implements
a "protected mode keyboard driver" that can't physically damage
anything in your system. In short, I made every effort to make the code
as harmless as possible. I tested it on 5 different computers and in 2 <a href="http://www.virtualbox.org/">VirtualBox</a>
emulators, and nothing bad happened. That said, there are no warranties
of any kind. In the very unlikely event that something bad does happen
to your system, you have my sincere sympathy, but I can't be held
responsible for that.</p>
<h2>Prerequisites</h2>
<p>To boot your computer in Lua you'll need:</p>
<ul>
<li>a 386 or better computer running Linux. I actually tested
this only on Pentium class computers, but it should run on a 386
without problems.</li>
<li><a href="http://www.gnu.org/software/grub/">GRUB</a>.
Since you're running Linux, chances are you're already using GRUB as
your bootloader. If not, you must install it. You don't need to install
it on your HDD; a floppy, an USB stick or even a CDROM will work as
well. I won't cover the GRUB installation procedure here, just google
for "install grub on floppy/usb/cdrom" and you'll sure find what you're
looking for. You can try for example <a href="http://orgs.man.ac.uk/documentation/grub/grub_3.html">here</a>,
<a href="http://www.freesoftwaremagazine.com/articles/grub_intro/">here</a> or
<a href="http://www.mayrhofer.eu.org/Default.aspx?pageindex=6&amp;pageid=45">here</a>.</li>
<li>The <b>eLua</b> i386 ELF file, see <a href="downloads.html">here</a> for instructions on how to obtain it. OR <a href="downloads.html">download the eLua source distribution</a> and compile it
for the i386 architecture using a toolchain that you can build by following <a href="tc_386.html">this tutorial</a>.</li>
<li>a text editor to edit your GRUB configuration file.</li>
</ul>
<p>The rest of this tutorial assumes that you're using Linux with GRUB,
and that GRUB is located in <i>/boot/grub</i>, which is true for many Linux
distributions.</p>
<h2>Let's do this</h2>
<p>First, copy the eLua ELF file to your "/boot" directory:</p>
<pre><code>$ sudo cp surprise /boot<br></code></pre>
<p>Next you need to add another entry to your GRUB menu file (<i>/boot/grub/menu.lst</i>). Edit it and add this entry:</p>
<pre><code> title eLua
root (hd0,0)
kernel /boot/elua_lua_i386.elf <b>(change this if the eLua file name is different)</b>
boot</code></pre>
<p>You may need to modify the <i>root (hd0,0)</i> line above to match your
boot device. The best way to do this is to look in the <i>menu.lst</i> file
for the entry that boots your Linux kernel. It should look similar to
this:</p>
<pre><code> title Ubuntu, kernel 2.6.20-16-generic
<b>root (hd0,2)</b>
kernel /boot/vmlinuz-2.6.20-16-generic
initrd /boot/initrd.img-2.6.20-16-generic
savedefault</code></pre>
<p>After you find it, simply use the <i>root (hdx,y)</i> line from that entry
(<i>root (hd0,2)</i> in the example above) in your newly created entry instead
of root (hd0,0).<br>
That's it! Now reboot your computer, and when the GRUB boot menu
appears, choose "eLua" from it. See <a href="using.html">using eLua</a> for
instructions on how to use your newly installed self-booting programming language :)</p>
<p>As usual, if you need more details, you can <a href="overview.html#contacts">contact us</a>.
Also, if you want to go one step ahead and have you own USB stick that boots <b>eLua</b>, check <a href="tut_bootstick.html">this tutorial</a>.</p>
$$FOOTER$$

131
doc/en/tut_bootstick.html Normal file
View File

@ -0,0 +1,131 @@
$$HEADER$$
<h3>Booting eLua from an USB stick</h3>
<p>This is follow up of <a href="tut_bootpc.html">this tutorial</a>.
After completing it you'll be able to boot <b>eLua</b> directly from your USB
stick (provided, of course, that your computer can boot from an USB
stick, which is true for most computers nowadays). You might want to
check the <a href="tut_bootpc.html">boot your PC in eLua</a>
tutorial first for more details. If you have an old USB stick that you
don't use anymore, and/or the shear geekness of this idea makes you
feel curious, this tutorial is definitely for you :)</p>
<h2 style="background-color: orangered;">Disclaimer</h2>
<p>As mentioned <a href="tut_bootpc.html">here</a>,
the code won't try to access any kind of storage (HDD, CDROM, floppy),
not even for reading, so you don't need to worry about that. Also it
doesn't try to reprogram your video card registers, so it can't harm it
or your monitor. It only implements a "protected mode keyboard driver"
that can't physically damage anything in your system. In short, I made
every effort to make the code as harmless as possible. I tested it on 5
different computers and in 2 <a href="http://www.virtualbox.org/">VirtualBox</a>
emulators, and nothing bad happened. That said, there are no warranties
of any kind. In the very unlikely event that something bad does happen
to your system, you have my sincere sympathy, but I can't be held
responsible for that. Also, I can't be held responsible if you mess up
your HDD by failing the GRUB installation procedure (even though, once
again, this shouldn't be possible unless you really insist on messing
it up). If you're new to computers or Linux, this tutorial might not be for you.
Your call.</p>
<h2>Prerequisites</h2>
<p>To have your own bootable <b>eLua</b> USB stick you'll need:</p>
<ul><li>an USB stick. I tested this on an 128M USB stick, because
it's the smallest I could find. You should be OK with a 4M stick or
even a 2M stick</li>
<li>a computer running Linux. I use Ubuntu, but any other distribution is fine.</li>
<li><a href="http://www.gnu.org/software/grub/">GRUB</a>.
Since you're running Linux, chances are you're already using GRUB as
your bootloader. If not, you must install it on your HDD, or at least
know how to install it directly on the USB stick. I won't go into
details here, google it and you'll find lots of good articles about
GRUB. This tutorial assumes that you're using GRUB as your bootloader.</li>
<li>The <b>eLua</b> i386 ELF file, see <a href="downloads.html">here</a> for instructions on how to obtain it. OR <a href="downloads.html">download the eLua source distribution</a> and compile it
for the i386 architecture using a toolchain that you can build by following <a href="tc_386.html">this tutorial</a>.</li>
<li>a text editor to edit your GRUB configuration file.</li></ul>
<p>The rest of this tutorial assumes that you're using Linux with GRUB,
and that GRUB is located in <i>/boot/grub</i>, which is true for many Linux
distributions.</p>
<h2>Backup your stick</h2>
<p>Since the stick is going to be formatted, make sure to backup the
data from your stick first (you can copy it back after finishing the
tutorial).</p>
<h2>Partition and format your stick</h2>
<p>Depending on your stick, this step might not be required, but
chances are you'll need to re-partition and re-format your stick before
installing GRUB on it. The problem is that many sticks have a very
creative, non-standard partition table, and GRUB doesn't like that. I
looked at the original partition table of my <b>eLua</b> USB stick and it scared me to
death, so I had to follow this procedure. In short, you'll need to
delete all the partitions from your stick, create a new partition, and
then format it. For a step by step tutorial check <a href="http://www.4p8.com/eric.brasseur/suse9.1_usb_stick.html">here</a>.</p>
<h2>Install GRUB on your stick</h2>
<p>First, mount your freshly formatted stick (I'm going to assume that the mount directory is <i>/mnt</i>):</p>
<pre><code>$ sudo mount /dev/sda1 /mnt<br></code></pre>
<p>(of course, you'll need to change <i>/dev/sda1</i> to reflect the physical location of your USB stick. You should know the physical location from the previous step).
Then copy the required GRUB files to your stick:</p>
<pre><code>$ cd /mnt
$ mkdir boot
$ mkdir boot/grub
$ cd /boot/grub
$ cp stage1 fat_stage1_5 stage2 /mnt/boot/grub</code></pre>
<p>Copy the <b>eLua</b> ELF file (<i>elua_lua_i386.elf</i> in this example, change the name if needed) to the GRUB directory as well:</p>
<pre><code>$ cp elua_lua_i386.elf /mnt/boot/grub</code></pre>
<p>Create a <i>menu.lst</i> file for GRUB with you favorite text editori (I'm using vim):</p>
<pre><code>$ cd /mnt/boot/grub
$ vim menu.lst
title eLua
root (hd0,0)
kernel /boot/grub/elua_lua_i386.elf
boot</code></pre>
<p>Now it's time to actually install GRUB on the stick.</p>
<pre><code>$ sudo -s -H
# grub
<b>Now we need to find the GRUB name of our USB stick. We'll use the "find" command from
GRUB and our eLua ELF file to accomplish this:</b>
grub&gt; find /boot/grub/elua_lua_i386.elf
(hd2,0)
<b>GRUB should respond with a single line (like (hd2,0) above). If it gives you more
than one line, something is wrong. Maybe you also installed eLua on your HDD? If so,
delete the /boot/grub/elua_lua_i386.elf file from your HDD and try again.
You might get a different (hdx,y) line. If so, just use it instead of (hd2,0) in the
rest of this tutorial</b>.
grub&gt; root (hd2,0)
grub&gt; setup (hd2)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/fat_stage1_5" exists... yes
Running "embed /boot/grub/fat_stage1_5 (hd2)"... 15 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd2) (hd2)1+15 p (hd2,0)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.
grub&gt; quit</code></pre>
<p>That's it! Now reboot your computer, make sure that your BIOS is set
to boot from USB, and enjoy! See <a href="using.html">using eLua</a> for
instructions on how to use your new toy :).</p>
<p>As usual, if you need more details, you can <a href="overview.html#contacts">contact us</a>.</p>
$$FOOTER$$

366
doc/en/tut_openocd.html Normal file
View File

@ -0,0 +1,366 @@
$$HEADER$$
<h3>Using OpenOCD</h3>
<p>This section presents <a href="http://openocd.berlios.de">OpenOCD</a>, a tool used to program <b>eLua</b> on some of its targets.
If you'd rather skip the long and boring OpenOCD introduction and
skip directly to the OpenOCD script downloads, use the links below.</p>
<ul>
<li><a href="#str9files">Configuration files for STR9-comStick</a></li>
<li><a href="#stre912files">Configuration files for STR-E912</a></li>
<li><a href="#lpc2888files">Configuration files for LPC2888</a></li>
<li><a href="#str7files">Configuration files for STR7</a></li>
</ul>
<h2>About OpenOCD</h2>
<p><a href="http://openocd.berlios.de">OpenOCD</a> is an open source tool that can be used to connect to a CPU's
<a href="http://en.wikipedia.org/wiki/JTAG">JTAG</a>
interface. Using OpenOCD and a physical JTAG connection allows you to
burn the on-chip flash memory of your CPU (or to load your code
directly to RAM), to read the internal CPU memory (Flash/RAM) and to
use <a href="http://sourceware.org/gdb/">gdb</a> or other debuggers to debug your code.
Needless to say, this is a very handy tool (and especially handy if
your CPU happens to be built around an ARM core, since in this case you
can be almost certain that it has a JTAG interface that you can use).
That said, if your only goal is to burn your firmware, my personal
suggestion is to avoid using OpenOCD if possible. It has quite a steep
learning curve, because it is a command line tool that uses
configuration files with lots of different parameters, and this takes a
while to get used to. Worse, I feel that it is not very well
docummented. The project's wiki does give a few good pointers about all
the configuration parameters, and there are some good OpenOCD tutorials
out there, but none of them tells the whole story. And the syntax (and
even some commands) seems to change between releases, which
makes things even more confusing. This is why I generally choose to use
a different firmware burning tool when available, and resort to OpenOCD
only for targets that lack a proper firmware burning tool. If you need
to debug your code, however, you probably want to use OpenOCD, since
the alternatives aren't cheap.
To summarize, you can forget about OpenOCD when:</p>
<ul>
<li>your CPU manufacturer provides a special tool for
firmware burning. This is quite often the case, but more often that not
the aforementioned tools work only in Windows.</li>
<li>you must debug your code, but you have a good intuition about where the
problem is located. In this case, simply connecting a LED to a PIO port
and turning it on and off from different parts of your code until you
figure out exactly what's the problem can work wonders. I can't
remember when was the last time I used gdb for debugging, since "LED
debugging" was all I needed. </li>
</ul>
<p>On the other hand, you should probably use OpenOCD when:</p>
<ul>
<li>your CPU manufacturer doesn't provide a special tool for firmware burning (or it does, but it's not what you need).</li>
<li>you're using Linux, MacOS or another OS that is not supported by the firmware burning tool.</li>
<li>you need to do some serious debugging in order to understand what's wrong with your application.</li>
</ul>
<p>If you decided that you don't need OpenOCD after all, now it's a
good time to navigate away from this page and save yourself from some
possible symptoms of headache. If you need OpenOCD, read on, I'll try
to make this as painless as possible. However, don't expect this to be
a full tutorial on OpenOCD, because it's not; my intention is to give
you just enough data to use OpenOCD for burning <b>eLua</b> on your board.
Because of this, I won't be covering debugging with OpenOCD here, just
firmware burning. And, before we begin, please read and understand the
next paragraph.</p>
<h2 style="background-color: orangered;">Disclaimer</h2>
<p>Using OpenOCD improperly may force your CPU to behave
unexpectedly. While physically damaging your CPU as a result of using
OpenOCD is very hard to accomplish, you might end up with a locked
chip, or you might erase a memory area that was not supposed to be
erased, you might even disable the JTAG interface on your chip (thus
rendering it unusable). If you modify the configuration scripts that
I'm going to provide, make sure that you know what you're doing. Also,
I'm not at all an OpenOCD expert, so my configuration scripts might
have errors, even though I tested them. In short, this tutorial comes
without any guarantees whatsoever.</p>
<h2>Getting OpenOCD</h2>
<p>If you're on Windows, the best way to get OpenOCD already compiled and ready to run is to
visit the <a href="http://www.yagarto.de/">Yagarto home page</a>.
They provide a very nice OpenOCD installer, and they seem to keep up
with OpenOCD progress (the versions on the Yagarto site are not
"bleeding edge", but there are quite fresh nevertheless). If you're on
Linux, you can always use apt-get or your distribution-specific package
manager:</p>
<pre><code>$ sudo apt-get install openocd</code></pre>
<p>There is a catch here though: the OpenOCD version that I get from
apt-get is dated 2007-09-05, while the Yagarto OpenOCD version is from
2008-06-19. Since I'm using OpenOCD from Windows (because Ubuntu 8.04
doesn't seem to handle my USB-to-JTAG adapters very well), my
instructions are relevant to the Yagarto version. As mentioned in the
introduction, the meaning and parameters of different commands might
change between OpenOCD version, so if you want to use the Yagarto
version on your non Windows system, you'll have to build it from source
(see below).</p>
<p>The main resource on how to build OpenOCD from source is the <a href="http://openfacts.berlios.de/index-en.phtml?title=Building_OpenOCD">OpenOCD build page</a>
from the OpenOCD wiki. Also, a very good tutorial can be found <a href="http://forum.sparkfun.com/viewtopic.php?t=11221">here</a>.
I'm not going to provide step by step build instructions, since the two
links that I mentioned cover this very well, and the build process is
relatively straightforward. However, since both tutorials describe how
to build the bleeding edge version of OpenOCD, you'll need a slight
modification do build the Yagarto version instead. The modification is
in the SVN checkout step. Replace this step:</p>
<pre><code>$ svn checkout svn://svn.berlios.de/openocd/trunk</code></pre>
<p>with this step ('717' is the SVN revision of the Yagarto OpenOCD build):</p>
<pre><code>$ svn checkout <b>-r 717</b> svn://svn.berlios.de/openocd/trunk</code></pre>
<p>Follow the rest of the build instructions, and in the end you should have a working OpenOCD.</p>
<h2>Supported targets</h2>
<p>I couldn't find a good list of the targets that are
supported by OpenOCD. So, if you want to check if your particular CPU
is supported by OpenOCD, I recommend getting the latest sources (as
described in the previous section) and listing the
trunk/src/target/target directory:</p>
<pre><code>$ ls trunk/src/target/target
at91eb40a.cfg
at91r40008.cfg
....
str9comstick.cfg
....
</code></pre>
<p>If this listing has something that looks like your CPU name, you're lucky. OpenOCD has support for LPC from NXP, AT91SAM cfrom Atmel, STR7/STR9 from ST, and many others.</p>
<h2>Using OpenOCD</h2>
<p>To use OpenOCD, you'll need:</p>
<ul>
<li>the OpenOCD executable, as described above</li>
<li>a board with a JTAG interface</li>
<li>a JTAG adapter</li>
</ul>
<p>In some cases, your CPU board might provide a built in JTAG adapter. For example,
my <a href="http://www.luminarymicro.com/products/lm3s8962_can_ethernet_evaluation_kit.html">LM3S8962</a>
board provides both an USB-to-JTAG and an USB-to-serial converter built
on board, switching between them automagically. The same is true for my
<a href="http://www.hitex.com/index.php?id=383">STR9-comStick</a>.
On the other hand, my <a href="http://www.olimex.com/dev/sam7-ex256.html">SAM7-EX256</a> board has only a JTAG connector, I need a separate JTAG adapter to connect to it.
I'm using <a href="http://www.olimex.com/dev/arm-usb-tiny.html">ARM-USB-TINY</a> from Olimex, but there are other affordable USB-to-JTAG adapters out there,
like the <a href="http://www.amontec.com/jtagkey-tiny.shtml">Amontec JTAGKey-Tiny</a>. Not to mention that you can
<a href="http://www.hs-augsburg.de/%7Ehhoegl/proj/usbjtag/usbjtag.html">build your own</a>. Although USB is my interface of choice, you'll find JTAG adapters for
PC LPT ports too. The good news is that once you buy a JTAG adapter,
chances are that it will work with many boards with different CPUs,
since the JTAG connector layout is standardized and the JTAG adapters
are generally able to work with different voltages.</p>
<p>To actually use OpenOCD, the next thing you'll need is a configuration file. The
configuration file is the one that lets OpenOCD know about your setup,
such as:</p>
<ul>
<li>the kind of JTAG interface that you're using.</li>
<li>the actual hardware platform you're using (ATM7TDMI, ARM966 and so on).</li>
<li>the memory configuration of your CPU (flash banks).</li>
<li>the script used to program the flash memory.</li>
</ul>
<p>Presenting a list of all the possible configuration options and
their meaning is way beside the scope of this document, so I'm not
going to do it, I'll give an example instead. I'm going
to use parts of my STR9-comStick configuration file (comstick.cfg)
adapted from the OpenOCD distribution and from other examples (don't
worry, I'll provide full download links for this file later on). First
we need to tell OpenOCD that we're using a the STR9-comStick
USB-to-JTAG adapter:</p>
<pre><code>interface ft2232
ft2232_device_desc "STR9-comStick A"
ft2232_layout comstick
ft2232_vid_pid 0x0640 0x002C
jtag_speed 4
jtag_nsrst_delay 100
jtag_ntrst_delay 100
</code></pre>
<p>Also, OpenOCD needs to know what's our target and its memory layout:</p>
<pre><code>target arm966e little run_and_init 1 arm966e
run_and_halt_time 0 50
working_area 0 0x50000000 32768 nobackup
flash bank str9x 0x00000000 0x00080000 0 0 0
flash bank str9x 0x00080000 0x00008000 0 0 0</code></pre>
<p>This tells OpenOCD that our target is an ARM966-E running in little
endian mode, with two flash memory banks, one that starts at 0x0 and
it's 0x80000 bytes in size, and another one that starts at 0x80000 and
it's 0x8000 bytes in size. Finally, OpenOCD must know what's the name
of our script file (this is the file that is used to physically program
the CPU memory):</p>
<pre><code>#Script used for FLASH programming
target_script 0 reset str91x_flashprogram.script</code></pre>
<p>The contents of the str91x_flashprogram.script is very target-dependent:</p>
<pre><code>wait_halt
str9x flash_config 0 4 2 0 0x80000
flash protect 0 0 7 off
flash erase_sector 0 0 7
flash write_bank 0 main.bin 0
reset run
sleep 10
shutdown</code></pre>
<p>I'm not even going to attempt to explain this one :) Basically it
unprotects the flash, erases it, writes the contents of "main.bin" to
flash, and then resets the CPU. If you need to flash a file with a
different name, the only thing you need to modify is the "main.bin" in
the "flash write_bank" line.</p>
<p>To use all this, you need to tell OpenOCD to use our configuration file:</p>
<pre><code>openocd-ftd2xx -f comstick.cfg</code></pre>
<p>(<b>note</b>: under Windows, the OpenOCD executable name is often
"openocd-ftd2xx". Under Linux it's simply "openocd". Replace it with
the actualy name with your executable).</p>
<p>That's it for your OpenOCD crash course. I realise that there's much
more to learn, so here's a list of links with much better information
on the subject:</p>
<ul>
<li><a href="http://www.hs-augsburg.de/%7Ehhoegl/proj/openocd/oocd-quickref.pdf">OpenOCD quick reference</a> card. (slightly outdated)</li>
<li><a href="http://openfacts.berlios.de/index-en.phtml?title=OpenOCD_scripts">OpenOCD configuration examples</a> from the official OpenOCD wiki.</li>
<li>An excellent page about using <a href="http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/openocd_intro/index.html">OpenOCD with ARM controllers</a>, with lots
of real life examples.</li>
<li>An interesting <a href="http://forum.sparkfun.com/viewtopic.php?p=42079">topic on the SparkFun forum</a> about STR9 and OpenOCD.</li>
</ul>
<a name="str9files" /><h2>Configuration files for STR9-comStick</h2>
<p>Download them below:</p>
<ul>
<li><a href="http://elua.berlios.de/other/comstick.cfg">comstick.cfg</a></li>
<li><a href="http://elua.berlios.de/other/str91x_flashprogram.script">str91x_flashprogram.script</a></li>
<li><a href="http://elua.berlios.de/other/comrst.cfg">comrst.cfg</a></li>
<li><a href="http://elua.berlios.de/other/str91x_reset.script">str91x_reset.script</a></li>
</ul>
<p>For STR9 I'm using the Yagarto OpenOCD build for Windows (repository
version 717, as described at the beginning of this tutorial).The <b>comstick.cfg</b> configuration file is for programming the
STR9-comStick. <b>comrst.cfg</b> is for resetting it. The comStick has a very
interesting habit: after you power it (via USB) it does not start
executing the code from the internal flash, you need to execute OpenOCD
with the comreset.cfg script to start it. <b>comrst.cfg</b> does exactly what
it says: executes a CPU reset (since the board doesn't have a RESET
button). This is a very peculiar behavior, and I'm not sure if it's
generic or it's only relevant to my particular comStick. I suspect that
the CPU RESET line isn't properly handled by the on-board USB-to-JTAG
converter, and the only solution I have for this is to execute this
script everytime you power the board and everytime you need to do a
RESET. To use the programming script, invoke the OpenOCD executable like this:</p>
<pre><code>openocd-ftd2xx -f comstick.cfg</code></pre>
<p>(<b>note</b>: under Windows, the OpenOCD executable name is often
"openocd-ftd2xx". Under Linux it's simply "openocd". Replace it with
the actualy name with your executable).</p>
<p>Also, be sure to modify <b>str91x_flashprogram.script</b> if your image name is
not <b>main.bin</b></p>
<a name="stre912files" /><h2>Configuration files for STR-E912 (Olimex)</h2>
<p>Download them below:</p>
<ul>
<li><a href="http://elua.berlios.de/other/str-e912.cfg">str-e912.cfg</a></li>
<li><a href="http://elua.berlios.de/other/str91x_flashprogram.script">str91x_flashprogram.script</a></li>
</ul>
<p>For the <a href="http://www.olimex.com/dev/str-e912.html">STR-E912 board</a> I'm using the Yagarto OpenOCD build for Windows (repository
version 717, as described at the beginning of this tutorial). As this board doesn't have a built-in USB to JTAG adapter, an external one
is needed. The one used by the <b>str-e912.cfg</b> script is the <a href="http://olimex.com/dev/arm-usb-ocd.html">ARM-USB-OCD</a> adapter (also from Olimex).
The <b>str-e912.cfg</b> configuration file is for programming the board. To use the programming script, invoke the OpenOCD executable like this:</p>
<pre><code>openocd-ftd2xx -f str-e912.cfg</code></pre>
<p>(<b>note</b>: under Windows, the OpenOCD executable name is often
"openocd-ftd2xx". Under Linux it's simply "openocd". Replace it with
the actualy name with your executable).</p>
<p>Also, be sure to modify <b>str91x_flashprogram.script</b> if your image name is
not <b>main.bin</b></p>
<a name="lpc2888files" /><h2>Configuration files for LPC2888</h2>
<p>LPC2888 is quite a different animal. I couldn't find any "official"
LPC2888 configuration file for OpenOCD, so I had to learn how to write
my own. It works, but I suspect it can be improved. This time, the
configuration file applies to the latest (SVN) version of OpenOCD, so
use this tutorial to understand how to get the latest OpenOCD sources
and how to compile them (this section is based on version 922 of the
OpenOCD repository). Then use the next file to burn your binary image
to the chip:</p>
<p><a href="http://elua.berlios.de/other/lpc2888.cfg">lpc2888.cfg</a></p>
<p>If your image name is not <b>main.bin</b> edit the file and change the
corresponding line (<i>flash write_bank 0 main.bin 0</i>), then invoke openocd
like this:</p>
<pre><code>openocd -f lpc2888.cfg</code></pre>
<p>I'm using <a href="http://www.olimex.com/dev/arm-usb-tiny.html">ARM-USB-TINY</a>
from Olimex, but it should be easy to use the script with any other
JTAG adapter (don't forget to change the script to match your adapter).</p>
<a name="str7files" /><h2>Configuration files for STR711FR2 (STR7 from ST)</h2>
<p>Download them below:</p>
<ul>
<li><a href="http://elua.berlios.de/other/str7prg.cfg">str7prg.cfg</a></li>
<li><a href="http://elua.berlios.de/other/str7_flashprogram.script">str7_flashprogram.script</a></li>
<li><a href="http://elua.berlios.de/other/str7rst.cfg">str7rst.cfg</a></li>
<li><a href="http://elua.berlios.de/other/str7_reset.script">str7_reset.script</a></li>
</ul>
<p>For STR7 I'm using the Yagarto OpenOCD build for Windows (repository
version 717, as described at the beginning of this tutorial). The
<b>str7prg.cfg</b> configuration file is for programming the STR9-comStick.
<b>str7rst.cfg</b> is for resetting it (you probably won't need this one). I'm using a STR711FR2 heard board from
<a href="http://www.sctec.com.br/content/view/101/30/">ScTec</a> to
which I attached a few LEDs and a MAX3232 TTL to RS232 converter for
the serial communication. The board comes with its own JTAG adapter,
but it uses a parallel interface, and since my computer doesn't have
one, I used the <a href="http://www.olimex.com/dev/arm-usb-tiny.html">ARM-USB-TINY</a> from Olimex. To use them, invoke the OpenOCD executable like this:</p>
<pre><code>openocd-ftd2xx -f str7prg.cfg</code></pre>
<p>(<b>note</b>: under Windows, the OpenOCD executable name is often
"openocd-ftd2xx". Under Linux it's simply "openocd". Replace it with
the actualy name with your executable).</p>
<p>Also, be sure to modify <b>str7_flashprogram.script</b> if your image name is
not <b>main.bin</b></p>
$$FOOTER$$

1
doc/index.html Normal file
View File

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=en_index.html" />