Saturday, November 25th 2017, 10:36am UTC+1

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.

rols

Beginner

Date of registration: Jan 15th 2014

Posts: 43

1

Thursday, May 26th 2016, 4:07am

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

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 363

2

Wednesday, June 1st 2016, 5:52pm

Hi,

The definition of task states is RTOS specific.
With the latest version of SystemView (V2.36a) these definition is part of the description file.
Have a look there and in your RTOS sources.

Regards
Johannes

rols

Beginner

Date of registration: Jan 15th 2014

Posts: 43

3

Thursday, June 2nd 2016, 2:33am

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?

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 363

4

Thursday, June 2nd 2016, 4:01pm

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