How can I start rtos programming for stm32f217xx controller.
Hi ,
I want configure the UART and GPIO peripherals using RTOS(RTx) .
here I am using keil5 u version .And STM32F217xx controller (custom board )
Already I was done configuration for gpio.
/*----------------------------------------------------------------------------
* CMSIS-RTOS 'main' function template
*---------------------------------------------------------------------------*/
#include "RTE_Components.h"
#include CMSIS_device_header
#include "cmsis_os2.h"
void gpio_Initfun(void);
/*
* led initialization.
*
*/
void gpio_Initfun(void)
{
GPIOF->MODER |=0x00000005;
GPIOF->OTYPER |=0x00000000;
GPIOF->OSPEEDR |=0x00000005;
GPIOF->PUPDR |=0x00000005;
GPIOF->ODR |=0x000000000;
}
/*----------------------------------------------------------------------------
* Application functions thread
*---------------------------------------------------------------------------*/
__NO_RETURN static void ledTwo (void *argument) {
(void)argument;
while(1)
{
osDelay(500);
GPIOF->ODR &= ~(unsigned int)(0x0000001);
osDelay(500);
GPIOF->ODR |= 0x0000001;
}
}
__NO_RETURN static void ledOne (void *argument) {
(void)argument;
while(1)
{
osDelay(500);
GPIOF->ODR &= ~(unsigned int)(0x0000002);
osDelay(500);
GPIOF->ODR |= 0x0000002;
}
}
int main (void) {
SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOFEN);
SystemCoreClockUpdate();
osKernelInitialize();
gpio_Initfun();
osThreadNew(ledTwo, NULL, NULL);
osThreadNew(ledOne, NULL, NULL);
osKernelStart();
while(1);
}the above code is working.
Instead of using the SFR programming I want to use predefined librariesf or programming the my controller.
Please some one guide me how to use STM32 predefined libraries in RTOS programming.
thanks in advance.
