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()?