Saturday, February 24th 2018, 10:54pm 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.

Roman

Beginner

Date of registration: Jan 10th 2017

Posts: 7

1

Thursday, January 12th 2017, 8:30am

Total task run time indicated only partially. (Integration of SystemView into sample project with FreeRTOS 8.2.2 and SEGGER patched FreeRTOS 8.2.3)

Hello Segger Team

I managed to integrate SystemView /RTT into our STM32L476 FreeRTOS (originally 8.2.2) project.

With FreeRTOS 8.2.2
  • the scheduling time was never visible
With FreeRTOS 8.2.3 patched with the SEGGER patch file
  • the scheduling times get shown (traced)
  • the "Run Task" event was traced several times after each other (interrupted with with some queue, task notification events) but without swapping out of the task. It seems to me, that due to that, the total task run time in the graph are shown only partially

  • What does the Segger patch add to FreeRTOS?
  • What is missing / not working when a vanilla FreeRTOS version is used?
  • How can partial task time indication be fixed?
Kind Regards
Roman
Roman has attached the following file:

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 377

2

Thursday, January 12th 2017, 10:21am

Hello Roman,

It seems like you do not record interrupts and therefore it looks like the tasks are switched from one task to another.
xTaskGenericNotifyFromISR should be called in an ISR.

The patch adds the macros to record interrupts as well as task blocking events.

Did you make sure you did all modifications from the patch file?
If you do not use the GCC Cortex-M4 port, you might also have to manually patch it, according to the changes in portable/GCC/ARM_CM4F/port.c and portable/GCC/ARM_CM4F/portmacro.h

Best regards
Johannes

Roman

Beginner

Date of registration: Jan 10th 2017

Posts: 7

3

Thursday, January 12th 2017, 1:21pm

Hello Johannes

No, I am not sure that all the patches were applied. I will verify it.
Thanks for the hint.

Regards

Roman

Roman

Beginner

Date of registration: Jan 10th 2017

Posts: 7

4

Thursday, January 12th 2017, 3:07pm

Hello Johannes

The RVDS port files were not patched, hence the systick interrupt was not visible.
Now that I have the files patched, systick interrupt is shown in the log and graph.
I furthermore added some manual entries into the ISRs which are also nicely logged and shown.

But I still have some points in the log, where the task is reported to run twice without swapping out.



I would expect to miss another event.
Do you have an idea what that could be?

Kind Regards

Roman
Roman has attached the following file:

Roman

Beginner

Date of registration: Jan 10th 2017

Posts: 7

5

Thursday, January 12th 2017, 4:42pm

Hello Johannes

Finally I found the reason for the only partially shown task times.

The code tries to force a task switch but returns to the same task.

C/C++ Source code

1
2
3
4
5
6
    	/* Force a task switch here. */
#if configUSE_TRACE_FACILITY && !defined( USE_PERCIPIO_TRACEALYZER )
    	SEGGER_SYSVIEW_RecordU32( 444, 0x12 );
#endif
    	taskYIELD();
 


Hence as a further improvement of the SystemView tool, I would suggest to
  • show the different partial task execution times when moving the mouse over that section and not only the first
  • add a "task run" marker (what ever that might look like) at that position
Thanks for your support so far.
Despite all my suggestions I am very pleased with the tool.
We will switch to the Segger tracer and augment that with a number of J-Link for continuous logging.


Kind Regards

Roman
Roman has attached the following file: