lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


The way Lua does memory makes it hard to use a microcontroller... I think 20KB is still to little depending on the how good your ROTS is...

Try to build a sample Lua application, simulating what you would like to run in the microcontroller.. Then create a debug interface so you can monitor lua memory usage Just done all call to lmem.c to a file that you can import into Excel for something afterward...

You might be able to store scripts in your 16KB banks and the use the 20KB for the rest....

See http://lua-users.org/lists/lua-l/2004-05/msg00060.html for inspiration and http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/

/Erik

Harald Kipp wrote:

Erik,

running TCP over Ethernet also requires more than 4kB
RAM, so we added 32kB. When TCP is up and running, there
are around 20kB left. Luckily our RTOS supports malloc.

Additionally we implemented bank switching. The latest
hardware got 512kB RAM, 32kB fixed plus 30 banks 16KB ea.
Unfortunately no compiler for the AVR supports banked
memory. The application (or any special driver) must
handle bank switching.

If there are somehow central points, where Lua accesses
large memory areas, one could implement this.

Any opinions?

Thanks,
Harald

P.S. I know uCLinux, but do not have any experience with.

At 11:53 04.06.2004 +0200, you wrote:

I have looked into putting Lua into a lot of different microcontrollers but most controllers fails on the memory part. You need ltos of memory (for a microcontroller) and you need full a malloc implementation. take a look at the uClinux - My guess is, if a microcontroller can run uClinux it would run Lua also..

But the ATmega128 has only 4 Kb RAM so there is ny chance of Lua running on it....

/Erik