Re: Finally! A small-footprint text editor written in Lua

classic Classic list List threaded Threaded
8 messages Options
Ra Do Ra Do
Reply | Threaded
Open this post in threaded view
|

Re: Finally! A small-footprint text editor written in Lua

Hello all.

Sorry to dig out this old thread, but I have a question regarding this lua editor (https://github.com/martinwguy/lua-ed) ...

Since I don't have a MMC card implemented on my STM32F4-Discovery board yet, I've decided to flash the five .lua files to the ROMFS folder in order to give the editor a try.

It failed right after require "ed" with 

> require "ed"
error loading module 'mainloop' from file '/rom/mainloop.lua':
        not enough memory
stack traceback:
        [C]: ?
        [C]: in function 'require'
        /rom/ed.lua:3: in main chunk
        [C]: in function 'require'
        stdin:1: in main chunk
        [C]: ?

Do you think this is because it's running off the romfs, or because I am actually out of memory on the board ? 
Or perhaps I am out of memory because I've flashed these files to the rom, hence taking too much available memory away?

I am confused

cheers
Rad



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

Re: Finally! A small-footprint text editor written in Lua

> Do you think this is because it's running off the
> romfs, or because I am actually out of memory on
> the board ?
> Or perhaps I am out of memory because I've flashed
> these files to the rom, hence taking too much
> available memory away?
I've uploaded the files into /mmc (stm32f4discokit, bikeNomad) and:

eLua# lua
Press CTRL+Z to exit Lua
Lua 5.1.4  Copyright (C) 1994-2011 Lua.org, PUC-Rio
> require "ed"
> ed "/mmc/foo.lua"
/mmc/foo.lua: No such file or directory
*a
print "Foooooooooooooo!!!!!!!"
.
*w
31
*q
> dofile "/mmc/foo.lua"
Foooooooooooooo!!!!!!!
>
p.


--
Videokurzy MS Office zdarma! Portál VOLNÝ.cz přináší online výuková
videa, která vás rychle, názorně a zábavnou formou naučí ovládat
programy Excel, Word a PowerPoint. Seriál najdete na
http://web.volny.cz/data/click.php?id=1293


_______________________________________________
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
|

Re: Finally! A small-footprint text editor written in Lua

In reply to this post by Ra Do
On 14 November 2011 23:26, ra.do <[hidden email]> wrote:
> editor (https://github.com/martinwguy/lua-ed) ...
> Since I don't have a MMC card implemented on my STM32F4-Discovery board yet,
> I've decided to flash the five .lua files to the ROMFS folder in order to
> give the editor a try.
> It failed right after require "ed" with
>> require "ed"
> error loading module 'mainloop' from file '/rom/mainloop.lua':
>         not enough memory

> Do you think this is because it's running off the romfs, or because I am actually out of memory on the board ?
> Or perhaps I am out of memory because I've flashed these files to the rom, hence taking too much available
 memory away?

No, ROM uage doesn't subtract from available RAM, the .lua files are
only read and it uses no tempfile so it "should work".
How much RAM does the board have?

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

Re: Finally! A small-footprint text editor written in Lua

In reply to this post by Pito
Date: Wed, 16 Nov 2011 04:30:24 +0100
From: Martin Guy <[hidden email]>
To: "eLua Users and Development List (www.eluaproject.net)"
       <[hidden email]>
Subject: Re: [eLua-dev] Finally! A small-footprint text editor written
       in Lua
Message-ID:
       <[hidden email]>
Content-Type: text/plain; charset=ISO-8859-1

On 14 November 2011 23:26, ra.do <[hidden email]> wrote:
> editor (https://github.com/martinwguy/lua-ed) ...
> Since I don't have a MMC card implemented on my STM32F4-Discovery board yet,
> I've decided to flash the five .lua files to the ROMFS folder in order to
> give the editor a try.
> It failed right after require "ed" with
>> require "ed"
> error loading module 'mainloop' from file '/rom/mainloop.lua':
> ? ? ? ? not enough memory

> Do you think this is because it's running off the romfs, or because I am actually out of memory on the board ?
> Or perhaps I am out of memory because I've flashed these files to the rom, hence taking too much available
 memory away?

No, ROM uage doesn't subtract from available RAM, the .lua files are
only read and it uses no tempfile so it "should work".
How much RAM does the board have?

M

looks like it has 192KB of RAM

http://www.st.com/internet/evalboard/product/252419.jsp


so the 5 lua files:

buffer.lua 16112b
ed.lua 1150b
inout.lua 7076b
mainloop.lua 29271b
regex.lua 9266b

would take away 62875 bytes (61.4KB) ... if all five were to be loaded to RAM, no ?

what's the best way to check for available RAM in eLUA ?

cheers
R.

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

Re: Finally! A small-footprint text editor written in Lua

> would take away 62875 bytes (61.4KB) ... if all
> five were to be loaded to
> RAM, no ?

No, the source code is compiled on-the-fly into a bytecode.
Bytecode is stored to ram then..
p.


--
Staňte se fanoušky portálu VOLNÝ.cz na Facebooku a můžete si zahrát
o vstupenky na konopný veletrh a vaporizér
http://web.volny.cz/data/click.php?id=1297

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

Re: Finally! A small-footprint text editor written in Lua

In reply to this post by Ra Do
> would take away 62875 bytes (61.4KB) ... if all
> five were to be loaded to
> RAM, no ?

No, the source code is compiled on-the-fly into a bytecode.
Bytecode is stored to ram then..
p.


--
Videokurzy MS Office zdarma! Portál VOLNÝ.cz přináší online výuková
videa, která vás rychle, názorně a zábavnou formou naučí ovládat
programy Excel, Word a PowerPoint. Seriál najdete na
http://web.volny.cz/data/click.php?id=1293


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Ra Do Ra Do
Reply | Threaded
Open this post in threaded view
|

Re: Finally! A small-footprint text editor written in Lua

thank you!
 I didn't have "allocator=multiple" in my build command.
now I don't get the "out of memory" error when using Martin's Lua based text editor.

perhaps "allocator=multiple" should be added to the build instructions page @ http://wiki.eluaproject.net/STM32F4DISCOVERY

cheers
Rad

2011/11/18 pito <[hidden email]>
..basically I run the bikeNomad stuff.. the only changes I did has
been incorporated to bikeNomad already..
1. allocator stuff..
2. stack size 4096..
James did it so it has to work now. Try to take his stm32f4 folder
as-is and do compile with:

scons board=STM32F4DSCY allocator=multiple toolchain=codesourcery
prog

P.


--
Staňte se fanoušky portálu VOLNÝ.cz na Facebooku a můžete si zahrát
o vstupenky na konopný veletrh a vaporizér
http://web.volny.cz/data/click.php?id=1297



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

Re: Finally! A small-footprint text editor written in Lua

I've made this default for STM32F407VG and 407IG parts.  So it should
now build by default with the multiple allocator.

-jsnyder

2011/11/18 Ra Do <[hidden email]>:

> thank you!
>  I didn't have "allocator=multiple" in my build command.
> now I don't get the "out of memory" error when using Martin's Lua based text
> editor.
>
> perhaps "allocator=multiple" should be added to the build instructions page
> @ http://wiki.eluaproject.net/STM32F4DISCOVERY
>
> cheers
> Rad
>
> 2011/11/18 pito <[hidden email]>
>>
>> ..basically I run the bikeNomad stuff.. the only changes I did has
>> been incorporated to bikeNomad already..
>> 1. allocator stuff..
>> 2. stack size 4096..
>> James did it so it has to work now. Try to take his stm32f4 folder
>> as-is and do compile with:
>>
>> scons board=STM32F4DSCY allocator=multiple toolchain=codesourcery
>> prog
>>
>> P.
>>
>>
>> --
>> Staňte se fanoušky portálu VOLNÝ.cz na Facebooku a můžete si zahrát
>> o vstupenky na konopný veletrh a vaporizér
>> http://web.volny.cz/data/click.php?id=1297
>>
>
>
> _______________________________________________
> 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