MikroC + STM32F4Discovery + FreeRTOS

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 <math.h>
#include <stdio.h>
#include <stdlib.h>
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.

MikroC + STM32F4Discovery + FreeRTOS

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.

MikroC + STM32F4Discovery + FreeRTOS

Mikroc has a ARM compiler also

MikroC + STM32F4Discovery + FreeRTOS

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.