1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00

119 Commits

Author SHA1 Message Date
Martin Guy
fe4c8d86f7 Integrated Martin Guy's emBLOD bootloader patch in eLua. Original patch message:
emBLOD is Marcus Jansson's second-stage boot loader for AVR32UC3A
parts as used in the EVK1100 and Mizar32 boards, designed to allow
firmware images larger than the on-chip flash memory by loading the
eLua binary from SD card into SDRAM and executing it there.

The source for the emBLOD loader is here https://github.com/cmp1084/emBLOD

When compilation option  bootloader=emblod is given to scons, a special
version is compiled that
- locates the program at the start of SDRAM
- doesn't initialize the system clocks and SDRAM controller, as these
are already set up by emBLOD.

If the bootloader= option is not given, eLua is compiled exactly as before.

The changes I've made to Marcus' originally posted patches are to put
DATA and BSS in internal static RAM, the same as before, since in the
best case (memcpy) the SDRAM is three times slower than access to
static RAM
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=80657

This also has an impact on code speed: the interpreter runs 9 times
slower in external SDRAM than it does in internal flash.

Tested and working on Mizar32
2011-04-07 22:35:10 +03:00
James Snyder
5dd26401bd allow avr32-unknown-none variant of avr32 toolchain created by crosstools-ng for avr32 2011-02-27 04:27:29 +00:00
Bogdan Marinescu
f9fbead54c merged pre0.8 branch back to trunk 2011-02-02 17:52:12 +00:00
Bogdan Marinescu
edc33fdd83 MMCFS is now enabled by default on Mizar32; also the default allocator for Mizar32 is now 'newlib' instead of 'multiple' 2011-01-16 15:12:01 +00:00
Bogdan Marinescu
81e7f040fc merged remotefs_int branch on trunk, not fully tested yet 2011-01-16 00:23:19 +00:00
Dado Sutter
2bc5586ff9 - Removing examples from SConstruct ROMFS tables
- Tested only for EK-LM3Sxxxx
2011-01-10 00:08:13 +00:00
Dado Sutter
41fbfb8b9f - fix (added) missing reference to build to Netduino platform 2011-01-06 19:09:37 +00:00
Dado Sutter
c9165aec8e - Added support for the Netduino platform on the build options (board=netduino)
- Minor notes added to LM3Sxxxx platform initialization functions
2010-12-27 12:10:23 +00:00
Bogdan Marinescu
772b33c975 linenoise support for eLua. linenoise is a readline replacement which makes using the Lua interpreter much easier and also adds support for saving the 'history' of lines types in the interpreter. Documentation updated. Thanks go to James for suggesting this in the first place. 2010-11-16 22:53:06 +00:00
Bogdan Marinescu
5978c7b680 - Changed interrupt support infrastructure. No docs yet (will be added later), but check src/platform/lpc24xx/platform_int.c for a quick glimpse of the concept.
- Added direct access to interrupt flags; an interrupt doesn't have to trigger a handler anymore, its flag(s) can be checked instead (platform_cpu_get_interrupt_flag).
- Added experimental C interrupt handlers support (NOT TESTED). It can be compiled and used separately from the Lua interrupt support implementation. Hint: src/elua_int.c, elua_int_set_c_handler and elua_int_get_c_handler, also BUILD_C_INT_HANDLERS (as opposed to BUILD_LUA_INT_HANDLERS).
- Added tmr.set_match_int function that sets a match interrupt on a timer (one-shot or cyclic). Also works on virtual timers. In fact, it currently works only on virtual timers, as none of the platforms have support for this operation with hardware timers.
-Added more interrupt support functions in the CPU module.

All of the above were implemented and tested on the ELUA-PUC board, and nothing else. As a side effect, THIS COMMIT BRAKES THE STR912 PORT! The port will be modified to take advantage of the new interrupt structure soon; until then, please don't update it.
2010-11-03 23:57:27 +00:00
James Snyder
94036f6c9f Enable adcscope for STR9. 2010-10-14 21:11:25 +00:00
Bogdan Marinescu
e0e1c2c4fe added AVR32 without FOSC32 patch and MIZAR32 board support patch (Martin Guy) 2010-10-01 12:11:37 +00:00
Bogdan Marinescu
78cab3b3ad - interrupt support in Lua
- ASM interrupt support for ARM targets which eliminates the need for buggy GCC __attribute__ ((interrupt ("IRQ"))) functions
- code refactoring
2010-09-26 18:54:18 +00:00
Bogdan Marinescu
ae54bffb5d further fix to romfs=compile under Win32 2010-09-15 17:15:43 +00:00
Bogdan Marinescu
76e79329f4 patch for EK-LM3S1968 from Tiziano Trevisan 2010-09-05 18:20:27 +00:00
James Snyder
297048b2a8 Enable reflect ADC support on lpc24xx by adjusting romfs examples and SConstruct to include adc examples on romfs. 2010-09-02 15:19:34 +00:00
Bogdan Marinescu
2619c80d4a added EVK1100 and SPI support for AVR32 2010-08-04 13:18:39 +00:00
James Snyder
e961350299 Disable scons variable cache. 2010-07-29 03:34:21 +00:00
Bogdan Marinescu
6b3f038db3 added support for the I2C interface. UNTESTED, for now enabled only for the STR9 platform. Documentation will follow shortly 2010-07-21 20:21:55 +00:00
James Snyder
851f7c16ba ADC for MBED/LPC1768.
Note: MBED P15->P20 == adc dev ids 0->5
2010-07-12 20:56:54 +00:00
James Snyder
e902d9b7f5 Fix romfs=compile build option.
Command line argument checker was looking for romfs=compiled (incorrect) and target lookup wasn't looking in the correct place.
2010-06-24 23:20:00 +00:00
Dado Sutter
0cf7f2ccb6 - Fixing (or trying to) the require from sd/mmc fs issue 2010-06-22 14:13:05 +00:00
James Snyder
152fe00626 Workaround for MSVC detection issue on Windows. 2010-06-14 20:28:32 +00:00
James Snyder
09620bc22a Fix logic for user specifying particular toolchain. 2010-05-12 16:59:30 +00:00
James Snyder
df8c814ab8 Fix defines that were needed by platform data module. 2010-05-11 21:34:09 +00:00
James Snyder
c5e5ece1cd Now uses scons flags variables to construct compiler/linker commands.
Builds for avr32, sim & i386 should build, but have not been tested.
2010-05-10 23:06:09 +00:00
James Snyder
ea64e2b7d3 Use more of SCons handling for adding preprocessor defines & validation. 2010-05-10 23:05:55 +00:00
James Snyder
c1d27e76ee Initial work towards making the SCons build more parameterized.
- automatically searches for compatible toolchain (and checks that it at least runs)
- running "scons -h" now shows descriptions of command line options and enumerates valid values
- caches last specifically requested configuration

More to come...
2010-05-06 01:09:40 +00:00
James Snyder
bac2b927ba Start of SConscript conversion 2010-05-06 01:09:21 +00:00
James Snyder
5f5e01fd3b Add support for Semihosting filesystem operations
- enable file creation, reading, writing on mbed for the built-in filesystem
- implementation currently lacks support for directory listings, this will be
  added when mbed implementation details are available.

Note: this should work with other ARM arm ports that are connected to a JTAG
debugger that implements semihosting, though I have not tested it.
2010-03-08 20:08:07 +00:00
James Snyder
dee997d856 Adjust mmcfs to enable long filename support and correct directory listing
bug.
2010-02-22 03:39:47 +00:00
James Snyder
f825e2c39e Use all RAM on mbed. Adjust life.lua to show memory usage information, and use
a bit smaller grid.
2010-02-20 01:15:16 +00:00
James Snyder
271dcc15e1 Enable PWM support for lpc17xx/mbed.
Note: pin functions need to be configured on this platform for output to go to
a given pin.
2010-02-20 00:27:33 +00:00
James Snyder
9a1536b959 Fix LM3S6965 bug related to using lm3s module.
Add tetrives back on LM3S6965.
2010-02-15 22:26:15 +00:00
Dado Sutter
d890fd3c50 - Fixed LM3S games and aux modules
- Updated lm3s games versions merged with trunk
- Tetrives game added to default LM3S8962 build on SConstruct
2010-02-03 12:32:18 +00:00
Bogdan Marinescu
e7702bb0e2 Manual merge of remotefs/ into trunk. Tested with the simulator and (partially) on a ET-STM32 board. Other changes:
- FAT changed to support the new opendir/readdir/closedir mechanism, and to use lseek directly instead of ioctl (also fixed a bug in FAT's lseek that always returned 0 instead of file position).
- ET-STM32 console moved to UART2@19200bps (to allow RFS to run on UART0). If UART0 is needee for console, remember to disable RFS.
- freed 700+ bytes of RAM by changing the devman implementation to keep pointers instead of actual DM_DEVICE structures
- other minor code changes and fixes
2010-02-01 18:47:41 +00:00
James Snyder
c31efa276a Switch SCons decider, crunch PNG screenshots.
SCons decider for main build and luarpc have been switched to MD5-timestamp,
which will prevent scons from re-digesting files it has cached unless
timestamp has changed (should shave a little off of build times, but be safe).

Some of the PNG screenshots that didn't get crunched before the 0.7 release
have been run through optipng, advpng and pngout to wring out as many bytes as
possible without losing data/quality.
2010-01-28 19:17:22 +00:00
James Snyder
51221f8b4c Merge 0.7 changes to trunk. 2010-01-25 23:43:05 +00:00
James Snyder
9c6062a632 Initial basic mbed (LPC1768) support. 2010-01-05 03:40:12 +00:00
James Snyder
c85e3a1d2d Starting Cleanup of LuaRPC for 0.7 release.
- added some more documentation (not yet done)
- alternate uarts can be selected (boot mode defaults to console uarts)
- renamed "remote" references to "rpc" (may as well keep the original name)
- switch default error handler to luaL_error (presumably wasn't available for
  old 4.x LuaRPC)
- tweaks to exception handling to make things more consistent (hopefully)
2009-12-04 01:46:47 +00:00
Bogdan Marinescu
e935ae52e7 mostly cosmetic changes for the new romfs compress/compile feature 2009-12-03 11:29:33 +00:00
James Snyder
df1ab9e534 Fixes for experimental "compress" mode for romfs. 2009-12-02 21:22:41 +00:00
Bogdan Marinescu
26361ea4cd EXPERIMENTAL FEATURE: romfs compression/precompilation.
Added another "romfs" parameter to SConstruct. It can take one of 3 values:

- "verbatim" (default): copy all the files from the eLua romfs/ directory to the binary image (exactly what happened until now)
- "compress": use LuaSrcDiet (http://luaforge.net/projects/luasrcdiet, now included in the eLua distribution) to "compress" the source code by using different tricks (shorter identifiers, removing comments and EOLS, and so on). The output is still a compilable Lua file (although in most case it looks completely different from the original) which is copied in the eLua binary image instead of the original Lua file. The compression obtained by using this method seems to be very good in practice, thus it will save flash when needed.
- "compile": use the eLua cross compiler (that must be built first by running 'scons -f cross-lua.py') to precompile the Lua files to bytecode, and write the bytecode to the image instead of the source file. This way, one can save both time (the scripts don't need to be compiled anymore) and RAM (for the same reason, especially since the Lua parser uses the stack a lot, which can lead to very nasty and hard to diagnose stack overflow bugs). It will be even more useful in the future, when (hopefully) more and more Lua bytecode data structures will be available directly from Flash (without having to copy them RAM as it happens now). It might also decrease the romfs memory footprint, but then again, it might not; it pretty much depends on the Lua programs included in the romfs.
2009-12-02 19:33:03 +00:00
Dado Sutter
6172f55b76 Snake added to SConstruct ROMFS build table.
It was NOT added to the default builds of the LM3S boards.
2009-11-20 12:15:20 +00:00
James Snyder
a66a9fed6d Add hard fault handler for STM32 that dumps register contents to aid in
debugging.

Might be nice to have a generalized form of something like this to help in
pointing in the right direction when one doesn't have a JTAG debugger.
2009-11-07 00:24:02 +00:00
Dado Sutter
22dc664737 - Scontruct: autorun.lua file, if found in /romfs, is now included in eLua builds for
any platform. No need to specify it in the file_list table.
- minor comments added to SConstruct
- LM3S platform specific modules commented
- Minor comments in Pong
- Debugging prints removed from Tetrives
2009-11-02 17:44:35 +00:00
Bogdan Marinescu
f1d8594ea2 added PWM to the LPC24xx platform (and also pwmled.lua) 2009-10-31 16:52:40 +00:00
Bogdan Marinescu
8476b93446 merged branch lpc24xx (r492:507) to trunk 2009-10-31 11:41:34 +00:00
Bogdan Marinescu
cf48728115 - added support for the STR-E912 board from Olimex
- PWM module for STR9
- STR9 port fixes 
- STR9 platform-specific module: str9.pio (the STR9 GPIO subsystem is quite uncommon).
- small LM3S fixes
2009-10-18 01:27:33 +00:00
James Snyder
c404753efa Merge fix for list of ROMFS files. 2009-10-13 23:56:40 +00:00