May 15, 2015

FreeRTOS and ARM Setup

To start working with FreeRTOS first you need replace some of the ARM processor startup 'registers', by the FreeRTOS ones. But this process is not like install a new library, plugin nor compile something, it's just different! and that's why many developers give up! Here you can see how to configure the FreeRTOS aiming run on ARM Cortex-M3 using the Keil uVision IDE.

Every new project you need the startup files that configures the ARM device before it can do something for you. These startup files are provided by the "Manage Run-Time Environment" option:

 

Checking "Startup":


That will add these files in your project:

Now let's replace the ARM 'registers' by the freeRTOS ones. Edit the "startup_stm32f10x_md.s" file and at this point:

Add "IMPORT xPortPendSVHandler", "IMPORT xPortSysTickHandler" and "IMPORT vPortSVCHandler": 


Go down and replace "SVC_Handler" :


By "vPortSVCHandler"


And below replace "PendSV_Handler" and " SysTick_Handler":

by "xPortPendSVHandler" and "xPortSysTickHandler":


That's it! now let's blink a GPIO pin and see if works!

About the versions:
  • FreeRTOS 8.1.2
  • Keil uVision 5.11.1.0
  • STM ARM Cortex-M3 STM32F103C8T6

0 comentários :

Post a Comment