This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Task stack size of RTX kernel

Hi,

I am trying to use the RTC of LPC2378 and the RTX kernel of KEIL.

The below is the code of one of my tasks.

void job3 (void) __task
{
        while(1)
        {
                snprintf(FMTstring, 29, "%04d-%02d-%02d Y%03d-W%01d %02d:%02d:%02d\r",
                        RTC_YEAR, RTC_MONTH, RTC_DOM,
                        RTC_DOY,  RTC_DOW,
                        RTC_HOUR, RTC_MIN, RTC_SEC );

                UART0sbWRITE( (BYTE *)FMTstring, 29 );
                UART0sendKICK();
                os_dly_wait (100);
        }
}

I found that, I need to set the "Task stack size" to 348 bytes, otherwise I will get a stack overflow. Since I do not declare any variable in this task, why it needs so large stack?

Parents
  • for example:

    task1 (ARM, 40 bytes, Stack size 8 bytes, main.o(.text))
    
    [Stack]
    
        * Max Depth = 168
        * Call Chain = task1 â‡' timer_poll â‡' software_warning â‡' debug_message â‡' __c89vsprintf
    
    
    [Calls]
    
        * >>   timer_poll
        * >>   debug_message
    

Reply
  • for example:

    task1 (ARM, 40 bytes, Stack size 8 bytes, main.o(.text))
    
    [Stack]
    
        * Max Depth = 168
        * Call Chain = task1 â‡' timer_poll â‡' software_warning â‡' debug_message â‡' __c89vsprintf
    
    
    [Calls]
    
        * >>   timer_poll
        * >>   debug_message
    

Children