Installing eLua on the STR9 CPU family from ST
Among the ARM based MCUs available today, the STR9 CPUs from ST 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.
Prerequisites
Before you'll be able to use eLua on the STR912FAW44 CPU, make sure that:
- you're using Linux, Windows, or any other OS that has support for OpenOCD. You might have a look at our OpenOCD tutorial before continuing.
- if you're on Windows, you have installed the STR9-comStick support package from the accompanying CD.
- you already have your eLua image for the STR912FAW44 CPU (built or downloaded).
- if you're on Linux, you have super-user (sudoer) access to the system
The following sections show how to burn eLua on kits based on the STR9 MCU.
Using eLua on the STR9-comStick
When we wrote to ST about eLua, they agreed to send us a STR9-comStick board to run eLua 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 OpenOCD tutorial . On the tutorial page you'll also find links to the OpenOCD configuration files that I'm using for burning eLua to the comstick.
IMPORTANT NOTE: 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 OpenOCD tutorial page. It is called comrst.cfg, and you can use it to reset your comstick after it is powered up.
Burning eLua to the STR-E912 Olimex boardboard
To use eLua on the Olimex STR-E912 development board we are using an Olimex programmer to flash the image under Linux, using OpenOCD.
- 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")
- Connect the Olimex programmer cable on the JTAG connector on the STR-E912 Run the OpenOCD script as a superuser, from the OpenOCD scripts directory:
- 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.
$ cp elua_lua_str912faw44.bin /..yourpath../openocd/scripts/main.bin
$ sudo ./openocd -f comstick.cfg
That's it! eLua is now programmed in the CPU, so you can start your terminal emulator and enjoy it, as described in using eLua.