FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [February 2013 Threads]
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.
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.
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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.