Wednesday, May 23rd 2018, 11:06am 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.

pruesch

Beginner

Date of registration: Jun 11th 2015

Posts: 84

1

Friday, January 15th 2016, 12:10pm

[SOLVED/OR] SystemView causes assertion with FreeRTOS

Hi,

i'm using SystemView 2.26 and FreeRTOS 8.2.1 on an STM32F429.

As soon as I start the SystemViewer application on the host and connect to the target, my system gets stuck in a runtime assertion.
If i disable this assertion, I can use SystemViewer. What is the problem here?

I have attached a screenshot showing the stack trace during the assertion.
pruesch has attached the following image:
  • assert.png

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 379

2

Friday, January 15th 2016, 1:26pm

Hi,

The FreeRTOS interface in SystemView 2.28 fixes this problem.
It was caused by calling pvPortMalloc() from _cbSendTaskList() which could possibly be called within interrupts.

Best regards
Joahnnes

pruesch

Beginner

Date of registration: Jun 11th 2015

Posts: 84

3

Friday, January 15th 2016, 1:39pm

thanks,
did not notice there was a update.

do you have a public git server? what about email notification?

could you comment a bit on the FreeRTOS patch you supply?
is it mandatory ?

This post has been edited 1 times, last edit by "pruesch" (Jan 15th 2016, 1:53pm)


pruesch

Beginner

Date of registration: Jun 11th 2015

Posts: 84

4

Friday, January 15th 2016, 2:26pm

Sorry, i'm still getting the assertion with FreeRTOS 8.2.1 :(

Do I have to be on FreeRTOS 8.2.3 ?

Best Regards

pruesch

Beginner

Date of registration: Jun 11th 2015

Posts: 84

5

Friday, January 15th 2016, 4:34pm

i have upgraded to FreeRTOS v8.2.3 now and have applied the patch you shipped with SystemView 2.28.

Still getting this assertion...

here is a recent stack trace
pruesch has attached the following image:
  • assert2.png

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 379

6

Tuesday, January 26th 2016, 5:57pm

Thank you for providing the call stack.


The problem is, when SystemViewer is started it requests the tasklist.
The request is handled by the next SystemView event, which is in most cases the SysTick event.

Unfortunately it looks like uxTaskGetSystemState() cannot be called from within an ISR,
since it calls taskENTER_CRITICAL internally, which asserts if it is called from within an ISR.

Currently the only workaround is to not stop in configASSERT or to remove the assertion from vPortEnterCritical.

We will work on a better solution to prevent the assertion, which will be part of the next version of SystemView.

Best regards
Johannes

pruesch

Beginner

Date of registration: Jun 11th 2015

Posts: 84

7

Thursday, January 28th 2016, 11:32am

Thank you, Johannes for answering my question and looking into it :)
I very much appreciate it!
I commented out the assertion to fix my hang ;)


do you plan to also plan to provide a FreeRTOS patch for Cortex-M3 parts? Currently, I can only find one for M4F.

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 379

8

Friday, January 29th 2016, 3:45pm

Hi,

SystemView V2.30 includes a changed FreeRTOS interface for SystemView,
which does not cause the assertion.

We will probably add the changes for other ports, too. Currently this has to be done manually.

With the GCC CM4F port as a reference it shouldn't be a big deal.

In general it is:
Add traceISR_ENTER(); at the beginning of xPortSysTickHandler
Add traceISR_EXIT_TO_SCHEDULER(); when xPortSysTickHandler causes a context switch
Add traceISR_EXIT(); when xPortSysTickHandler returns to normal execution

Do the same for the portEND_SWITCHING_ISR macro.

Best regards
Johannes