A Hempl-like hack to emulate GNU/Linux on Cortex-M
Dear eLua community, greetings!
I trust you are all doing well. I am now writing to you about another
hack that works because of eLua's language and target agnostic
software interface. Hempl , eLua's PicoLisp incarnation was simple
to write because of exactly the same philosophy.
I worked with 2 students to get Dmitry Grinberg's uARM ARMv5 emulator
 (modified of course) working on the Infineon XMC4500-E144x1024
(comes with an 8MB external SDRAM interface). From there, we were able
to get the PXA-255 build of Ubuntu GNU/Linux running on the Cortex-M4
- like Dmitry's work for one of the 8-bit micro-controllers from
We started off with Hempl (which was derived from eLua) and removed
all PicoLisp specific elements from it. We then inserted `uarm' as a
command (instead of `lua' in eLua's case OR `picolisp' in Hempl's
case) in the eLua shell and cross-compiled *regular* desktop `uARM'
for the XMC4500. Parts of the desktop uARM code which used termios/
signal handling routines had to be removed.
The XMC4500 has an external bus unit. Once, we had all the code in
place, all we had to do was to tell the memory allocator about the 8MB
external SDRAM. (some configuration for eLua's MEM_START_ADDRESS and
MEM_END_ADDRESS). malloc was then able to allocate in both the
internal SRAM banks and also within the realm of the external SDRAM.
The FATFS sub-system was then able to pick up a PXA-255 Jaunty
Jakalope from /mmc and run the build. It takes about 13 minutes to
boot into GNU bash. :) The MCU was configured to run at its default
clock of 120MHz. The code for now runs as an Infineon DAVE project.
Mounika is maintaining the source code .
It started off as a proof-of-concept but this might add more credence
to Dado's and Bogdan's idea (from a discussion many years ago in the
mailing list) of splitting eLua into two parts - a part with the Lua
extensions for MCUs and another part with eLua's language-agnostic
Many thanks eLua! Good day!
P.S. I initially tried this on the Mizar32. It comes with a gracious
32MB external SDRAM. I ran into some memory alignment issues which I
couldn't fix without a debugger.