Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

MikroC + STM32F4Discovery + FreeRTOS

Posted by aussa on February 28, 2013
Hi, I'm trying to port to MikroC this --> http://fbconsult.dk/DiscoveryF4_RTOS.zip example of FreeRTOS on STM32F4Discovery with CrossWorks compiler.
I tried the example on TrueStudio and it worked.

This was the result of modifying the main file to MikroC


#include "stm32f4xx.h"
#include "FreeRTOS.h"
#include "task.h"
#include
#include
#include

static void TaskA(void *pvParameters)
{
int A=0;

pvParameters = pvParameters;
for(;;)
{
A++;
GPIOD_ODR = 0x00002000;
vTaskDelay(500);
GPIOD_ODR = 0x00000000;
vTaskDelay(500);
}
}

static void TaskB(void *pvParameters)
{
int A=0;

pvParameters = pvParameters;
for(;;)
{
A++;
GPIOD_ODR = 0x00001000;
vTaskDelay(200);
GPIOD_ODR = 0x00000000;
vTaskDelay(200);
}
}

static void TaskC(void *pvParameters)
{
int A=0;

pvParameters = pvParameters;
for(;;)
{
A++;
GPIOD_ODR = 0x00004000;
vTaskDelay(700);
GPIOD_ODR = 0x00000000;
vTaskDelay(700);
}
}

static void TaskD(void *pvParameters)
{
int A=0;

pvParameters = pvParameters;
for(;;)
{
A++;
GPIOD_ODR = 0x00008000;
vTaskDelay(1000);
GPIOD_ODR = 0x00000000;
vTaskDelay(1000);
}
}

void initx(void)
{
RCC_AHB1ENRbits.GPIODEN = 1;
GPIO_Config(&GPIOD_BASE,
_GPIO_PINMASK_12 | _GPIO_PINMASK_13 | _GPIO_PINMASK_14 | _GPIO_PINMASK_15,
_GPIO_CFG_MODE_OUTPUT | _GPIO_CFG_OTYPE_PP | _GPIO_CFG_SPEED_100MHZ | _GPIO_CFG_PULL_NO
);
}

void main()
{
initx();

xTaskCreate(TaskA, (signed char*)"TaskA", 128, NULL, tskIDLE_PRIORITY+1, NULL);
xTaskCreate(TaskB, (signed char*)"TaskB", 128, NULL, tskIDLE_PRIORITY+1, NULL);
xTaskCreate(TaskC, (signed char*)"TaskC", 128, NULL, tskIDLE_PRIORITY+1, NULL);
xTaskCreate(TaskD, (signed char*)"TaskD", 128, NULL, tskIDLE_PRIORITY+1, NULL);
vTaskStartScheduler();
}


The problem is that when I compile, I'm getting a lot of these errors:

Members cannot have memory specifier | core_cm4.h


Which refers to lines like this one:

  __I  uint32_t CPUID;                   /*!< Offset: 0x000 (R/ )  CPUID Base Register                                   */


inside the core_cm4.h file.

I looked for a solution online without any good results. I will appreciate a lot any advice or idea to solve this.

Thank you.

RE: MikroC + STM32F4Discovery + FreeRTOS

Posted by Richard on March 1, 2013
Sorry - I'm confused. Are you trying to port to a different compiler, or get a TrueStudio project working with CrossWorks? TrueStudio and CrossWorks both use the same compiler (GCC).

I thought MikroC was a PIC compiler?

Regards.

RE: MikroC + STM32F4Discovery + FreeRTOS

Posted by aussa on March 2, 2013
Mikroc has a ARM compiler also

RE: MikroC + STM32F4Discovery + FreeRTOS

Posted by Dave on March 2, 2013
The CMSIS library has configurations for IAR, Keil and GCC. Different configurations are required because each compiler uses different syntax. If you want to use MikroC then you will either have to strip out all calls to CMSIS libraries, or update the CMSIS library yourself to provide a mikroC port.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS