- disabled by default (enable on a target-by-target basis) so it shouldn't
cause much breakage for non-rpc users
- some modifications to the binary chunk reader which should allow reading of
chunks encoded on various platforms (with certain limitations like lualong
can't read float lua bytecode, one must generate lualong bytecode from a float
lua)
- other misc changes.
- code cleanup
- the platform is now named 'sim'. You build it like this:
$ scons cpu=linux
The idea is to support more than one host OS by changing the "cpu" variable
above (for example cpu=osx, or cpu=win32). Also, a crude "host interface" was
defined in hostif.h. In theory, a host OS should only implement that interface
in order to run the eLua simulator. The implementation must reside in a file
called hostif_{os}.c (in this case hostif_linux.c). Too bad I don't have a MAC,
I would've loved to try this :)
REMEMBER: whem implementing a host interface, you CAN NOT rely on your regular
libc! You'll have to rewrite the syscalls (see host.c for an example on how to
do this in Linux).
- after you build it, don't start it directly, use the new "run_elua_sim.sh"
script to run it. It will set the terminal to raw mode, no echo, so it will
behave more like "traditional" eLua (even hangman.lua will run in this mode :) ).
Remember to run in on an ANSI capable terminal (although most of them support
ANSI emulation nowadays).
- you can exit from the simulator with "exit". You can't do this with CTRL+C if
you run it with "run_elua_sim.sh".
All in all, this looks pretty good and it's an excellent test platform. It will
do wonders when we integrate our own libc and we won't be able to figure out why
it doesn't work :)
- ADC adjusted to work with sequenced acquisition setups. It should now
accomodate both sequenced and non-sequenced approaches on the backend.
A few more adjustments should be made to handle multiple sequencers
but right now neither LM3S or STM32 platforms use more than one sequencer.
- Added adcpoll.lua to demonstrate a simple approach for using clocked
acquisition and displaying results as they become available.
- ADC now works for STM32 (all 16 channels!). This should receive more
extensive testing, but everything should be working at this stage.
- the build system now pays attention to changes in header files meaning that
if any headers change or if the romfs changes (since it is generated as a
header) these changes will get recompiled without having to do a clean.
- The Eagle 100 binary image now starts at 0x2000 by default (instead of the regular 0x0) to allow users to take advantage of the provided Ethernet bootloader.
- deleted the old docs/ directory. The "real" documentation is in the doc/ directory
- "building" page completely rewritten
- a new page about the toolchains used in eLua
- a graphical representation of the system architecture (doc/wb_img/elua_arch.png) that will be used in a soon to come page about the eLua architecture
Also:
- validate.h updated with some new tests (still needs more work)
- "arm-gcc-eabi" toolchain name changed to "codesourcery", since this is obviously way more intuitive :)
$ scons board=... toolchain=arm-gcc|arm-gcc-eabi
(the default is still arm-gcc, but this can be changed by editing SConstruct).
This is a Very Good thing for us, because users won't need to build their own toolchains anymore, they can just download the one from CS and use it. Thanks again for this.
Actually, the whole build system was changed to support arbitrary toolchains (although there's much work to be done in this area).
Also, changed a few things in the STM32 port (the linker script file, the stack definitions).
And other (very minor) changes (mostly to fix some compiler warnings).
SConstruct edited just to leave group/files definitions close to the platform/groups.
Doc content files mirroed to pt, to ease the portuguese version initial migration
ADC:
- getsamples split into getsamples and getsample. getsamples always returns a
table of results. getsample returns single values (if available).
EABI compiler support:
- added a parameter to SConstruct called cprefix, which allows one to define a
prefix other than the arm-elf used by some platforms. Currently the only
platform that does anything with this parameter is LM3S, conf.py scripts can
be updated to handle the default toolchain prefix, and accommodate alternate
ones if needed.
- Added sections to lm3s.ld (originally committed by Jesus Alvarez) to handle
linking properly for arm-eabi targets.
Recommended only for systems with very low memory (Flash/RAM), and prefferably systems running only precompiled Lua (if you need to compile the code, you might get into stack overflows, and this allocator is much more sensitive to this kind of stuff than dlmalloc()). In fact, this allocator seems to suggest that one should set the stack to at least 4k for the Lua parser to run properly even on small programs. I won't do this just yet, rather I'll keep on trying to move the Lua parser data structures from stack to heap. For now we're OK with the current configuration.
The allocator can handle multiple memory spaces.
Enable with "allocator=simple" on the scons command line.
...oh yes, also added a newline to the end of elua_adc.c :) (to avoid some annoying warnings)
buf.c.
The smoothing buffer is still kept separate from the main buffering system,
but as samples come in via interrupt, they are placed into a "standard" elua
buf. The size of this buf is configured according to whether one is grabbing
a bunch of samples rapidly (burst), or singly in order to accommodate the
expected number of incoming samples. If smoothing is enabled, incoming
samples are claimed until the smoothing buffer is full, and then remaining
samples are left in the main buffer until they are collected. This means that
whether one is collecting single samples or samples at burst rate, and
smoothing is enabled, the filter will only be providing samples that have
enough history.
Added a function to manually flush both smoothing and main buffers.
This would be useful if you know your state has changed and you only want
fresh samples that are going to be collected after a flush.
Also, a lot of functionality moved into elua_adc.c and common.c
(boundaries for what belongs where, might be evaluated), reducing the number
of platform.c specific functions dramatically.
Basic functionality seems to be working, but some more testing should be done.
Also, given that there's now a dynamic buffer behind everything, a shift in
the way sampling is handled could be done:
sample and burst functions could be made to be non-blocking, and to never
return anything except for errors.
a separate getsamples function could be used for removing samples collected by
either function from the buffer.
Suggestions are welcome as it would be nice to keep usage paradigms stable
after the 0.6 release.
the heap instead of the stack. Also, the stack size was bumped to at least
2048 bytes on all backends. Hopefully this will take care of most issues
related to stack overflows.
- new buffering system available. Originally I planned to make it fully
generic, but I came to the conclusions that this would take too much
development work and system resources (RAM/Flash) if done properly, so
currently it's only used on UART RX (although it could be easily extended
for other peripherals). For an example of use check the AT91SAM7X and
AVR32 backend (platform_init and associated interrupt handlers and also
platform_conf.h).
- new XMODEM implementation. Better, cleaner, bug fixed, and BSD instead of
GPL.
- AVR32 can use the huge (32MBytes) SDRAM on the board as system memory now.
- fixed an error in elua_sbrk/_sbrk_r (and revised the compilation options
for dlmalloc).
- added the CPU module and interrupt support on the STR9 platform.
- uart module changes: 'sendstr' is out, but the regular 'send' will send
strings instead of simple chars (which makes sense since Lua doesn't have
a "char" type). Also, the 'timer_id' and 'timout' parameters of the 'recv'
function are now optional.
- all eLua modules updated to work with LTR
- "cpu" module added to avr32, at91sam7x, str7
- "disp" module no longer generic (now stays in src/modules/lm3s). For this reason, the "disp" platform interface was also removed.
- the "modcommon" mechanism in STM32 (ROM loader) was depreciated in favour of the Lua Tiny RAM patch (and the "stm3210lcd" module from the STM32 backend now uses LTR).
- small bugfixes
- added virtual timers (on LM3S, AVR32 and AT91SAM7 for now)
- added interrupt handling code for AT91SAM7 and AVR32
- fixed two serious bugs that prevented the eLua image to run on both STR9 and LPC2888 (linker command file issues)
- fixed line endings (DOS->UNIX) in the STM32 library files
- fixed preprocessor errors (hopefully all of them) like #if ELUA_CPU == LM3S8962
- other minor or less than minor fixes :)
- ls shell command enhanced with column aligned file sizes and total size report
- New section on CHANGELOG for ongoing dev changes, to ease up next release
- pong.lua added to examples in romfs
- minor URL and e-mail updates, to reflect the new eluaproject.net domain
* Added systick functions (for stm3210lcd module)
* Created modcommon.{c,h} which contain module helper functions and module loader
* Created lstm32_mod.c which demonstrates module helper functions and module loader (in addition to lua_lcd.c)
* Added a .lua_init section to the stm32.ld linker script to facilitate platform module loading (see modcommon and lstm32_mod)
* Updated conf.py auxmods.h and SConstruct to build the new files.
* Modified linit.c to add support for require and package back in so that require 'stm3210lcd' would work.
- added the resolver application (src/uip/resolv.*) to eLua (configurable by BUILD_DNS in build.h) to allow DNS lookups
- more functions in the "net" module, more tests, it seems to work fine now in both "server mode" and "client mode"
- console over TCP works once again, or should I say "now works". It turns out that it never worked with the code in SVN, because I committed a wrong file a while ago.
ANSI terminal support (yet) and "recv" doesn't work anymore because XMODEM doesn't work over TCP/IP. Only for LM3S8962/LM3S6965 for now, but it should straightforward (not easy though)
to port it to other platforms. Only static IP for now. More TCP/IP functions need to be implemented (and an eLua module must be written to access them). To enable console over TCP:
- enable "BUILD_CON_TCP" in build.h, also disable "BUILD_XMODEM" and "BUILD_TERM" in build.h (you'll get an error if you don't)
- disable "BUILD_CON_GENERIC" in build.h (you'll get an error if you don't)
- edit your network settings in build.h
- build the image&burn it
- telnet to the address configured in build.h. Be sure to use a decent telnet client, like the one in Linux or putty. Don't try with telnet from Windows, as it surely won't work. Also, it might
not work with the telnet client from Tera Term Pro (didn't test this).
- type 'exit' from shell to terminate the connection.
Also, note that from this point on you'll need a newer version of binutils to compile for Cortex. I'm using binutils-2.19.50.tar.bz2 (from the snapshots page). 2.18 might work too, but I didn't
test it.
mathlib (sin, cos, tan and all the other functions from there).
- corrected "pwmled.lua" (removed a debug print)
- bumped version number to minor versn 0.4.1
I/O setup.
- the pd() module has a new method (board) and gets it CPU, platform and board name directly from the build system (command line macros). It's much easier to work like this.
- the samples (examples/) were updated to check pd.board() rather than pd.platform()/pd.cpu(), which is a much more logical way to do things, since it ties the sample to a
specific I/O configuration, not with a CPU.
- updated PWM code for AT91SAM7X, now the "piano" example works for both LM3Sxxxx and AT91SAM7X256.
- added 3 new methods to the PIO module: pullup(), pulldown(), ad nopullup(), their meaning is obvious.
- new shell command: mem
- new module: bit (for bit operations)
- removed UARTx, TMRx, SPIx, PWMx constants from the respectives modules, as they only waste memory space. But now the same
modules will return an error (via luaL_error) if an invalid resource ID is used. Note that this does not apply to PIO, since
PIO uses special encodings for ports/pins.
- new methods in pio: port and pin to return the port/pin encoded in a pio value.