- Check for error return values and return errors when they happen
- Return error value when invalid parameters are passed
- uart.setup(): return the actual baud rate set.
so that the relatively common UART input buffer overflow condition just says
"[ERROR] Buffer overflow." without the inscrutable "resid=0 resnum=0" numbers.
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
- specify -Dmacro on the builder command line to automatically include the macro in the compiler command line
- refactoring: option handling code now moved to utils/utils.lua
- various small bugfixes
identical to the ones in the avr32 headers, then copying the bitfields one
by one. This commit just uses the avr32 bitfields and writes them to the
regiters as 32-bit words. Code saving: 240 bytes (and it's faster of course)
------------------------
This adds the functions of mathlib that make sense when numbers are integers:
functions [abs,max,min,random,randomseed,sqrt] and constant "huge"
so that idioms like this (from p.195 of Programming in Lua) also work:
for i = 1,math.huge do
...
if ... then break end
...
end
The square root gives the integer square root of positive numbers
(which would be floor(sqrt(f)) in a floating point world).
- add basic (no clock support) ADC implementation for AVR32, works on EVK1100
- add avr32-unknown-none-gcc to new lua-based build system to support crosstools-ng avr32 toolchain