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
The files that will be compiled to link an eLua image are now found automatically,
there's no need to specify them explicitly anymore. This applies only to the main
'build_elua.lua' build file, each target's 'conf.lua' still needs to specify them
explicitly (but can use the same automatic source file finding as the main build file).
Added a 'summary' display mode in the builder which displays less information
(thus making the output more readable) and also adds colors :) Not exactly
very useful but I saw this recently in cmake and I _had_ to implement it :)
Activate with "disp_mode=summary" in the command line.
Now a target can be reffered to also by its name, not only by the
corresponding _target object. Also added 'utils.lua' as a separate
file in utils/ (it used to be a part of build.lua)
- RTS/CTS pins may not have been configured in correct modes
- ensure that remapping for CAN peripheral occurs during startup so USART1's RTS pin is usable