Quality RTOS & Embedded Software

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


CORTEX STM32F107 GCC Eclipse Demo

Posted by *anonymous on November 5, 2011


I am attempting to port the current GCC Rowley Demo for the STM32F107 to Eclipse/OpenOCD. I am using CodeSourcery (Lite) for the cross compilation tools. I seem to having trouble building the project though.

When compiling the file stm32f10x_nvic.c the following error comes up:

FreeRTOS/Demo/CORTEX_STM32F107_GCC_Ecplise/../Common/drivers/ST/STM32F10xFWLib/src/stm32f10x_nvic.c:190: undefined reference to `__SETPRIMASK'

Several of these errors are displayed (with different undefined references) for this file. I have traced '__SETPRIMASK' to Demo/Common/drivers/ST/STM32F10xFWLib/inc/cortexm3_macro.h, which is included via stm32f10x_nvic.h.

So I don't see why these errors come up, I imagine it is because of a missing include directory or missing pre processor directive, but I can't see what is missing, anybody else come across this problem/have any ideas?

Here is my makefile for information:

# Makefile for use on the STM32-P107 Olimex board

# Project directories
# RTOS_SOURCE_DIR -> RTOS source directory
# DEMO_COMMON_INCLUDE_DIR -> Common demo header files
# DEMO_COMMON_SOURCE_DIR -> Common demo source files
# DEMO_DRIVER_DIR -> Common demo driver files
# UIP_COMMON_DIR -> Networking files
# STM32F10X_SOURCE_DIR -> Microcontroller specific drivers

# Demo additional files, ignore for the moment
# target file?

# Cross compilation tools to use (CodeSourcery)

# Flags to use for linker
LINKER_FLAGS=-nostartfiles -Xlinker -oRTOSDemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map

# Flags to use for compiler
# Warnings, debug info, optimisations, cortex-m3 flags, additional code directories, preprocessor directives (definitions)
CFLAGS=-Wall -Wextra -g -O3
-mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -mlittle-endian -mfpu=vfp -mfloat-abi=soft
-I .
-I $(RTOS_SOURCE_DIR)/include
-I webserver
-D PACK_STRUCT_END=__attribute\(\(packed\)\)
-D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\)

# Crossworks flags, don't think applicable to eclipse project
#-D __ARM_ARCH_7M__
#-D STM32F10X_CL=

# Note this last -D line is handled incorrectly when a is put at the end!!

# Source files to compile to build RTOSDemo.elf (DO NOT MODIFY)

# Rules for running make


all: RTOSDemo.bin

RTOSDemo.bin : RTOSDemo.hex
$(OBJCOPY) RTOSDemo.elf -O binary RTOSDemo.bin

RTOSDemo.hex : RTOSDemo.elf
$(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.hex

RTOSDemo.elf : $(THUMB_OBJS) $(CRT0) Makefile

$(THUMB_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
$(CC) -c $(CFLAGS) $< -o $@

clean :
rm -f $(THUMB_OBJS)
touch Makefile
rm -f RTOSDemo.elf
rm -f RTOSDemo.hex

CORTEX STM32F107 GCC Eclipse Demo

Posted by stf12 on November 7, 2011


I have published some FreeRTOS demo running on Eclipse/GCC (Code Sourcery) at the following link: http://www.stf12.org/developers/Download.html.
Look for Cortex_STM32F107 demo.


CORTEX STM32F107 GCC Eclipse Demo

Posted by *anonymous on November 23, 2011


Thanks for the demo. I managed to get the project building and downloading onto the board.

I seem to be having a problem creating tasks now though, I create a task to turn some LED's on, however it never seems to get run. There are no other tasks being created.

Here is the call to the task creation function:

xTaskCreate( vLEDEnableTask, ( signed char * ) "LEDx", 128, NULL, 2, ( xTaskHandle * ) NULL );

Has anyone come across this problem before?

Cheers, Michael

CORTEX STM32F107 GCC Eclipse Demo

Posted by davedoors on November 23, 2011

Have you checked the xTaskCreate() return value?

CORTEX STM32F107 GCC Eclipse Demo

Posted by *anonymous on November 23, 2011

Yes it returns pdPass.

Cheers for the quick reply.

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

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

Latest News

FreeRTOS kernel V10.0.1 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