# Hard Fault encountered after vTaskStartScheduler is invoked

**URL:** <https://forums.freertos.org/t/hard-fault-encountered-after-vtaskstartscheduler-is-invoked/17476>\
**Category:** Kernel\
**Tags:** debug\
**Created:** [May 23, 2023, 6:03pm UTC](https://forums.freertos.org/t/hard-fault-encountered-after-vtaskstartscheduler-is-invoked/17476 "2023-05-23T18:03:58Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jefftenney](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/jefftenney/32/1314_2.png) [@jefftenney](https://forums.freertos.org/u/jefftenney)\
**Post date:** [May 23, 2023, 9:07pm UTC](https://forums.freertos.org/t/hard-fault-encountered-after-vtaskstartscheduler-is-invoked/17476/4 "2023-05-23T21:07:49Z")

</div>

OK, a few additional suggestions:

- Be sure configASSERT() is defined, and be sure you have a `vApplicationMallocFailedHook()` installed to catch out-of-memory and/or heap configuration errors.

- Check the priority of the SVC exception. See [here](https://forums.freertos.org/t/xportstartscheduler-fails-because-basepri-is-non-zero/15509).

- Does your FreeRTOSConfig.h have these lines:

```auto
#define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler
#define xPortSysTickHandler SysTick_Handler

```

- If all of that fails, can you step through the code and isolate the statement that is causing the hard fault? Note that you will need to put a breakpoint at the beginning of the vPortSVCHandler() to step into that function.

---

_[View the full topic](https://forums.freertos.org/t/hard-fault-encountered-after-vtaskstartscheduler-is-invoked/17476)._
