CSTACK filled error

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

  • CSTACK filled error

    Hi, I'm new to embOS and I've been trying to build the example for an M16C processor in the IAR EW. I have not changed the example code at all yet and it is going to OS_ERROR with the stack error code when I try to run. Now, I'm not downloading to a board, I'm just trying to use the simulator with this at first. In the build window I see the following messages immediately after OS_InitKern() is executed:



    Wed Jul 21 13:47:17 2010: The stack 'CSTACK' is filled to 100% (256 bytes used out of 256). The warning threshold is set to 90.%
    Wed Jul 21 13:47:17 2010: The stack 'ISTACK' is filled to 100% (128 bytes used out of 128 ). The warning threshold is set to 90.%


    I've tried setting the values in the lnkM16C.xcl linker file, and I've also tried adjusting the Stack Size and Interrupt stack size in Project->Options->General Options-> Stack/Heap. They are set right now at 256 and 128. I've tried changing those to 512 with the same results.
  • Hello,

    I just tested it and embOS M16C IAR runs without any problem in IAR CSpy Simulator.
    1. Which IAR version do you use?
    2. Which embOS version and which start project do you use?

    Regards,
    Til
    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.
  • Thanks for replying.

    I am using IAR EW 5.4. According to my documentation I have software version 3.28. I'll just go ahead and copy the code from the main.c file onto this page as it is very short and would probably be easier to determine which project it is than to describe it. I believe the problem is with the configuration/setup of my simulator, but I'm not sure which changes to make.

    C Source Code

    1. /**********************************************************
    2. * SEGGER MICROCONTROLLER SYSTEME GmbH
    3. * Solutions for real time microcontroller applications
    4. ***********************************************************
    5. File : Main.c
    6. Purpose : Skeleton program for embOS
    7. --------- END-OF-HEADER ---------------------------------*/
    8. #include "RTOS.H"
    9. OS_STACKPTR int Stack0[128], Stack1[128]; /* Task stacks */
    10. OS_TASK TCB0, TCB1; /* Task-control-blocks */
    11. void Task0(void) {
    12. while (1) {
    13. OS_Delay (10);
    14. }
    15. }
    16. void Task1(void) {
    17. while (1) {
    18. OS_Delay (50);
    19. }
    20. }
    21. /**********************************************************
    22. *
    23. * main
    24. *
    25. **********************************************************/
    26. int main(void) {
    27. OS_IncDI(); /* Initially disable interrupts */
    28. OS_InitKern(); /* initialize OS */
    29. OS_InitHW(); /* initialize Hardware for OS */
    30. /* You need to create at least one task here ! */
    31. OS_CREATETASK(&TCB0, "HP Task", Task0, 100, Stack0);
    32. OS_CREATETASK(&TCB1, "LP Task", Task1, 50, Stack1);
    33. OS_Start(); /* Start multitasking */
    34. return 0;
    35. }
    Display All
  • here is a link to an appnote that IAR issued in September: appnote. I am still having some trouble however where the tasks are not being executed. Once OS_Start is executed, OS_Error is entered with an error code of 120. If I just run from main instead of single-stepping, the system information reports that both tasks are Init/Idle, and the OS_Status is unknown. What am I doing wrong?
  • Hello,
    I am afraid, you can not use the embOS version 3.28 with your current IAR compiler.
    IAR modified the calling convention with IAR compiler 3.21A.
    The parameter passing was changed and OS_CreateTask() fails, because it gets wrong parameter.
    Unfortunately, IAR did not add a precaution which inhibts older libraries compiled with previous calling convention from being linked.
    The embOS version 3.28 can be used with IAR compiler 3.20A or an older version.
    Newer versions of the IAR compiler require at least an embOS version 3.32m which was released in April 2007.