Wednesday, April 25th 2018, 4:53am UTC+2

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.



Date of registration: May 17th 2017

Posts: 1


Friday, May 19th 2017, 1:43am

SystemView and freeRTOS


We are attempting to use SystemView V2.5 with freeRTOS V9 CM3 port. The current plan is to use both real time record mode, and postmortem mode.

This is the first I have ever worked with this tool and I am very impressed thus far, but after some initial testing I have a few questions.

It looks like when running in postmortem mode the SystemView library maintains an array containing task information and status. However, it appears that the list is not being updated whenever a task is deleted. I am then seeing that this eventually leads to a hard fault when _cbSendTaskList calls uxTaskGetStackHighWaterMark with an invalid task handle. Is this the case, or have I missed something? Our application frequently deletes tasks and it looks like the library could be easily modified to handle this, but I wanted to make sure that I'm headed down the right road before putting in the effort.

Also, when I import postmortem data, I usually have all zeros for the timestamps. Occasionally all of the timestamps show up so I am assuming that something is being corrupted, but I'm not sure where to start looking.

B. Gerold

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 377


Wednesday, June 21st 2017, 3:59pm


Thanks for the positive feedback.

You are right, in the SystemView FreeRTOS interface task information is only added or updated, but not removed.
We will add this to the interface. find attached a preliminary version. Does this work for you?

Regarding timestamps, the only reason why timestamps could be 0 is, when the timestamp configuration is not part of the recording.
In the SystemView configuration make sure that SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT fits with your SystemView buffer size.
Try increasing your buffer size or decreasing SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT.
If this does not help, could you send a recording with corrupted timestamps?

SEGGER - Johannes has attached the following files:

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 377


Thursday, June 22nd 2017, 11:47am


Regarding the 0 timestamps:

This can happen when the DWT unit is not enabled.
On Cortex-M3/4 the timestamp is generated from the DWT->CYCCNT, so the cycle counter needs to be enabled and to do this the DWT needs to be enabled as well.
This is usually done by the debugger, but can also be done by the application.

if ((CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk) == 0) {
CoreDebug->DEMCR |= 1 << CoreDebug_DEMCR_TRCENA_Pos; // Enable DWT in DEMCR if not done, yet.

When there has been a debug session running or you connected with J-Link before, and read the data without a reset,
then the CYCCNT might have still been enabled and the application generated real timestamps.

If you do not want to use the CYCCNT, you can of course configure SystemView for any other timestamp source, i.e. the SysTick, too.