Heap size

classic Classic list List threaded Threaded
15 messages Options
Michael65589 Michael65589
Reply | Threaded
Open this post in threaded view
|

Heap size

Hello,
can anybody tell me where the HEAP-Size is defined in the elua project?

Best regards
Michael
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Heap size

Hi,

On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>
> Hello,
> can anybody tell me where the HEAP-Size is defined in the elua project?

It is not explicitly defined. It's rather what's left after the
startup code initialized the .data and .bss sections and the stack is
initialized (the stack size is defined in
src/paltform/<platformname>/stacks.h".

Best,
Bogdan

> View this message in context: http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
> Sent from the eLua Development mailing list archive at Nabble.com.
> _______________________________________________
> 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
Michael65589 Michael65589
Reply | Threaded
Open this post in threaded view
|

AW: Heap size

Hi Bogdan,

 

thank you for the fast answer.

 

Map-file:

                0x20000fd4                end = .

                0x20010000                PROVIDE (_estack, 0x20010000)

 

So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE (2048) right?

 

I have a problem with a realloc. After I start the elua project I enter LUA in the console. After that I write a array like:

 

CRCTABLE =

{

[0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,

0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,

0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…

 

512 Byte. After I write the array again a hardfault exception cause.

 

The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000

 

static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {

  nptr = realloc(ptr, nsize);

  if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {

    luaC_fullgc(L); /* emergency full collection. */

    nptr = realloc(ptr, nsize); /* try allocation again */

  }

  return nptr;

 

The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back and the next realloc crashes.

 

I do not now why.

 

Von: BogdanM [via eLua Development] [mailto:[hidden email]]
Gesendet: M
ontag, 31. Januar 2011 12:22
An: Stahl, Michael
Betreff: Re: Heap size

 

Hi,

On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>
> Hello,
> can anybody tell me where the HEAP-Size is defined in the elua project?

It is not explicitly defined. It's rather what's left after the
startup code initialized the .data and .bss sections and the stack is
initialized (the stack size is defined in
src/paltform/<platformname>/stacks.h".

Best,
Bogdan

> View this message in context: http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
> Sent from the eLua Development mailing list archive at Nabble.com.
> _______________________________________________
> 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


If you reply to this email, your message will be added to the discussion below:

http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html

To unsubscribe from Heap size, click here.

BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Heap size

> Hi Bogdan,
>
>
>
> thank you for the fast answer.
>
>
>
> Map-file:
>
>                 0x20000fd4                end = .
>
>                 0x20010000                PROVIDE (_estack, 0x20010000)
>
>
>
> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE (2048)
> right?

Yes.

> I have a problem with a realloc. After I start the elua project I enter LUA
> in the console. After that I write a array like:
>
>
>
> CRCTABLE =
>
> {
>
> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>
> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>
> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>
>
>
> 512 Byte. After I write the array again a hardfault exception cause.
>
>
>
> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>
>
>
> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>
> …
>
>   nptr = realloc(ptr, nsize);
>
>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>
>     luaC_fullgc(L); /* emergency full collection. */
>
>     nptr = realloc(ptr, nsize); /* try allocation again */
>
>   }
>
>   return nptr;
>
>
>
> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back and
> the next realloc crashes.

It looks like you're running out of memory (I don't know why since it
seems that you should have enough free memory) and then the EGC
(Emergency Garbage Collector) runs and the realloc crashes after that.
Very weird. A few questions:

- what board are you using?
- what eLua image are you using? Is it a standard one or did you
compile it from trunk or other branch?
- can you attach your platform_conf.h if it's different from the SVN version?
- right after you enter the array in Lua can you please run this:

print(collectgarbage'count')

and let me know the result?

Thanks,
Bogdan

> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 12:22
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
> Hi,
>
> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>
>> Hello,
>> can anybody tell me where the HEAP-Size is defined in the elua project?
>
> It is not explicitly defined. It's rather what's left after the
> startup code initialized the .data and .bss sections and the stack is
> initialized (the stack size is defined in
> src/paltform/<platformname>/stacks.h".
>
> Best,
> Bogdan
>
>> View this message in context:
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>> Sent from the eLua Development mailing list archive at Nabble.com.
>> _______________________________________________
>> 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
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>
> To unsubscribe from Heap size, click here.
>
> ________________________________
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> 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
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Heap size

Another thing to try is to increase your stack size to 4096 or even
8192 bytes and recompile the image.

Best,
Bogdan

On Mon, Jan 31, 2011 at 1:41 PM, Bogdan Marinescu
<[hidden email]> wrote:

>> Hi Bogdan,
>>
>>
>>
>> thank you for the fast answer.
>>
>>
>>
>> Map-file:
>>
>>                 0x20000fd4                end = .
>>
>>                 0x20010000                PROVIDE (_estack, 0x20010000)
>>
>>
>>
>> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE (2048)
>> right?
>
> Yes.
>
>> I have a problem with a realloc. After I start the elua project I enter LUA
>> in the console. After that I write a array like:
>>
>>
>>
>> CRCTABLE =
>>
>> {
>>
>> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>>
>> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>>
>> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>>
>>
>>
>> 512 Byte. After I write the array again a hardfault exception cause.
>>
>>
>>
>> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>>
>>
>>
>> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>>
>> …
>>
>>   nptr = realloc(ptr, nsize);
>>
>>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>>
>>     luaC_fullgc(L); /* emergency full collection. */
>>
>>     nptr = realloc(ptr, nsize); /* try allocation again */
>>
>>   }
>>
>>   return nptr;
>>
>>
>>
>> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back and
>> the next realloc crashes.
>
> It looks like you're running out of memory (I don't know why since it
> seems that you should have enough free memory) and then the EGC
> (Emergency Garbage Collector) runs and the realloc crashes after that.
> Very weird. A few questions:
>
> - what board are you using?
> - what eLua image are you using? Is it a standard one or did you
> compile it from trunk or other branch?
> - can you attach your platform_conf.h if it's different from the SVN version?
> - right after you enter the array in Lua can you please run this:
>
> print(collectgarbage'count')
>
> and let me know the result?
>
> Thanks,
> Bogdan
>
>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>> Gesendet: Montag, 31. Januar 2011 12:22
>> An: Stahl, Michael
>> Betreff: Re: Heap size
>>
>>
>>
>> Hi,
>>
>> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>>
>>> Hello,
>>> can anybody tell me where the HEAP-Size is defined in the elua project?
>>
>> It is not explicitly defined. It's rather what's left after the
>> startup code initialized the .data and .bss sections and the stack is
>> initialized (the stack size is defined in
>> src/paltform/<platformname>/stacks.h".
>>
>> Best,
>> Bogdan
>>
>>> View this message in context:
>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>> _______________________________________________
>>> 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
>>
>> ________________________________
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>>
>> To unsubscribe from Heap size, click here.
>>
>> ________________________________
>> View this message in context: AW: Heap size
>> Sent from the eLua Development mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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
Michael65589 Michael65589
Reply | Threaded
Open this post in threaded view
|

AW: Heap size

In reply to this post by BogdanM

Hello Bogdan,

 

I fix the „bug”. If you use external SRAM the GPIO configuration will be override in the pios_init function (platform.c) There all GPIOs will be set to floating input.

 

Best regards and thank you for your fast answers.

 

Michael

 

PS: Did you update this on the server?

 

 

Von: BogdanM [via eLua Development] [mailto:[hidden email]]
Gesendet: Montag, 31. Januar 2011 12:42
An: Stahl, Michael
Betreff: Re: Heap size

 

> Hi Bogdan,


>
>
>
> thank you for the fast answer.
>
>
>
> Map-file:
>
>                 0x20000fd4                end = .
>
>                 0x20010000                PROVIDE (_estack, 0x20010000)
>
>
>
> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE (2048)
> right?

Yes.


> I have a problem with a realloc. After I start the elua project I enter LUA
> in the console. After that I write a array like:
>
>
>
> CRCTABLE =
>
> {
>
> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>
> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>
> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>
>
>
> 512 Byte. After I write the array again a hardfault exception cause.
>
>
>
> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>
>
>
> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>
> …
>
>   nptr = realloc(ptr, nsize);
>
>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>
>     luaC_fullgc(L); /* emergency full collection. */
>
>     nptr = realloc(ptr, nsize); /* try allocation again */
>
>   }
>
>   return nptr;
>
>
>
> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back and
> the next realloc crashes.

It looks like you're running out of memory (I don't know why since it
seems that you should have enough free memory) and then the EGC
(Emergency Garbage Collector) runs and the realloc crashes after that.
Very weird. A few questions:

- what board are you using?
- what eLua image are you using? Is it a standard one or did you
compile it from trunk or other branch?
- can you attach your platform_conf.h if it's different from the SVN version?
- right after you enter the array in Lua can you please run this:

print(collectgarbage'count')

and let me know the result?

Thanks,
Bogdan


> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 12:22
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
> Hi,
>
> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>
>> Hello,
>> can anybody tell me where the HEAP-Size is defined in the elua project?
>
> It is not explicitly defined. It's rather what's left after the
> startup code initialized the .data and .bss sections and the stack is
> initialized (the stack size is defined in
> src/paltform/<platformname>/stacks.h".
>
> Best,
> Bogdan
>
>> View this message in context:
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>> Sent from the eLua Development mailing list archive at Nabble.com.
>> _______________________________________________
>> 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
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>
> To unsubscribe from Heap size, click here.
>
> ________________________________
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> 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


If you reply to this email, your message will be added to the discussion below:

http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976856.html

To unsubscribe from Heap size, click here.

BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Heap size

Hi,

On Mon, Jan 31, 2011 at 5:35 PM, Michael65589 <[hidden email]> wrote:
> Hello Bogdan,
>
>
>
> I fix the „bug”. If you use external SRAM the GPIO configuration will be
> override in the pios_init function (platform.c) There all GPIOs will be set
> to floating input.

Glad to hear it's fixed! :)

> Best regards and thank you for your fast answers.
>
>
>
> Michael
>
>
>
> PS: Did you update this on the server?

I will as soon as you tell me what board you're running eLua on :)

Best,
Bogdan

> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 12:42
>
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
>> Hi Bogdan,
>
>>
>>
>>
>> thank you for the fast answer.
>>
>>
>>
>> Map-file:
>>
>>                 0x20000fd4                end = .
>>
>>                 0x20010000                PROVIDE (_estack, 0x20010000)
>>
>>
>>
>> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE (2048)
>> right?
>
> Yes.
>
>> I have a problem with a realloc. After I start the elua project I enter
>> LUA
>> in the console. After that I write a array like:
>>
>>
>>
>> CRCTABLE =
>>
>> {
>>
>> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>>
>> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>>
>> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>>
>>
>>
>> 512 Byte. After I write the array again a hardfault exception cause.
>>
>>
>>
>> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>>
>>
>>
>> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>>
>> …
>>
>>   nptr = realloc(ptr, nsize);
>>
>>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>>
>>     luaC_fullgc(L); /* emergency full collection. */
>>
>>     nptr = realloc(ptr, nsize); /* try allocation again */
>>
>>   }
>>
>>   return nptr;
>>
>>
>>
>> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back and
>> the next realloc crashes.
>
> It looks like you're running out of memory (I don't know why since it
> seems that you should have enough free memory) and then the EGC
> (Emergency Garbage Collector) runs and the realloc crashes after that.
> Very weird. A few questions:
>
> - what board are you using?
> - what eLua image are you using? Is it a standard one or did you
> compile it from trunk or other branch?
> - can you attach your platform_conf.h if it's different from the SVN
> version?
> - right after you enter the array in Lua can you please run this:
>
> print(collectgarbage'count')
>
> and let me know the result?
>
> Thanks,
> Bogdan
>
>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>> Gesendet: Montag, 31. Januar 2011 12:22
>> An: Stahl, Michael
>> Betreff: Re: Heap size
>>
>>
>>
>> Hi,
>>
>> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>>
>>> Hello,
>>> can anybody tell me where the HEAP-Size is defined in the elua project?
>>
>> It is not explicitly defined. It's rather what's left after the
>> startup code initialized the .data and .bss sections and the stack is
>> initialized (the stack size is defined in
>> src/paltform/<platformname>/stacks.h".
>>
>> Best,
>> Bogdan
>>
>>> View this message in context:
>>>
>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>> _______________________________________________
>>> 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
>>
>> ________________________________
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>>
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>>
>> To unsubscribe from Heap size, click here.
>>
>> ________________________________
>> View this message in context: AW: Heap size
>> Sent from the eLua Development mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976856.html
>
> To unsubscribe from Heap size, click here.
>
> ________________________________
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> 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
Michael65589 Michael65589
Reply | Threaded
Open this post in threaded view
|

AW: Heap size

Oh, right.

 

I use it on the original STM3220E-EVAL Board and on the Keil MCBSTM32E Board.

 

For the Keil Board I only switch to USART2. And very important is to set the CS line of the Display to high-level. Otherwise the Display can damage the bus levels!!

 

Michael

 

 

Von: BogdanM [via eLua Development] [mailto:[hidden email]]
Gesendet: Montag, 31. Januar 2011 16:41
An: Stahl, Michael
Betreff: Re: Heap size

 

Hi,

On Mon, Jan 31, 2011 at 5:35 PM, Michael65589 <[hidden email]> wrote:
> Hello Bogdan,
>
>
>
> I fix the „bug”. If you use external SRAM the GPIO configuration will be
> override in the pios_init function (platform.c) There all GPIOs will be set
> to floating input.

Glad to hear it's fixed! :)

> Best regards and thank you for your fast answers.
>
>
>
> Michael
>
>
>
> PS: Did you update this on the server?

I will as soon as you tell me what board you're running eLua on :)

Best,
Bogdan


> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 12:42
>
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
>> Hi Bogdan,
>
>>
>>
>>
>> thank you for the fast answer.
>>
>>
>>
>> Map-file:
>>
>>                 0x20000fd4                end = .
>>
>>                 0x20010000                PROVIDE (_estack, 0x20010000)
>>
>>
>>
>> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE (2048)
>> right?
>
> Yes.
>
>> I have a problem with a realloc. After I start the elua project I enter
>> LUA
>> in the console. After that I write a array like:
>>
>>
>>
>> CRCTABLE =
>>
>> {
>>
>> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>>
>> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>>
>> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>>
>>
>>
>> 512 Byte. After I write the array again a hardfault exception cause.
>>
>>
>>
>> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>>
>>
>>
>> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>>
>> …
>>
>>   nptr = realloc(ptr, nsize);
>>
>>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>>
>>     luaC_fullgc(L); /* emergency full collection. */
>>
>>     nptr = realloc(ptr, nsize); /* try allocation again */
>>
>>   }
>>
>>   return nptr;
>>
>>
>>
>> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back and
>> the next realloc crashes.
>
> It looks like you're running out of memory (I don't know why since it
> seems that you should have enough free memory) and then the EGC
> (Emergency Garbage Collector) runs and the realloc crashes after that.
> Very weird. A few questions:
>
> - what board are you using?
> - what eLua image are you using? Is it a standard one or did you
> compile it from trunk or other branch?
> - can you attach your platform_conf.h if it's different from the SVN
> version?
> - right after you enter the array in Lua can you please run this:
>
> print(collectgarbage'count')
>
> and let me know the result?
>
> Thanks,
> Bogdan
>
>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>> Gesendet: Montag, 31. Januar 2011 12:22
>> An: Stahl, Michael
>> Betreff: Re: Heap size
>>
>>
>>
>> Hi,
>>
>> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>>
>>> Hello,
>>> can anybody tell me where the HEAP-Size is defined in the elua project?
>>
>> It is not explicitly defined. It's rather what's left after the
>> startup code initialized the .data and .bss sections and the stack is
>> initialized (the stack size is defined in
>> src/paltform/<platformname>/stacks.h".
>>
>> Best,
>> Bogdan
>>
>>> View this message in context:
>>>
>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>> _______________________________________________
>>> 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
>>
>> ________________________________
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>>
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>>
>> To unsubscribe from Heap size, click here.
>>
>> ________________________________
>> View this message in context: AW: Heap size
>> Sent from the eLua Development mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976856.html
>
> To unsubscribe from Heap size, click here.
>
> ________________________________
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> 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


If you reply to this email, your message will be added to the discussion below:

http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977514.html

To unsubscribe from Heap size, click here.

BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Heap size

On Mon, Jan 31, 2011 at 5:53 PM, Michael65589 <[hidden email]> wrote:
> Oh, right.
>
>
>
> I use it on the original STM3220E-EVAL Board and on the Keil MCBSTM32E
> Board.

You probably meant STM3210E-EVAL. In any case you must be using some
code that doesn't exist in our repotisory since AFAIK eLua doesn't
have support for external RAM on STM32. I definitely can't see it on
trunk. If you have that code and can share it please let me know and
I'll add it to the trunk.

Best,
Bogdan

> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 16:41
>
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
> Hi,
>
> On Mon, Jan 31, 2011 at 5:35 PM, Michael65589 <[hidden email]> wrote:
>> Hello Bogdan,
>>
>>
>>
>> I fix the „bug”. If you use external SRAM the GPIO configuration will be
>> override in the pios_init function (platform.c) There all GPIOs will be
>> set
>> to floating input.
>
> Glad to hear it's fixed! :)
>
>> Best regards and thank you for your fast answers.
>>
>>
>>
>> Michael
>>
>>
>>
>> PS: Did you update this on the server?
>
> I will as soon as you tell me what board you're running eLua on :)
>
> Best,
> Bogdan
>
>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>> Gesendet: Montag, 31. Januar 2011 12:42
>>
>> An: Stahl, Michael
>> Betreff: Re: Heap size
>>
>>
>>
>>> Hi Bogdan,
>>
>>>
>>>
>>>
>>> thank you for the fast answer.
>>>
>>>
>>>
>>> Map-file:
>>>
>>>                 0x20000fd4                end = .
>>>
>>>                 0x20010000                PROVIDE (_estack, 0x20010000)
>>>
>>>
>>>
>>> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE (2048)
>>> right?
>>
>> Yes.
>>
>>> I have a problem with a realloc. After I start the elua project I enter
>>> LUA
>>> in the console. After that I write a array like:
>>>
>>>
>>>
>>> CRCTABLE =
>>>
>>> {
>>>
>>> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>>>
>>> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>>>
>>> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>>>
>>>
>>>
>>> 512 Byte. After I write the array again a hardfault exception cause.
>>>
>>>
>>>
>>> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>>>
>>>
>>>
>>> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>>>
>>> …
>>>
>>>   nptr = realloc(ptr, nsize);
>>>
>>>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>>>
>>>     luaC_fullgc(L); /* emergency full collection. */
>>>
>>>     nptr = realloc(ptr, nsize); /* try allocation again */
>>>
>>>   }
>>>
>>>   return nptr;
>>>
>>>
>>>
>>> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back and
>>> the next realloc crashes.
>>
>> It looks like you're running out of memory (I don't know why since it
>> seems that you should have enough free memory) and then the EGC
>> (Emergency Garbage Collector) runs and the realloc crashes after that.
>> Very weird. A few questions:
>>
>> - what board are you using?
>> - what eLua image are you using? Is it a standard one or did you
>> compile it from trunk or other branch?
>> - can you attach your platform_conf.h if it's different from the SVN
>> version?
>> - right after you enter the array in Lua can you please run this:
>>
>> print(collectgarbage'count')
>>
>> and let me know the result?
>>
>> Thanks,
>> Bogdan
>>
>>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>>> Gesendet: Montag, 31. Januar 2011 12:22
>>> An: Stahl, Michael
>>> Betreff: Re: Heap size
>>>
>>>
>>>
>>> Hi,
>>>
>>> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>>>
>>>> Hello,
>>>> can anybody tell me where the HEAP-Size is defined in the elua project?
>>>
>>> It is not explicitly defined. It's rather what's left after the
>>> startup code initialized the .data and .bss sections and the stack is
>>> initialized (the stack size is defined in
>>> src/paltform/<platformname>/stacks.h".
>>>
>>> Best,
>>> Bogdan
>>>
>>>> View this message in context:
>>>>
>>>>
>>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>> _______________________________________________
>>>> 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
>>>
>>> ________________________________
>>>
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>>
>>>
>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>>>
>>> To unsubscribe from Heap size, click here.
>>>
>>> ________________________________
>>> View this message in context: AW: Heap size
>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> 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
>>
>> ________________________________
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>>
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976856.html
>>
>> To unsubscribe from Heap size, click here.
>>
>> ________________________________
>> View this message in context: AW: Heap size
>> Sent from the eLua Development mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977514.html
>
> To unsubscribe from Heap size, click here.
>
> ________________________________
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> 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
Michael65589 Michael65589
Reply | Threaded
Open this post in threaded view
|

AW: Heap size

I put the project for the KEIL  board in the attachment. I hope you can use it. I do some changes because I use KEIL development environment.

 

 

 

Von: BogdanM [via eLua Development] [mailto:[hidden email]]
Gesendet: Montag, 31. Januar 2011 16:58
An: Stahl, Michael
Betreff: Re: Heap size

 

On Mon, Jan 31, 2011 at 5:53 PM, Michael65589 <[hidden email]> wrote:
> Oh, right.
>
>
>
> I use it on the original STM3220E-EVAL Board and on the Keil MCBSTM32E
> Board.

You probably meant STM3210E-EVAL. In any case you must be using some
code that doesn't exist in our repotisory since AFAIK eLua doesn't
have support for external RAM on STM32. I definitely can't see it on
trunk. If you have that code and can share it please let me know and
I'll add it to the trunk.

Best,
Bogdan


> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 16:41
>
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
> Hi,
>
> On Mon, Jan 31, 2011 at 5:35 PM, Michael65589 <[hidden email]> wrote:
>> Hello Bogdan,
>>
>>
>>
>> I fix the „bug”. If you use external SRAM the GPIO configuration will be
>> override in the pios_init function (platform.c) There all GPIOs will be
>> set
>> to floating input.
>
> Glad to hear it's fixed! :)
>
>> Best regards and thank you for your fast answers.
>>
>>
>>
>> Michael
>>
>>
>>
>> PS: Did you update this on the server?
>
> I will as soon as you tell me what board you're running eLua on :)
>
> Best,
> Bogdan
>
>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>> Gesendet: Montag, 31. Januar 2011 12:42
>>
>> An: Stahl, Michael
>> Betreff: Re: Heap size
>>
>>
>>
>>> Hi Bogdan,
>>
>>>
>>>
>>>
>>> thank you for the fast answer.
>>>
>>>
>>>
>>> Map-file:
>>>
>>>                 0x20000fd4                end = .
>>>
>>>                 0x20010000                PROVIDE (_estack, 0x20010000)
>>>
>>>
>>>
>>> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE (2048)
>>> right?
>>
>> Yes.
>>
>>> I have a problem with a realloc. After I start the elua project I enter
>>> LUA
>>> in the console. After that I write a array like:
>>>
>>>
>>>
>>> CRCTABLE =
>>>
>>> {
>>>
>>> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>>>
>>> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>>>
>>> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>>>
>>>
>>>
>>> 512 Byte. After I write the array again a hardfault exception cause.
>>>
>>>
>>>
>>> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>>>
>>>
>>>
>>> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>>>
>>> …
>>>
>>>   nptr = realloc(ptr, nsize);
>>>
>>>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>>>
>>>     luaC_fullgc(L); /* emergency full collection. */
>>>
>>>     nptr = realloc(ptr, nsize); /* try allocation again */
>>>
>>>   }
>>>
>>>   return nptr;
>>>
>>>
>>>
>>> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back and
>>> the next realloc crashes.
>>
>> It looks like you're running out of memory (I don't know why since it
>> seems that you should have enough free memory) and then the EGC
>> (Emergency Garbage Collector) runs and the realloc crashes after that.
>> Very weird. A few questions:
>>
>> - what board are you using?
>> - what eLua image are you using? Is it a standard one or did you
>> compile it from trunk or other branch?
>> - can you attach your platform_conf.h if it's different from the SVN
>> version?
>> - right after you enter the array in Lua can you please run this:
>>
>> print(collectgarbage'count')
>>
>> and let me know the result?
>>
>> Thanks,
>> Bogdan
>>
>>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>>> Gesendet: Montag, 31. Januar 2011 12:22
>>> An: Stahl, Michael
>>> Betreff: Re: Heap size
>>>
>>>
>>>
>>> Hi,
>>>
>>> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>>>
>>>> Hello,
>>>> can anybody tell me where the HEAP-Size is defined in the elua project?
>>>
>>> It is not explicitly defined. It's rather what's left after the
>>> startup code initialized the .data and .bss sections and the stack is
>>> initialized (the stack size is defined in
>>> src/paltform/<platformname>/stacks.h".
>>>
>>> Best,
>>> Bogdan
>>>
>>>> View this message in context:
>>>>
>>>>
>>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>> _______________________________________________
>>>> 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
>>>
>>> ________________________________
>>>
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>>
>>>
>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>>>
>>> To unsubscribe from Heap size, click here.
>>>
>>> ________________________________
>>> View this message in context: AW: Heap size
>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> 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
>>
>> ________________________________
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>>
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976856.html
>>
>> To unsubscribe from Heap size, click here.
>>
>> ________________________________
>> View this message in context: AW: Heap size
>> Sent from the eLua Development mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977514.html
>
> To unsubscribe from Heap size, click here.
>
> ________________________________
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> 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


If you reply to this email, your message will be added to the discussion below:

http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977565.html

To unsubscribe from Heap size, click here.


eLua.zip (8M) Download Attachment
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Heap size

On Mon, Jan 31, 2011 at 6:05 PM, Michael65589 <[hidden email]> wrote:

I put the project for the KEIL  board in the attachment. I hope you can use it. I do some changes because I use KEIL development environment.


Thanks! I never used Keil but I'll take a look at it and maybe I'll be able to find something useful. Good to know BTW, I think this is the first instance of a successful eLua compilation with Keil. Too bad I don't have a medal ready for this, you'd be getting it :)

Best,
Bogdan
 

 

 

 

Von: BogdanM [via eLua Development] [mailto:[hidden email]]
Gesendet: Montag, 31. Januar 2011 16:58


An: Stahl, Michael
Betreff: Re: Heap size

 

On Mon, Jan 31, 2011 at 5:53 PM, Michael65589 <[hidden email]> wrote:
> Oh, right.
>
>
>
> I use it on the original STM3220E-EVAL Board and on the Keil MCBSTM32E
> Board.

You probably meant STM3210E-EVAL. In any case you must be using some
code that doesn't exist in our repotisory since AFAIK eLua doesn't
have support for external RAM on STM32. I definitely can't see it on
trunk. If you have that code and can share it please let me know and
I'll add it to the trunk.

Best,
Bogdan


> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 16:41
>
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
> Hi,
>
> On Mon, Jan 31, 2011 at 5:35 PM, Michael65589 <[hidden email]> wrote:
>> Hello Bogdan,
>>
>>
>>
>> I fix the „bug”. If you use external SRAM the GPIO configuration will be
>> override in the pios_init function (platform.c) There all GPIOs will be
>> set
>> to floating input.
>
> Glad to hear it's fixed! :)
>
>> Best regards and thank you for your fast answers.
>>
>>
>>
>> Michael
>>
>>
>>
>> PS: Did you update this on the server?
>
> I will as soon as you tell me what board you're running eLua on :)
>
> Best,
> Bogdan
>
>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>> Gesendet: Montag, 31. Januar 2011 12:42
>>
>> An: Stahl, Michael
>> Betreff: Re: Heap size
>>

>>
>>
>>> Hi Bogdan,
>>
>>>
>>>
>>>
>>> thank you for the fast answer.
>>>
>>>
>>>
>>> Map-file:
>>>
>>>                 0x20000fd4                end = .
>>>
>>>                 0x20010000                PROVIDE (_estack, 0x20010000)
>>>
>>>
>>>
>>> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE (2048)
>>> right?
>>
>> Yes.
>>
>>> I have a problem with a realloc. After I start the elua project I enter
>>> LUA
>>> in the console. After that I write a array like:
>>>
>>>
>>>
>>> CRCTABLE =
>>>
>>> {
>>>
>>> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>>>
>>> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>>>
>>> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>>>
>>>
>>>
>>> 512 Byte. After I write the array again a hardfault exception cause.
>>>
>>>
>>>
>>> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>>>
>>>
>>>
>>> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>>>
>>> …
>>>
>>>   nptr = realloc(ptr, nsize);
>>>
>>>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>>>
>>>     luaC_fullgc(L); /* emergency full collection. */
>>>
>>>     nptr = realloc(ptr, nsize); /* try allocation again */
>>>
>>>   }
>>>
>>>   return nptr;
>>>
>>>
>>>
>>> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back and
>>> the next realloc crashes.
>>
>> It looks like you're running out of memory (I don't know why since it
>> seems that you should have enough free memory) and then the EGC
>> (Emergency Garbage Collector) runs and the realloc crashes after that.
>> Very weird. A few questions:
>>
>> - what board are you using?
>> - what eLua image are you using? Is it a standard one or did you
>> compile it from trunk or other branch?
>> - can you attach your platform_conf.h if it's different from the SVN
>> version?
>> - right after you enter the array in Lua can you please run this:
>>
>> print(collectgarbage'count')
>>
>> and let me know the result?
>>
>> Thanks,
>> Bogdan
>>
>>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>>> Gesendet: Montag, 31. Januar 2011 12:22
>>> An: Stahl, Michael
>>> Betreff: Re: Heap size
>>>
>>>
>>>
>>> Hi,
>>>
>>> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>>>
>>>> Hello,
>>>> can anybody tell me where the HEAP-Size is defined in the elua project?
>>>
>>> It is not explicitly defined. It's rather what's left after the
>>> startup code initialized the .data and .bss sections and the stack is
>>> initialized (the stack size is defined in
>>> src/paltform/<platformname>/stacks.h".
>>>
>>> Best,
>>> Bogdan
>>>
>>>> View this message in context:
>>>>
>>>>
>>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>> _______________________________________________
>>>> 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
>>>
>>> ________________________________
>>>
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>>
>>>
>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>>>
>>> To unsubscribe from Heap size, click here.
>>>
>>> ________________________________
>>> View this message in context: AW: Heap size
>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> 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
>>
>> ________________________________
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>>
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976856.html
>>
>> To unsubscribe from Heap size, click here.
>>
>> ________________________________
>> View this message in context: AW: Heap size
>> Sent from the eLua Development mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977514.html
>
> To unsubscribe from Heap size, click here.
>
> ________________________________
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>

_______________________________________________

If you reply to this email, your message will be added to the discussion below:

http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977565.html

To unsubscribe from Heap size, click here.


eLua.zip (8M) Download Attachment


View this message in context: AW: Heap size
Sent from the eLua Development mailing list archive at Nabble.com.

_______________________________________________
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
Michael65589 Michael65589
Reply | Threaded
Open this post in threaded view
|

AW: Heap size

Hi Bogdan,

 

the project is not compiled with KEIL. I only use the KEIL IDE uVision and the KEIL ULINK for debugging. I have installed the CodeSourcery Compiler and configure him in the Keil IDE as second party tool. So I can do anything from the KEIL IDE uVision. Compiling (with GNU Compiler), Linking (with GNU Linker) and debugging with KEIL ULINK.

 

Best regards

 

Michael

 

Von: BogdanM [via eLua Development] [mailto:[hidden email]]
Gesendet: Montag, 31. Januar 2011 18:00
An: Stahl, Michael
Betreff: Re: Heap size

 

On Mon, Jan 31, 2011 at 6:05 PM, Michael65589 <[hidden email]> wrote:

I put the project for the KEIL  board in the attachment. I hope you can use it. I do some changes because I use KEIL development environment.

 

Thanks! I never used Keil but I'll take a look at it and maybe I'll be able to find something useful. Good to know BTW, I think this is the first instance of a successful eLua compilation with Keil. Too bad I don't have a medal ready for this, you'd be getting it :)

 

Best,

Bogdan

 

 

 

 

Von: BogdanM [via eLua Development] [mailto:[hidden email]]
Gesendet: Montag, 31. Januar 2011 16:58


An: Stahl, Michael
Betreff: Re: Heap size

 

On Mon, Jan 31, 2011 at 5:53 PM, Michael65589 <[hidden email]> wrote:
> Oh, right.
>
>
>
> I use it on the original STM3220E-EVAL Board and on the Keil MCBSTM32E
> Board.

You probably meant STM3210E-EVAL. In any case you must be using some
code that doesn't exist in our repotisory since AFAIK eLua doesn't
have support for external RAM on STM32. I definitely can't see it on
trunk. If you have that code and can share it please let me know and
I'll add it to the trunk.

Best,
Bogdan


> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 16:41
>
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
> Hi,
>
> On Mon, Jan 31, 2011 at 5:35 PM, Michael65589 <[hidden email]> wrote:
>> Hello Bogdan,
>>
>>
>>
>> I fix the „bug”. If you use external SRAM the GPIO configuration will be
>> override in the pios_init function (platform.c) There all GPIOs will be
>> set
>> to floating input.
>
> Glad to hear it's fixed! :)
>
>> Best regards and thank you for your fast answers.
>>
>>
>>
>> Michael
>>
>>
>>
>> PS: Did you update this on the server?
>
> I will as soon as you tell me what board you're running eLua on :)
>
> Best,
> Bogdan
>
>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>> Gesendet: Montag, 31. Januar 2011 12:42
>>
>> An: Stahl, Michael
>> Betreff: Re: Heap size
>>


>>
>>
>>> Hi Bogdan,
>>
>>>
>>>
>>>
>>> thank you for the fast answer.
>>>
>>>
>>>

>>> Map-file:
>>>
>>>                 0x20000fd4                end = .
>>>
>>>                 0x20010000                PROVIDE (_estack, 0x20010000)
>>>
>>>
>>>
>>> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE (2048)
>>> right?
>>
>> Yes.
>>
>>> I have a problem with a realloc. After I start the elua project I enter
>>> LUA
>>> in the console. After that I write a array like:
>>>
>>>
>>>
>>> CRCTABLE =
>>>
>>> {
>>>
>>> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>>>
>>> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>>>
>>> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>>>
>>>
>>>
>>> 512 Byte. After I write the array again a hardfault exception cause.
>>>
>>>
>>>
>>> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>>>
>>>
>>>
>>> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>>>
>>> …
>>>
>>>   nptr = realloc(ptr, nsize);
>>>
>>>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>>>
>>>     luaC_fullgc(L); /* emergency full collection. */
>>>
>>>     nptr = realloc(ptr, nsize); /* try allocation again */
>>>
>>>   }
>>>
>>>   return nptr;
>>>
>>>
>>>
>>> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back and
>>> the next realloc crashes.
>>
>> It looks like you're running out of memory (I don't know why since it
>> seems that you should have enough free memory) and then the EGC
>> (Emergency Garbage Collector) runs and the realloc crashes after that.
>> Very weird. A few questions:
>>
>> - what board are you using?
>> - what eLua image are you using? Is it a standard one or did you
>> compile it from trunk or other branch?
>> - can you attach your platform_conf.h if it's different from the SVN
>> version?
>> - right after you enter the array in Lua can you please run this:
>>
>> print(collectgarbage'count')
>>
>> and let me know the result?
>>
>> Thanks,
>> Bogdan
>>
>>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>>> Gesendet: Montag, 31. Januar 2011 12:22
>>> An: Stahl, Michael
>>> Betreff: Re: Heap size
>>>
>>>
>>>
>>> Hi,
>>>
>>> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>>>
>>>> Hello,
>>>> can anybody tell me where the HEAP-Size is defined in the elua project?
>>>
>>> It is not explicitly defined. It's rather what's left after the
>>> startup code initialized the .data and .bss sections and the stack is
>>> initialized (the stack size is defined in
>>> src/paltform/<platformname>/stacks.h".
>>>
>>> Best,
>>> Bogdan
>>>
>>>> View this message in context:
>>>>
>>>>
>>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>> _______________________________________________
>>>> 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
>>>
>>> ________________________________
>>>
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>>
>>>
>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>>>
>>> To unsubscribe from Heap size, click here.
>>>
>>> ________________________________
>>> View this message in context: AW: Heap size
>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> 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
>>
>> ________________________________
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>>
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976856.html
>>
>> To unsubscribe from Heap size, click here.
>>
>> ________________________________
>> View this message in context: AW: Heap size
>> Sent from the eLua Development mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977514.html
>
> To unsubscribe from Heap size, click here.
>
> ________________________________
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>

_______________________________________________

If you reply to this email, your message will be added to the discussion below:

http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977565.html


Fehler! Es wurde kein Dateiname angegeben.eLua.zip (8M) Download Attachment

 


View this message in context: AW: Heap size
Sent from the eLua Development mailing list archive at Nabble.com.


_______________________________________________
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


If you reply to this email, your message will be added to the discussion below:

http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977802.html

To unsubscribe from Heap size, click here.

BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Heap size

> Hi Bogdan,
>
>
>
> the project is not compiled with KEIL. I only use the KEIL IDE uVision and
> the KEIL ULINK for debugging. I have installed the CodeSourcery Compiler and
> configure him in the Keil IDE as second party tool. So I can do anything
> from the KEIL IDE uVision. Compiling (with GNU Compiler), Linking (with GNU
> Linker) and debugging with KEIL ULINK.

Ah OK, I understand now. Interesting though. That external RAM
initialization code has to be added by someone or something. So, if
you didn't add it manually, it has to be Keil.

Best,
Bogdan

> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 18:00
>
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
> On Mon, Jan 31, 2011 at 6:05 PM, Michael65589 <[hidden email]> wrote:
>
> I put the project for the KEIL  board in the attachment. I hope you can use
> it. I do some changes because I use KEIL development environment.
>
>
>
> Thanks! I never used Keil but I'll take a look at it and maybe I'll be able
> to find something useful. Good to know BTW, I think this is the first
> instance of a successful eLua compilation with Keil. Too bad I don't have a
> medal ready for this, you'd be getting it :)
>
>
>
> Best,
>
> Bogdan
>
>
>
>
>
>
>
>
>
> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 16:58
>
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
> On Mon, Jan 31, 2011 at 5:53 PM, Michael65589 <[hidden email]> wrote:
>> Oh, right.
>>
>>
>>
>> I use it on the original STM3220E-EVAL Board and on the Keil MCBSTM32E
>> Board.
>
> You probably meant STM3210E-EVAL. In any case you must be using some
> code that doesn't exist in our repotisory since AFAIK eLua doesn't
> have support for external RAM on STM32. I definitely can't see it on
> trunk. If you have that code and can share it please let me know and
> I'll add it to the trunk.
>
> Best,
> Bogdan
>
>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>> Gesendet: Montag, 31. Januar 2011 16:41
>>
>> An: Stahl, Michael
>> Betreff: Re: Heap size
>>
>>
>>
>> Hi,
>>
>> On Mon, Jan 31, 2011 at 5:35 PM, Michael65589 <[hidden email]> wrote:
>>> Hello Bogdan,
>>>
>>>
>>>
>>> I fix the „bug”. If you use external SRAM the GPIO configuration will be
>>> override in the pios_init function (platform.c) There all GPIOs will be
>>> set
>>> to floating input.
>>
>> Glad to hear it's fixed! :)
>>
>>> Best regards and thank you for your fast answers.
>>>
>>>
>>>
>>> Michael
>>>
>>>
>>>
>>> PS: Did you update this on the server?
>>
>> I will as soon as you tell me what board you're running eLua on :)
>>
>> Best,
>> Bogdan
>>
>>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>>> Gesendet: Montag, 31. Januar 2011 12:42
>>>
>>> An: Stahl, Michael
>>> Betreff: Re: Heap size
>>>
>
>>>
>>>
>>>> Hi Bogdan,
>>>
>>>>
>>>>
>>>>
>>>> thank you for the fast answer.
>>>>
>>>>
>>>>
>
>>>> Map-file:
>>>>
>>>>                 0x20000fd4                end = .
>>>>
>>>>                 0x20010000                PROVIDE (_estack, 0x20010000)
>>>>
>>>>
>>>>
>>>> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE
>>>> (2048)
>>>> right?
>>>
>>> Yes.
>>>
>>>> I have a problem with a realloc. After I start the elua project I enter
>>>> LUA
>>>> in the console. After that I write a array like:
>>>>
>>>>
>>>>
>>>> CRCTABLE =
>>>>
>>>> {
>>>>
>>>> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>>>>
>>>> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>>>>
>>>> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>>>>
>>>>
>>>>
>>>> 512 Byte. After I write the array again a hardfault exception cause.
>>>>
>>>>
>>>>
>>>> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>>>>
>>>>
>>>>
>>>> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>>>>
>>>> …
>>>>
>>>>   nptr = realloc(ptr, nsize);
>>>>
>>>>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>>>>
>>>>     luaC_fullgc(L); /* emergency full collection. */
>>>>
>>>>     nptr = realloc(ptr, nsize); /* try allocation again */
>>>>
>>>>   }
>>>>
>>>>   return nptr;
>>>>
>>>>
>>>>
>>>> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back
>>>> and
>>>> the next realloc crashes.
>>>
>>> It looks like you're running out of memory (I don't know why since it
>>> seems that you should have enough free memory) and then the EGC
>>> (Emergency Garbage Collector) runs and the realloc crashes after that.
>>> Very weird. A few questions:
>>>
>>> - what board are you using?
>>> - what eLua image are you using? Is it a standard one or did you
>>> compile it from trunk or other branch?
>>> - can you attach your platform_conf.h if it's different from the SVN
>>> version?
>>> - right after you enter the array in Lua can you please run this:
>>>
>>> print(collectgarbage'count')
>>>
>>> and let me know the result?
>>>
>>> Thanks,
>>> Bogdan
>>>
>>>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>>>> Gesendet: Montag, 31. Januar 2011 12:22
>>>> An: Stahl, Michael
>>>> Betreff: Re: Heap size
>>>>
>>>>
>>>>
>>>> Hi,
>>>>
>>>> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>>>>
>>>>> Hello,
>>>>> can anybody tell me where the HEAP-Size is defined in the elua project?
>>>>
>>>> It is not explicitly defined. It's rather what's left after the
>>>> startup code initialized the .data and .bss sections and the stack is
>>>> initialized (the stack size is defined in
>>>> src/paltform/<platformname>/stacks.h".
>>>>
>>>> Best,
>>>> Bogdan
>>>>
>>>>> View this message in context:
>>>>>
>>>>>
>>>>>
>>>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>>>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>>> _______________________________________________
>>>>> 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
>>>>
>>>> ________________________________
>>>>
>>>> If you reply to this email, your message will be added to the discussion
>>>> below:
>>>>
>>>>
>>>>
>>>>
>>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>>>>
>>>> To unsubscribe from Heap size, click here.
>>>>
>>>> ________________________________
>>>> View this message in context: AW: Heap size
>>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>> ________________________________
>>>
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>>
>>>
>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976856.html
>>>
>>> To unsubscribe from Heap size, click here.
>>>
>>> ________________________________
>>> View this message in context: AW: Heap size
>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> 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
>>
>> ________________________________
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>>
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977514.html
>>
>> To unsubscribe from Heap size, click here.
>>
>> ________________________________
>> View this message in context: AW: Heap size
>> Sent from the eLua Development mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977565.html
>
> Fehler! Es wurde kein Dateiname angegeben.eLua.zip (8M) Download Attachment
>
>
>
> ________________________________
>
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> 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
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977802.html
>
> To unsubscribe from Heap size, click here.
>
> ________________________________
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> 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
Michael65589 Michael65589
Reply | Threaded
Open this post in threaded view
|

AW: Heap size

Yes the external RAM initialisation Code is from the ST firmware library.

 

Von: BogdanM [via eLua Development] [mailto:[hidden email]]
Gesendet: Dienstag, 1. Februar 2011 09:11
An: Stahl, Michael
Betreff: Re: Heap size

 

> Hi Bogdan,
>
>
>
> the project is not compiled with KEIL. I only use the KEIL IDE uVision and
> the KEIL ULINK for debugging. I have installed the CodeSourcery Compiler and
> configure him in the Keil IDE as second party tool. So I can do anything
> from the KEIL IDE uVision. Compiling (with GNU Compiler), Linking (with GNU
> Linker) and debugging with KEIL ULINK.

Ah OK, I understand now. Interesting though. That external RAM
initialization code has to be added by someone or something. So, if
you didn't add it manually, it has to be Keil.

Best,
Bogdan


> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 18:00
>
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
> On Mon, Jan 31, 2011 at 6:05 PM, Michael65589 <[hidden email]> wrote:
>
> I put the project for the KEIL  board in the attachment. I hope you can use
> it. I do some changes because I use KEIL development environment.
>
>
>
> Thanks! I never used Keil but I'll take a look at it and maybe I'll be able
> to find something useful. Good to know BTW, I think this is the first
> instance of a successful eLua compilation with Keil. Too bad I don't have a
> medal ready for this, you'd be getting it :)
>
>
>
> Best,
>
> Bogdan
>
>
>
>
>
>
>
>
>
> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 16:58
>
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
> On Mon, Jan 31, 2011 at 5:53 PM, Michael65589 <[hidden email]> wrote:
>> Oh, right.
>>
>>
>>
>> I use it on the original STM3220E-EVAL Board and on the Keil MCBSTM32E
>> Board.
>
> You probably meant STM3210E-EVAL. In any case you must be using some
> code that doesn't exist in our repotisory since AFAIK eLua doesn't
> have support for external RAM on STM32. I definitely can't see it on
> trunk. If you have that code and can share it please let me know and
> I'll add it to the trunk.
>
> Best,
> Bogdan
>
>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>> Gesendet: Montag, 31. Januar 2011 16:41
>>
>> An: Stahl, Michael
>> Betreff: Re: Heap size
>>
>>
>>
>> Hi,
>>
>> On Mon, Jan 31, 2011 at 5:35 PM, Michael65589 <[hidden email]> wrote:
>>> Hello Bogdan,
>>>
>>>
>>>
>>> I fix the „bug”. If you use external SRAM the GPIO configuration will be
>>> override in the pios_init function (platform.c) There all GPIOs will be
>>> set
>>> to floating input.
>>
>> Glad to hear it's fixed! :)
>>
>>> Best regards and thank you for your fast answers.
>>>
>>>
>>>
>>> Michael
>>>
>>>
>>>
>>> PS: Did you update this on the server?
>>
>> I will as soon as you tell me what board you're running eLua on :)
>>
>> Best,
>> Bogdan
>>
>>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>>> Gesendet: Montag, 31. Januar 2011 12:42
>>>
>>> An: Stahl, Michael
>>> Betreff: Re: Heap size
>>>
>
>>>
>>>
>>>> Hi Bogdan,
>>>
>>>>
>>>>
>>>>
>>>> thank you for the fast answer.
>>>>
>>>>
>>>>
>
>>>> Map-file:
>>>>
>>>>                 0x20000fd4                end = .
>>>>
>>>>                 0x20010000                PROVIDE (_estack, 0x20010000)
>>>>
>>>>
>>>>
>>>> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE
>>>> (2048)
>>>> right?
>>>
>>> Yes.
>>>
>>>> I have a problem with a realloc. After I start the elua project I enter
>>>> LUA
>>>> in the console. After that I write a array like:
>>>>
>>>>
>>>>
>>>> CRCTABLE =
>>>>
>>>> {
>>>>
>>>> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>>>>
>>>> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>>>>
>>>> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>>>>
>>>>
>>>>
>>>> 512 Byte. After I write the array again a hardfault exception cause.
>>>>
>>>>
>>>>
>>>> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>>>>
>>>>
>>>>
>>>> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>>>>
>>>> …
>>>>
>>>>   nptr = realloc(ptr, nsize);
>>>>
>>>>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>>>>
>>>>     luaC_fullgc(L); /* emergency full collection. */
>>>>
>>>>     nptr = realloc(ptr, nsize); /* try allocation again */
>>>>
>>>>   }
>>>>
>>>>   return nptr;
>>>>
>>>>
>>>>
>>>> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back
>>>> and
>>>> the next realloc crashes.
>>>
>>> It looks like you're running out of memory (I don't know why since it
>>> seems that you should have enough free memory) and then the EGC
>>> (Emergency Garbage Collector) runs and the realloc crashes after that.
>>> Very weird. A few questions:
>>>
>>> - what board are you using?
>>> - what eLua image are you using? Is it a standard one or did you
>>> compile it from trunk or other branch?
>>> - can you attach your platform_conf.h if it's different from the SVN
>>> version?
>>> - right after you enter the array in Lua can you please run this:
>>>
>>> print(collectgarbage'count')
>>>
>>> and let me know the result?
>>>
>>> Thanks,
>>> Bogdan
>>>
>>>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>>>> Gesendet: Montag, 31. Januar 2011 12:22
>>>> An: Stahl, Michael
>>>> Betreff: Re: Heap size
>>>>
>>>>
>>>>
>>>> Hi,
>>>>
>>>> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>>>>
>>>>> Hello,
>>>>> can anybody tell me where the HEAP-Size is defined in the elua project?
>>>>
>>>> It is not explicitly defined. It's rather what's left after the
>>>> startup code initialized the .data and .bss sections and the stack is
>>>> initialized (the stack size is defined in
>>>> src/paltform/<platformname>/stacks.h".
>>>>
>>>> Best,
>>>> Bogdan
>>>>
>>>>> View this message in context:
>>>>>
>>>>>
>>>>>
>>>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>>>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>>> _______________________________________________
>>>>> 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
>>>>
>>>> ________________________________
>>>>
>>>> If you reply to this email, your message will be added to the discussion
>>>> below:
>>>>
>>>>
>>>>
>>>>
>>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>>>>
>>>> To unsubscribe from Heap size, click here.
>>>>
>>>> ________________________________
>>>> View this message in context: AW: Heap size
>>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>> ________________________________
>>>
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>>
>>>
>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976856.html
>>>
>>> To unsubscribe from Heap size, click here.
>>>
>>> ________________________________
>>> View this message in context: AW: Heap size
>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> 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
>>
>> ________________________________
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>>
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977514.html
>>
>> To unsubscribe from Heap size, click here.
>>
>> ________________________________
>> View this message in context: AW: Heap size
>> Sent from the eLua Development mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977565.html
>
> Fehler! Es wurde kein Dateiname angegeben.eLua.zip (8M) Download Attachment
>
>
>
> ________________________________
>
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> 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
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977802.html
>
> To unsubscribe from Heap size, click here.
>
> ________________________________
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> 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


If you reply to this email, your message will be added to the discussion below:

http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5980139.html

To unsubscribe from Heap size, click here.

Dado Sutter Dado Sutter
Reply | Threaded
Open this post in threaded view
|

Re: Heap size

In reply to this post by Michael65589


On Tue, Feb 1, 2011 at 03:53, Michael65589 <[hidden email]> wrote:

Hi Bogdan,

 

the project is not compiled with KEIL. I only use the KEIL IDE uVision and the KEIL ULINK for debugging. I have installed the CodeSourcery Compiler and configure him in the Keil IDE as second party tool. So I can do anything from the KEIL IDE uVision. Compiling (with GNU Compiler), Linking (with GNU Linker) and debugging with KEIL ULINK.


Cool.
This deserves a small tutorial on our Wiki (http://wiki.eluaproject.net) one of these days, if we just had a couple of minutes to write one :(

Best regards

 

Michael


Best
Dado


 

 

Von: BogdanM [via eLua Development] [mailto:[hidden email]]
Gesendet: Montag, 31. Januar 2011 18:00


An: Stahl, Michael
Betreff: Re: Heap size

 

On Mon, Jan 31, 2011 at 6:05 PM, Michael65589 <[hidden email]> wrote:

I put the project for the KEIL  board in the attachment. I hope you can use it. I do some changes because I use KEIL development environment.

 

Thanks! I never used Keil but I'll take a look at it and maybe I'll be able to find something useful. Good to know BTW, I think this is the first instance of a successful eLua compilation with Keil. Too bad I don't have a medal ready for this, you'd be getting it :)

 

Best,

Bogdan

 

 

 

 

Von: BogdanM [via eLua Development] [mailto:[hidden email]]
Gesendet: Montag, 31. Januar 2011 16:58


An: Stahl, Michael
Betreff: Re: Heap size

 

On Mon, Jan 31, 2011 at 5:53 PM, Michael65589 <[hidden email]> wrote:
> Oh, right.
>
>
>
> I use it on the original STM3220E-EVAL Board and on the Keil MCBSTM32E
> Board.

You probably meant STM3210E-EVAL. In any case you must be using some
code that doesn't exist in our repotisory since AFAIK eLua doesn't
have support for external RAM on STM32. I definitely can't see it on
trunk. If you have that code and can share it please let me know and
I'll add it to the trunk.

Best,
Bogdan


> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
> Gesendet: Montag, 31. Januar 2011 16:41
>
> An: Stahl, Michael
> Betreff: Re: Heap size
>
>
>
> Hi,
>
> On Mon, Jan 31, 2011 at 5:35 PM, Michael65589 <[hidden email]> wrote:
>> Hello Bogdan,
>>
>>
>>
>> I fix the „bug”. If you use external SRAM the GPIO configuration will be
>> override in the pios_init function (platform.c) There all GPIOs will be
>> set
>> to floating input.
>
> Glad to hear it's fixed! :)
>
>> Best regards and thank you for your fast answers.
>>
>>
>>
>> Michael
>>
>>
>>
>> PS: Did you update this on the server?
>
> I will as soon as you tell me what board you're running eLua on :)
>
> Best,
> Bogdan
>
>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>> Gesendet: Montag, 31. Januar 2011 12:42
>>
>> An: Stahl, Michael
>> Betreff: Re: Heap size
>>


>>
>>
>>> Hi Bogdan,
>>
>>>
>>>
>>>
>>> thank you for the fast answer.
>>>
>>>
>>>

>>> Map-file:
>>>
>>>                 0x20000fd4                end = .
>>>
>>>                 0x20010000                PROVIDE (_estack, 0x20010000)
>>>
>>>
>>>
>>> So my Heap starts at 0x20000fd8 and end at 0x20010000 – STACK_SIZE (2048)
>>> right?
>>
>> Yes.
>>
>>> I have a problem with a realloc. After I start the elua project I enter
>>> LUA
>>> in the console. After that I write a array like:
>>>
>>>
>>>
>>> CRCTABLE =
>>>
>>> {
>>>
>>> [0] = 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
>>>
>>> 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
>>>
>>> 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,…
>>>
>>>
>>>
>>> 512 Byte. After I write the array again a hardfault exception cause.
>>>
>>>
>>>
>>> The realloc pointer is 0x2000b6a0 but the heap_ptr is 0x68004000
>>>
>>>
>>>
>>> static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
>>>
>>> …
>>>
>>>   nptr = realloc(ptr, nsize);
>>>
>>>   if (nptr == NULL && L != NULL && (mode & EGC_ON_ALLOC_FAILURE)) {
>>>
>>>     luaC_fullgc(L); /* emergency full collection. */
>>>
>>>     nptr = realloc(ptr, nsize); /* try allocation again */
>>>
>>>   }
>>>
>>>   return nptr;
>>>
>>>
>>>
>>> The first realloc gives a NULL pointer. Then luaC_fullgc(L) come back and
>>> the next realloc crashes.
>>
>> It looks like you're running out of memory (I don't know why since it
>> seems that you should have enough free memory) and then the EGC
>> (Emergency Garbage Collector) runs and the realloc crashes after that.
>> Very weird. A few questions:
>>
>> - what board are you using?
>> - what eLua image are you using? Is it a standard one or did you
>> compile it from trunk or other branch?
>> - can you attach your platform_conf.h if it's different from the SVN
>> version?
>> - right after you enter the array in Lua can you please run this:
>>
>> print(collectgarbage'count')
>>
>> and let me know the result?
>>
>> Thanks,
>> Bogdan
>>
>>> Von: BogdanM [via eLua Development] [mailto:[hidden email]]
>>> Gesendet: Montag, 31. Januar 2011 12:22
>>> An: Stahl, Michael
>>> Betreff: Re: Heap size
>>>
>>>
>>>
>>> Hi,
>>>
>>> On Mon, Jan 31, 2011 at 11:56 AM, Michael65589 <[hidden email]> wrote:
>>>>
>>>> Hello,
>>>> can anybody tell me where the HEAP-Size is defined in the elua project?
>>>
>>> It is not explicitly defined. It's rather what's left after the
>>> startup code initialized the .data and .bss sections and the stack is
>>> initialized (the stack size is defined in
>>> src/paltform/<platformname>/stacks.h".
>>>
>>> Best,
>>> Bogdan
>>>
>>>> View this message in context:
>>>>
>>>>
>>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976627.html
>>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>> _______________________________________________
>>>> 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
>>>
>>> ________________________________
>>>
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>>
>>>
>>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976808.html
>>>
>>> To unsubscribe from Heap size, click here.
>>>
>>> ________________________________
>>> View this message in context: AW: Heap size
>>> Sent from the eLua Development mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> 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
>>
>> ________________________________
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>>
>> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5976856.html
>>
>> To unsubscribe from Heap size, click here.
>>
>> ________________________________
>> View this message in context: AW: Heap size
>> Sent from the eLua Development mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977514.html
>
> To unsubscribe from Heap size, click here.
>
> ________________________________
> View this message in context: AW: Heap size
> Sent from the eLua Development mailing list archive at Nabble.com.
>
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>

_______________________________________________

If you reply to this email, your message will be added to the discussion below:

http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977565.html


Fehler! Es wurde kein Dateiname angegeben.eLua.zip (8M) Download Attachment

 


View this message in context: AW: Heap size
Sent from the eLua Development mailing list archive at Nabble.com.


_______________________________________________
eLua-dev mailing list



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


If you reply to this email, your message will be added to the discussion below:

http://elua-development.2368040.n2.nabble.com/Heap-size-tp5976627p5977802.html

To unsubscribe from Heap size, click here.



View this message in context: AW: Heap size
Sent from the eLua Development mailing list archive at Nabble.com.

_______________________________________________
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