Tuesday, May 22nd 2018, 1:47pm UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.



Date of registration: Dec 23rd 2015

Posts: 3


Wednesday, December 23rd 2015, 2:55pm

embOS throws system stack overflow error

When StartASM(), embOS throws error and system goes to infinite loop.
I managed to figure out what the error code was - OS_ERR_SYS_STACK defined in OS_Error.c

+OS_ERR_SYS_STACK (125 = 0x7D) *** embOS system stack overflow
What should I check to fix it?

SEGGER - Martin

Super Moderator

Date of registration: Jul 1st 2014

Posts: 35


Wednesday, December 23rd 2015, 5:36pm

Dear kugger,

This error indicates an insufficient size of the system stack. Depending on the IDE in use and the architecture of the target, there are different ways to increase stack size:
With Segger Embedded Studio, for example, the stack size for a Cortex-M target may be configured through the project option "Main stack size". For an ARM7/9/11 target, however, the appropiate option in SES is called "Stack Size (User/System mode)" instead. When using IAR, on the other hand, stack size is configured through the appropiate *.icf-file.
Hence, could you please tell me which target hardware you are using with which IDE?

Best regards,
SEGGER - Support embOS



Date of registration: Dec 23rd 2015

Posts: 3


Thursday, December 24th 2015, 6:34am

Dear Martin
I'm using GCC ARM Compiler, Cortex M4F. Also I used STM32F429ZI_FLASH.ld which I downloaded from SEGGER homepage as a linker option and startup_stm32f4xx.s as a startup. I'm not using any IDE.

My compiler options and ld options are here:

-std=gnu99 -c -Wall, -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -MMD, -fno-delete-null-pointer-checks -fomit-frame-pointer -g -O0 -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp

-specs=rdimon.specs -Wl,--gc-sections -Wl,--wrap,main -Wl,-Map,./basic.map -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -lstdc++ -lsupc++ -lm -lc -lgcc -lrdimon

Should I use any options for "Main stack size"?

Thank you


This post has been edited 2 times, last edit by "kugger" (Dec 24th 2015, 6:38am)



Date of registration: Dec 23rd 2015

Posts: 3


Monday, December 28th 2015, 2:29am

I've changed ld file.


_Min_Heap_Size = 0x400; /* required amount of heap */
_Min_Stack_Size = 0x200; /* required amount of stack */


_Min_Heap_Size = 0x200;; /* required amount of heap */
_Min_Stack_Size = 0x400;; /* required amount of stack */

The program goes Idle and tasks work well.

Thank you.

Similar threads