# Integrating SEGGER\_SYSVIEW\_Conf() & SEGGER\_SYSVIEW\_Start() for recording the data is causing the program to be stuck

**URL:** <https://forums.freertos.org/t/integrating-segger-sysview-conf-segger-sysview-start-for-recording-the-data-is-causing-the-program-to-be-stuck/10354>\
**Category:** Libraries\
**Created:** [July 25, 2020, 4:59pm UTC](https://forums.freertos.org/t/integrating-segger-sysview-conf-segger-sysview-start-for-recording-the-data-is-causing-the-program-to-be-stuck/10354 "2020-07-25T16:59:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MasterSil](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@MasterSil](https://forums.freertos.org/u/MasterSil)\
**Post date:** [July 25, 2020, 4:59pm UTC](https://forums.freertos.org/t/integrating-segger-sysview-conf-segger-sysview-start-for-recording-the-data-is-causing-the-program-to-be-stuck/10354/1 "2020-07-25T16:59:48Z")

</div>

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`.

````auto
    /* 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);
    }```
````

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 26, 2020, 4:24am UTC](https://forums.freertos.org/t/integrating-segger-sysview-conf-segger-sysview-start-for-recording-the-data-is-causing-the-program-to-be-stuck/10354/2 "2020-07-26T04:24:55Z")

</div>

> [@MasterSil](#):
>
> configASSERT( ( portAIRCR\_REG & portPRIORITY\_GROUP\_MASK ) \<= ulMaxPRIGROUPValue );

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.

---

<div class="post-metadata">

**Author:** ![MasterSil](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@MasterSil](https://forums.freertos.org/u/MasterSil)\
**Post date:** [July 27, 2020, 3:27am UTC](https://forums.freertos.org/t/integrating-segger-sysview-conf-segger-sysview-start-for-recording-the-data-is-causing-the-program-to-be-stuck/10354/3 "2020-07-27T03:27:17Z")

</div>

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:

> **[\[SOLVED\] Systemview stuck in configASSERT with FreeRTOS + STM32CubeMX - SEGGER...](https://forum.segger.com/index.php/Thread/6046-SOLVED-Systemview-stuck-in-configASSERT-with-FreeRTOS-STM32CubeMX/)**
>
> Hello,
> 
> I'm trying to use the Systemview with the FreeRTOS 9.0 in the project created by STM32CubeMx, but the program always stuck in the configASSERT, line 764 in the file port.c (line 18 below). I think the problem occurred because of the level of…

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 27, 2020, 4:18am UTC](https://forums.freertos.org/t/integrating-segger-sysview-conf-segger-sysview-start-for-recording-the-data-is-causing-the-program-to-be-stuck/10354/4 "2020-07-27T04:18:47Z")

</div>

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.](https://www.freertos.org/a00016.html)

---

<div class="post-metadata">

**Author:** ![MasterSil](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@MasterSil](https://forums.freertos.org/u/MasterSil)\
**Post date:** [July 27, 2020, 5:41pm UTC](https://forums.freertos.org/t/integrating-segger-sysview-conf-segger-sysview-start-for-recording-the-data-is-causing-the-program-to-be-stuck/10354/5 "2020-07-27T17:41:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![higbo](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/higbo/32/3947_2.png) [@higbo](https://forums.freertos.org/u/higbo)\
**Post date:** [November 11, 2023, 10:40pm UTC](https://forums.freertos.org/t/integrating-segger-sysview-conf-segger-sysview-start-for-recording-the-data-is-causing-the-program-to-be-stuck/10354/6 "2023-11-11T22:40:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cookpate](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/cookpate/32/2962_2.png) [@cookpate](https://forums.freertos.org/u/cookpate)\
**Post date:** [November 13, 2023, 7:44pm UTC](https://forums.freertos.org/t/integrating-segger-sysview-conf-segger-sysview-start-for-recording-the-data-is-causing-the-program-to-be-stuck/10354/7 "2023-11-13T19:44:38Z")

</div>

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](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.

```c
/ *********************************************************************
*
* 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;
}

```
