embOS throws system stack overflow error

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • 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?
  • 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
    Martin
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • 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

    Kugger

    The post was edited 2 times, last by kugger ().

  • 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.