[freertos - Open Discussion and Support] CORTEX STM32F107 GCC Eclipse Demo

137 views
Skip to first unread message

SourceForge.net

unread,
Nov 5, 2011, 7:16:29 AM11/5/11
to SourceForge.net

Read and respond to this message at:
https://sourceforge.net/projects/freertos/forums/forum/382005/topic/4795114
By: mike2506

Hi,

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/s
rc/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
RTOS_SOURCE_DIR=../../Source
DEMO_COMMON_INCLUDE_DIR=../Common/include
DEMO_COMMON_SOURCE_DIR=../Common/Minimal
DEMO_DRIVER_DIR=../Common/drivers
UIP_COMMON_DIR=../Common/ethernet/uIP/uip-1.0/uip
STM32F10X_SOURCE_DIR=../Common/drivers/ST/STM32F10xFWLib/src
SOURCERY_GCC_INCLUDE_DIR=/home/mike/CodeSourcery/Sourcery_G++_Lite/lib/gcc/arm-n
one-eabi/4.5.2/include
SOURCERY_INCLUDE_DIR=/home/mike/CodeSourcery/Sourcery_G++_Lite/arm-none-eabi/inc
lude
#CROSSWORKS_STUDIO_DIR=/usr/share/crossworks_for_arm_2.1

#
# Demo additional files, ignore for the moment
#
#CRT0=thumb_crt0.s
#STARTUP=STM32F10x_Startup.s
# target file?

#
# Cross compilation tools to use (CodeSourcery)
#
CC=arm-none-eabi-gcc
LD=arm-none-eabi-ld
AS=arm-none-eabi-as
OBJCOPY=arm-none-eabi-objcopy

#
# 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 \
-std=c99 \
-fno-builtin \
-ffunction-sections \
-fdata-sections \
-fno-common \
-gdwarf-2 \
-fno-dwarf2-cfi-asm \
-I . \
-I $(RTOS_SOURCE_DIR)/include \
-I $(RTOS_SOURCE_DIR)/portable/GCC/ARM_CM3 \
-I $(DEMO_COMMON_INCLUDE_DIR) \
-I $(DEMO_DRIVER_DIR)/ST/STM32F10xFWLib/inc \
-I $(UIP_COMMON_DIR) \
-I webserver \
-I LCD \
-I $(SOURCERY_GCC_INCLUDE_DIR) \
-I $(SOURCERY_INCLUDE_DIR) \
-D PACK_STRUCT_END=__attribute\(\(packed\)\) \
-D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\)

# Crossworks flags, don't think applicable to eclipse project
#-D __CROSSWORKS \
#-D __CROSSWORKS_ARM \
#-D __ARM_ARCH_7M__ \
#-D __TARGET_PROCESSOR=STM32F107VC \
#-D OSCILLATOR_CLOCK_FREQUENCY=25000000 \
#-D __THUMB \
#-D __FLASH_BUILD \
#-D DEBUG \
#-D __CROSSWORKS_MAJOR_VERSION=2 \
#-D __CROSSWORKS_MINOR_VERSION=1 \
#-D __CROSSWORKS_REVISION=1 \
#-D __TARGET_CL= \
#-D STM32F10X_CL= \
#-nostdinc \
#-I$(CROSSWORKS_STUDIO_DIR)/include \
#-I$(CROSSWORKS_STUDIO_DIR)/lib \

# 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)
#
THUMB_SOURCE=$(DEMO_COMMON_SOURCE_DIR)/flash.c \
$(DEMO_COMMON_SOURCE_DIR)/recmutex.c \
$(DEMO_COMMON_SOURCE_DIR)/semtest.c \
$(DEMO_COMMON_SOURCE_DIR)/BlockQ.c \
$(DEMO_COMMON_SOURCE_DIR)/GenQTest.c \
$(DEMO_COMMON_SOURCE_DIR)/integer.c \
$(DEMO_COMMON_SOURCE_DIR)/PollQ.c \
$(DEMO_COMMON_SOURCE_DIR)/QPeek.c \
$(RTOS_SOURCE_DIR)/tasks.c \
$(RTOS_SOURCE_DIR)/list.c \
$(RTOS_SOURCE_DIR)/queue.c \
$(RTOS_SOURCE_DIR)/portable/MemMang/heap_2.c \
$(RTOS_SOURCE_DIR)/portable/GCC/ARM_CM3/port.c \
main.c \
./ParTest/ParTest.c \
$(STM32F10X_SOURCE_DIR)/stm32f10x_usart.c \
$(STM32F10X_SOURCE_DIR)/stm32f10x_gpio.c \
$(STM32F10X_SOURCE_DIR)/stm32f10x_lib.c \
$(STM32F10X_SOURCE_DIR)/stm32f10x_nvic.c \
$(STM32F10X_SOURCE_DIR)/stm32f10x_rcc.c \
$(STM32F10X_SOURCE_DIR)/stm32f10x_systick.c \
$(STM32F10X_SOURCE_DIR)/stm32fxxx_eth.c \
printf-stdarg.c \
$(STM32F10X_SOURCE_DIR)/stm32f10x_tim.c \
./LCD/lcd.c \
$(STM32F10X_SOURCE_DIR)/stm32f10x_spi.c \
$(UIP_COMMON_DIR)/timer.c \
$(UIP_COMMON_DIR)/uip.c \
$(UIP_COMMON_DIR)/uip_arp.c \
$(UIP_COMMON_DIR)/psock.c \
./webserver/uIP_Task.c \
./webserver/httpd.c \
./webserver/httpd-cgi.c \
./webserver/httpd-fs.

_____________________________________________________________________________________
You are receiving this email because you elected to monitor this topic or entire forum.
To stop monitoring this topic visit:
https://sourceforge.net/projects/freertos/forums/forum/382005/topic/4795114/unmonitor
To stop monitoring this forum visit:
https://sourceforge.net/projects/freertos/forums/forum/382005/unmonitor

SourceForge.net

unread,
Nov 7, 2011, 2:53:00 AM11/7/11
to SourceForge.net
By: stf12

Hi,

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

Regards,
Stefano

SourceForge.net

unread,
Nov 23, 2011, 6:59:05 AM11/23/11
to SourceForge.net
By: mike2506

Hi,

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

SourceForge.net

unread,
Nov 23, 2011, 7:57:39 AM11/23/11
to SourceForge.net
By: davedoors

Have you checked the xTaskCreate() return value?

SourceForge.net

unread,
Nov 23, 2011, 8:04:49 AM11/23/11
to SourceForge.net
By: mike2506

Yes it returns pdPass.


Cheers for the quick reply.

Reply all
Reply to author
Forward
0 new messages