Quantcast

128KB Flash and 20KB RAM,can it with elua?

classic Classic list List threaded Threaded
6 messages Options
sugar sugar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

128KB Flash and 20KB RAM,can it with elua?

I have a stm32 board with 128KB Flash and 20KB RAM, can i use it with elua. I see most of the boards are above 512KB Flash and 64KB RAM in the ellua website.  If I can, how many elua's features  may be  used or not.
Martin Guy Martin Guy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 128KB Flash and 20KB RAM,can it with elua?

On 18 May 2013 12:23, sugar <[hidden email]> wrote:
> I have a stm32 board with 128KB Flash and 20KB RAM, can i use it with elua.

I did exactly this for the mizar32 last week, targetting 120K to be exact.
Use the "Mizar32-v0.9" branch, which has load of code-size hacks,
apply the AT32UC3A0128 configurations from
src/platform/avr32/MIZAR32/mizar32_conf.h and src/lua/luaconf.h to
your board and compile with
  scons target=lualong allocator=simple optram=0 rostrings=0

In our case this allowed us to fit in all the modules except net.*()

If you need FP or net for some reason, you'll need to disable other
Lua modules or features to make space.

Good luck!

   M
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
gduarte gduarte
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 128KB Flash and 20KB RAM,can it with elua?

But 20k of RAM is enough to run eLua?

Le 19 mai 2013 13:06, "Martin Guy" <[hidden email]> a écrit :
On 18 May 2013 12:23, sugar <[hidden email]> wrote:
> I have a stm32 board with 128KB Flash and 20KB RAM, can i use it with elua.

I did exactly this for the mizar32 last week, targetting 120K to be exact.
Use the "Mizar32-v0.9" branch, which has load of code-size hacks,
apply the AT32UC3A0128 configurations from
src/platform/avr32/MIZAR32/mizar32_conf.h and src/lua/luaconf.h to
your board and compile with
  scons target=lualong allocator=simple optram=0 rostrings=0

In our case this allowed us to fit in all the modules except net.*()

If you need FP or net for some reason, you'll need to disable other
Lua modules or features to make space.

Good luck!

   M
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Martin Guy Martin Guy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 128KB Flash and 20KB RAM,can it with elua?

On 20 May 2013 00:11, Gabriel Duarte <[hidden email]> wrote:
> But 20k of RAM is enough to run eLua?

Good point. Maybe with the optram=1 and removing some unneeded Lua
modules to make space.
Bogdan knows more about running in small RAM, and has made many
modifications to make that possible.
I'm the small-ROM guy :)

    M
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jbsnyder jbsnyder
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 128KB Flash and 20KB RAM,can it with elua?

20 kB of SRAM is going to be tight.  I've worked with a target that has 32 kB of SRAM and that one was usable with some modification (there's actually a memory leak that I should migrate a patch from that branch that will be useful if you're using the REPL, https://github.com/elua/elua/issues/13).  I'm not sure if anyone has tried a 20 kB target before, but I would tend towards keeping things as lean as possible if you try it, precompiling code if you plan to run scripts, turning off command history and any modules you don't need.




On Mon, May 20, 2013 at 4:14 AM, Martin Guy <[hidden email]> wrote:
On 20 May 2013 00:11, Gabriel Duarte <[hidden email]> wrote:
> But 20k of RAM is enough to run eLua?

Good point. Maybe with the optram=1 and removing some unneeded Lua
modules to make space.
Bogdan knows more about running in small RAM, and has made many
modifications to make that possible.
I'm the small-ROM guy :)

    M
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



--
James Snyder
Biomedical Engineering
Northwestern University
http://fanplastic.org/key.txt
ph: (847) 448-0386

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Martin Guy Martin Guy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 128KB Flash and 20KB RAM,can it with elua?

On 20 May 2013 22:50, James Snyder <[hidden email]> wrote:
> 20 kB of SRAM is going to be tight.  I've worked with a target that has 32
> kB of SRAM and that one was usable with some modification

I just tried eLua with 20K of RAM using the Mizar32-128K config +
rostrings + optram, and removing TERM to make code space for the RAM
optimisations, and hacking the memory config to pretend there are only
20Kbytes.

The interpreter starts up with console on UART and you can run
one-liners like "print(42)" or "print(collectgarbage("count"))" (which
says "4", then "5" a few times, then "6" a few times, then "not enough
memory").

James, your memory leak patch improves things slightly: in 20K you can
press Enter 17 times before it runs out of memory instead of 16, so
it's doing something but there is another heap leak somewhere in the
path from the Lua prompt back to Lua prompt.

So the answer is: yes, provided your Lua application will work in a
few K of heap.

    M
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Loading...