Stm32f303 freertos

时间:2014-10-14 07:19:55

标签: gcc stm32 freertos

我尝试在stm32f303发现上运行freertos。 我包括从官方网站下载的freertos存档中的所有头文件和源文件。我还包括文件夹/GCC/ARM_CM4F中的可移植文件。 我使用codesourcery lite编译器。当我尝试编译项目时,我得到错误:

In file included from freertos/inc/portable.h:321:0,
                 from freertos/inc/FreeRTOS.h:100,
                 from freertos/src/croutine.c:66:
freertos/inc/portmacro.h:167:7: error: missing binary operator before token "long"

portmacro.h的167-172字符串:

    #if( configMAX_PRIORITIES > 32 )
        #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32.  It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
    #endif

在Google中搜索会发现存在预处理程序错误,但它并不能指出我应该做些什么。 我的Makefile设置:

# Set Libraries
LIBS        = -lm -lc

###################################################
# Set Board
MCU         = -mthumb -mcpu=cortex-m4
FPU         = -mfpu=fpv4-sp-d16 -mfloat-abi=softfp
DEFINES     = -DSTM32F3XX -DUSE_STDPERIPH_DRIVER
DEFINES     += -DUSE_DEFAULT_TIMEOUT_CALLBACK

# Set Compilation and Linking Flags
CFLAGS      = $(MCU) $(FPU) $(DEFINES) $(INCLUDES) \
            -g -Wall -std=gnu90 -O0 -ffunction-sections -fdata-sections
ASFLAGS     = $(MCU) $(FPU) -g -Wa,--warn -x assembler-with-cpp
LDFLAGS     = $(MCU) $(FPU) -g -gdwarf-2\
            -Tstm32f30_flash.ld \
            -Xlinker --gc-sections -Wl,-Map=$(PROJ_NAME).map \
            $(LIBS) \
            -o $(PROJ_NAME).elf

我错的地方?

1 个答案:

答案 0 :(得分:3)

编译器告诉您C预处理器不理解configMAX_PRIORITIES的定义。看看FreeRTOSConfig.h中的定义,我怀疑它包含预处理器不理解的强制转换。删除演员,它可能会没问题。