# task scheduling stm32-p107

**URL:** <https://forums.freertos.org/t/task-scheduling-stm32-p107/2517>\
**Category:** Kernel\
**Created:** [January 10, 2012, 11:27am UTC](https://forums.freertos.org/t/task-scheduling-stm32-p107/2517 "2012-01-10T11:27:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 10, 2012, 11:27am UTC](https://forums.freertos.org/t/task-scheduling-stm32-p107/2517/1 "2012-01-10T11:27:22Z")

</div>

**anonymous** wrote on [Tuesday, January 10, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/6fd6ccf8/#4e1f):

Hi all,

I am having some problems getting the task scheduling to work, I create a simple task to enable some LED’s and then loop forever, this is added to the task list and the scheduler is started. Stepping through the vTaskStartScheduler function, everything seems to be fine, then getting to the vPortStartFirstTask function, I cannot step through and the first task never seems to run. Has anyone else encountered this problem? Or have any idea’s what might cause this?

Thanks for any help

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 10, 2012, 11:44am UTC](https://forums.freertos.org/t/task-scheduling-stm32-p107/2517/2 "2012-01-10T11:44:18Z")

</div>

**[davedoors](https://sourceforge.net/u/davedoors/)** wrote on [Tuesday, January 10, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/6fd6ccf8/#02c6):

Have you installed the interrupt service routines needed by FreeRTOS? The scheduler is started with an SVC call, and you need systick and pendsv too. If you project is using cmsis naming then you can do this by adding the following lines to FreeRTOSConfig.h

#define xPortPendSVHandler PendSV\_Handler  
#define xPortSysTickHandler SysTick\_Handler  
#define vPortSVCHandler SVC\_Handler

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 10, 2012, 1:54pm UTC](https://forums.freertos.org/t/task-scheduling-stm32-p107/2517/3 "2012-01-10T13:54:15Z")

</div>

**anonymous** wrote on [Tuesday, January 10, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/6fd6ccf8/#4320):

Thanks for the quick reply.

I am using an existing demo (stm32f107, for a new board), I think I have installed the interrupt service routines, those 3 functions are all in the port.c file. Is there a way to check if they have been installed? When porting to a new board, does the NVIC code need to be updated?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 14, 2012, 12:24pm UTC](https://forums.freertos.org/t/task-scheduling-stm32-p107/2517/4 "2012-01-14T12:24:40Z")

</div>

**anonymous** wrote on [Saturday, January 14, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/6fd6ccf8/#4927):

Debugging the code, the first task is not run because the NMI interrupt occurs, I’m not sure if it is a true NMI exception, as seems to just use the first interrupt handler it see’s in the vector table. Having trouble figuring out why this occurs though, if anyone has any ideas?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 17, 2012, 3:44pm UTC](https://forums.freertos.org/t/task-scheduling-stm32-p107/2517/5 "2012-01-17T15:44:55Z")

</div>

**anonymous** wrote on [Tuesday, January 17, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/6fd6ccf8/#68ee):

In case anyone else stumbles upon the same problem, I fixed it by replacing

#ifdef STARTUP\_FROM\_RESET  
&nbsp; .word reset\_handler  
#else  
&nbsp; .word reset\_wait  
#endif /\* STARTUP\_FROM\_RESET \*/

with

&nbsp; .word reset\_handler

---

<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:** [January 17, 2012, 3:50pm UTC](https://forums.freertos.org/t/task-scheduling-stm32-p107/2517/6 "2012-01-17T15:50:34Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, January 17, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/6fd6ccf8/#07e6):

You shouldn’t change the code - it is like that for a reason.&nbsp; You are meant to have STARTUP\_FROM\_RESET defined in your project options for your release build, but not your debug build.

[http://rowley.zendesk.com/entries/50337-application-not-starting-up-from-reset](http://rowley.zendesk.com/entries/50337-application-not-starting-up-from-reset)

Regards.
