So, you already built and installed eLua and now it is time to have fun with it. It's actually quite easy: all you need is your
board connected to a PC, running a terminal emulation program.
If
you're using Windows, I strongly recommend TeraTerm.
It's a freeware, it's very powerful and also easy to use. The native Hyper Terminal progam can do too.
On
Linux,
you'll probably be stucked with minicom. It is not exactly intuitive
and it runs in text mode, but it's still very powerful. If you
google for "minicom tutorial" you'll get the hang of it in no time. You
can try any other terminal emulator, as long as you set it up
properly and it gives you the option of transferring files
via XMODEM, which is what eLua uses at the moment. These are the main
settings you need to look at:
Also, depending on the type of your board, you'll need some way to connect the board to a serial port on your PC or to USB if you're using an USB to serial converter. For example, as already explained here##, the USB port on the LM3Sxxxx boards is dual, so you can use it as an USB to serial converter after downloading your firmware, thus you don't need any other type of connection. The same is true for the STR9-comStick board. On the other hand, for the SAM7-EX256 board you'll need to connect a serial cable to the "RS232" connector, provided that the jumpers are already set as explained here## and on the MOD711 you will need to add an RS232 converter chip.
After you setup this PC-eLua board connection and press the "RESET" button on your board, you should see the eLua shell prompt. For your convenience, the shell documentation is also provided on this page.
After you burn eLua to your board and you connect the board to your terminal emulator running on the PC, you'll be greeted with the eLua shell prompt, which allows you to:
More details about some of the shell commands are presented below.
To use this, your eLua taret image must be built with support for XMODEM (see docs/elua_components.txt for details). Also, your terminal emulation program must support sending files via the XMODEM protocol. Both XMODEM with checksum (the original version) and XMODEM with CRC are supported, but only XMODEM with 128 byte packets is allowed (XMODEM with 1K packets won't work). To use this feature, enter "recv" at the shell prompt. eLua will respond with "Waiting for file ...". At this point you can send the file to the eLua board via XMODEM. eLua will receive and execute the file. Don't worry when you see 'C' characters suddenly appearing on your terminal after you enter this command, this is how the XMODEM transfer is initiated.
This allows you to start the Lua interpreter, optionally passing command line parameters, just as you would do from a Linux, Windows or MacOS command prompt. This command has some restrictions:
eLua# lua -e 'print('Hello, World!')' -i
Press CTRL+Z to exit Lua
lua: (command line):1: unexpected symbol near ''
However, if you use both '' and "" for string quoting, it will work:
eLua# lua -e 'print("Hello, World")' -i
Press CTRL+Z to exit Lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
Hello,World