OnTaskStopReady causes

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

  • OnTaskStopReady causes

    The 'cause' flag in OnTaskStopReady() isn't defined anywhere I can see, however it must have a meaning as SystemView decodes the reason and adds it to the Task Block lines in the viewer. It's possible to guess at a few, eg

    0x0C == Wait for event with timeout
    0x04 == Wait for timeout

    those are out of one of the sample traces. So 0x04 looks like the 'timeout' flag and 0x08 the 'event' flag.

    There must be more however, the FreeRTOS port for instance sends ((3u << 3 )|3) == 0x1B for tasks being suspended which shows up as 'waiting, suspended'

    Is there a proper definition of the flags in this field please
  • That was good timing - I see those in the most recent version from a few days ago, just what I needed. I also see you've introduced NamedType in the description file, that's really helpful too, I was just writing code to map dozens of OS-specific values to identifiers and use the %I flag to display them, which was huge code bloat on the target and a waste of bandwidth; now I don't have to do that.

    The manual lists the modifiers %b, %d, %D, %I, %p, %t and %u, however I needed to display a string, used %s as a 'standard' kind of printf specifier without really thinking about it and found it appears to work. Is that correct or did I just get lucky? Is there a way to specify a parameter should be printed out as a string?
  • Hi,

    Yes, the named types should help saving bandwidth and to not inflate the OS code.

    Current modifiers are:
    %b - format as binary,
    %B - format as byte string (e.g. 00 aa ff ...)
    %d - format as decimal
    %D - format as time delta (e.g. 12.090 ms)
    %I - format as named resource
    %p - format as 4-byte hexadecimal (e.g. 0xAABBCCDD)
    %s - format as string
    %t - format as task name
    %u - format as unsigned decimal
    %x - format as hexadecomal

    We will update the manual accordingly. Thanks for noticing.

    Regards
    Johannes