Integrating SEGGER_SYSVIEW_Conf() & SEGGER_SYSVIEW_Start() for recording the data is causing the program to be stuck

So I am trying to integrate SystemView tool from SEGGER but keep running into an error.

I have the following, and SEGGER_SYSVIEW_Conf(), and SEGGER_SYSVIEW_Start() are causing the program to get stuck into configASSERT( ( portAIRCR_REG & portPRIORITY_GROUP_MASK ) <= ulMaxPRIGROUPValue ); of void vPortEnableVFP( void ) inside port.c.

    /* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);

TaskHandle_t xTaskBlinky = NULL;
TaskHandle_t xTaskBlinky1 = NULL;

 void vTask1_Handler(void *params);
 void vTask2_Handler(void *params);

/**
  * @brief  The application entry point.
  * @retval int
  */
int main(void)
{
  /* MCU Configuration--------------------------------------------------------*/

	DWT->CTRL |= 1;

	/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
	HAL_Init();

	/* Configure the system clock */
	SystemClock_Config();

	SEGGER_SYSVIEW_Conf();
	SEGGER_SYSVIEW_Start();

	xTaskCreate(vTask1_Handler, "Blinky", configMINIMAL_STACK_SIZE, NULL, 2, &xTaskBlinky);
	xTaskCreate(vTask2_Handler, "Blinky1", configMINIMAL_STACK_SIZE, NULL, 2, &xTaskBlinky1);

	vTaskStartScheduler();


	/* Infinite loop */
	while (1);
}

    void vTask1_Handler(void *params)
    {
    	while(1);
    }

    void vTask2_Handler(void *params)
    {
    	while(1);
    }```

That could occur if an interrupt occurs before the scheduler has started because ulMaxPRIGROUPValue is only set as the scheduler starts.

Did you ask Segger about this? I suggest disabling interrupts before starting the systemview stuff - interrupt will get automatically re-enabled when the first task starts executing.

which interrupt though? I don’t have any interrupts enabled from my end. I just initialize tasks and run the scheduler before which I call the SEGGER functions.

I tried this solution but didn’t seem like it worked. Or perhaps i’m not doing the right way:

That post seems to indicate the same thing I was suggesting. If that is the route cause then start ingthe systemview after the scheduler has started would fix the issue. That could be done from Daemon Task startup hook.

So setting configUSE_DAEMON_TASK_STARTUP_HOOK to 1 runs vApplicationDaemonTaskStartupHook() after the scheduler has started? what does initialization code refer to? am I supposed to be calling the segger APIs inside vApplicationDaemonTaskStartupHook()?

Hi! I have implemented configUSE_DAEMON_TASK_STARTUP_HOOK and i am calling SEGGER_SYSVIEW_Start() from it, but still got stuck on configASSERT. Have trided also the solution what is on the linked segger forum, but that does not work for me too. I am on version FreeRtos 10.4 and i am not using CMSIS_v2 as on CMSIS_v2 version you cannot apply the patch from SEGGER. Thank for the advice in advance.

This forum thread may not be relevant for newer versions of SystemView
Are you following the examples, setup, and troubleshooting steps provided by SEGGER? https://wiki.segger.com/FreeRTOS_with_SystemView
The example applications have changed quite a bit and should only require calling traceSTART() before calling any other FreeRTOS functions. None of the hooks in the example application interact with SystemView or the tracing functions.

/*********************************************************************
*
*       main()
*
* Function description
*   Application entry point
*/
int main(void) {
  //
  // Initialize port for LEDs (sample application)
  //
  BSP_Init();
  traceSTART();
  //
  // Create the tasks.
  //
  xTaskCreate(LED0_Task, "LED0_Blink", 128, (void*)NULL, configMAX_PRIORITIES-1, NULL);
  xTaskCreate(LED1_Task, "LED1_Blink", 128, (void*)NULL, configMAX_PRIORITIES-1, NULL);
  //
  // Start the task and timer running.
  //
  vTaskStartScheduler();
  for( ;; );
  return 0;
}