region RAM overflowed with stack

Asked by ilovefpv

Added some new code to my routine and got:

C:\project\ezarm>arm-none-eabi-gcc c:\project\ezarm\src\thermometer.c c:\project
\ezarm\lib\startup\startup_ARMCM0.S -mthumb -mcpu=cortex-m0 -D__STARTUP_CLEAR_BS
S -D__START=main -Os -ffunction-sections -fdata-sections -g --specs=nano.specs -
lc -lc -lnosys -Ic:\project\ezarm\lib -Lc:\project\ezarm\lib\ldscripts -T c:\pro
ject\ezarm\lib\gcc.ld -Wl,--gc-sections -Wl,-Map=c:\project\ezarm\out\thermomete
r.map -g -o c:\project\ezarm\out\thermometer-CM0.axf
c:/program files (x86)/gnu tools arm embedded/4.7 2013q2/bin/../lib/gcc/arm-none
-eabi/4.7.4/../../../../arm-none-eabi/bin/ld.exe: region RAM overflowed with stack
collect2.exe: error: ld returned 1 exit status

I didn't think I was that full yet... What can I do to fix this?

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
chengbin (can-finner) said :
#1

You can either check whether there are unnecessary global data and remove them, or adapt the RAM section a little bit larger to provide room for your data.

Revision history for this message
ilovefpv (ilovefpv) said :
#2

The stack was set to 0xc00, but I've only got 4K of memory..

What is a reasonable stack to use with newlib-nano?

Revision history for this message
chengbin (can-finner) said :
#3

I don't have exact number for your question. Yet if your program doesn't have floating point io, I would expect 512bytes~1024bytes with newlib-nano. But the stack consumption depends on your application, you should do some experiments to get an accurate number for your application.

One question is:
By setting stack to 0xc00, do you mean that you reserve 1K bytes for stack?

Thanks.

Revision history for this message
ilovefpv (ilovefpv) said :
#4

0xc00 is what was in the startup_ARMCM0.S which was delivered with your tools...

Isn't that 3K?

Revision history for this message
chengbin (can-finner) said :
#5

Sorry that I barely touched startup_ARMCM0.S before, but the previous words still stand, you can do some experiments to get a reasonable size for stack.

Thanks.

Revision history for this message
ilovefpv (ilovefpv) said :
#6

Can you review this with the developer?

How much stack is needed if I enable float?

Revision history for this message
chengbin (can-finner) said :
#7

Definitely larger than 512 bytes, but 1024bytes might work. Again I haven't verified this, you have to verify it with your application.

Thanks.

Revision history for this message
Joey Ye (jinyun-ye) said :
#8

Hi,

It appear to me that you reserved too big stack. The startup code by
default reserves 3k for most of user. But that need to be set correct for
you own board. Please try -D__STACK_SIZE=0X800 or even smaller. Printf of
nano need only about 2k RAM

THANKS
Joey
On Jul 18, 2013 10:38 AM, "ilovefpv" <email address hidden>
wrote:

> New question #232629 on GCC ARM Embedded:
> https://answers.launchpad.net/gcc-arm-embedded/+question/232629
>
> Added some new code to my routine and got:
>
> C:\project\ezarm>arm-none-eabi-gcc c:\project\ezarm\src\thermometer.c
> c:\project
> \ezarm\lib\startup\startup_ARMCM0.S -mthumb -mcpu=cortex-m0
> -D__STARTUP_CLEAR_BS
> S -D__START=main -Os -ffunction-sections -fdata-sections -g
> --specs=nano.specs -
> lc -lc -lnosys -Ic:\project\ezarm\lib -Lc:\project\ezarm\lib\ldscripts -T
> c:\pro
> ject\ezarm\lib\gcc.ld -Wl,--gc-sections
> -Wl,-Map=c:\project\ezarm\out\thermomete
> r.map -g -o c:\project\ezarm\out\thermometer-CM0.axf
> c:/program files (x86)/gnu tools arm embedded/4.7
> 2013q2/bin/../lib/gcc/arm-none
> -eabi/4.7.4/../../../../arm-none-eabi/bin/ld.exe: region RAM overflowed
> with stack
> collect2.exe: error: ld returned 1 exit status
>
> I didn't think I was that full yet... What can I do to fix this?
>
> --
> You received this question notification because you are an answer
> contact for GCC ARM Embedded.
>

Can you help with this problem?

Provide an answer of your own, or ask ilovefpv for more information if necessary.

To post a message you must log in.