# STM32F407 Cortex M4 Keil porting

**URL:** <https://forums.freertos.org/t/stm32f407-cortex-m4-keil-porting/3052>\
**Category:** Kernel\
**Created:** [May 9, 2012, 1:29pm UTC](https://forums.freertos.org/t/stm32f407-cortex-m4-keil-porting/3052 "2012-05-09T13:29:13Z")\
**Posts on this page:** 3\
**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:** [May 9, 2012, 1:29pm UTC](https://forums.freertos.org/t/stm32f407-cortex-m4-keil-porting/3052/1 "2012-05-09T13:29:13Z")

</div>

**[pabloxx](https://sourceforge.net/u/pabloxx/)** wrote on [Wednesday, May 09, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/8603fb55/#56e7):

Hello everybody,

Quick question … I have to use FreeRTOS on a Cortex-M4 STM32f407ZG processor and the Keil compiler. Could somebody tell me which startup file .S&nbsp; I have to use for Keil?&nbsp; I checked one of the demos for IAR but it looks tailored for IAR only.  
Thanks for any help in advance,  
Regards,

---

<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:** [May 9, 2012, 1:40pm UTC](https://forums.freertos.org/t/stm32f407-cortex-m4-keil-porting/3052/2 "2012-05-09T13:40:11Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, May 09, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/8603fb55/#c52d):

Create a new project in Keil that targets the hardware you want to use.&nbsp; Then copy the start up files and linker script settings from that.&nbsp; You will have to populate the vector table with the FreeRTOS interrupt handlers, or add the following lines to FreeRTOSConifg.h (if they are not already there).

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

```

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 9, 2012, 2:02pm UTC](https://forums.freertos.org/t/stm32f407-cortex-m4-keil-porting/3052/3 "2012-05-09T14:02:16Z")

</div>

**[pabloxx](https://sourceforge.net/u/pabloxx/)** wrote on [Wednesday, May 09, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/8603fb55/#1bae):

I really appreciate your help. I love this OS but I am missing some details about porting and setting this particular files. Actually I checked the demo CORTEX\_M4F\_STM32F407ZG-SK which is for the exactly the same board I use, but Keil as compiler this time. I will try to set&nbsp; it as you mentioned and get back to you in case I can not make it works.  
For the time being, thanks.
