Quality RTOS & Embedded Software

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


Loading

FreeRTOS on STR750 for GCC

Posted by ben e on November 23, 2009
I am trying for weeks now to build a environment for FreeRTOS with STR750 uC for a GCC crosscompiler.
As this is my first experience with creating makefiles, I did not get it to work by now.

Has anyone a makefile lying around for me or could give me a hint whats wrong with mine?!

Thank you!




SOURCE_DIR=./source/
LIB_SOURCE_DIR=./STLibrary/src/

CC = arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy

LDSCRIPT=systemfiles/STR75xFx0_FLASH_FreeRTOS.ld


#LINKER_FLAGS=-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf --gc-section -Xlinker -M -Xlinker -Map=rtosdemo.map
LINKER_FLAGS=-nostartfiles -Xlinker -oRTOSDemo.elf --gc-section -Xlinker -M -Xlinker -Map=rtosdemo.map

DEBUG=-g
OPTIM=-O0


CFLAGS= $(DEBUG) \
$(OPTIM) \
-T$(LDSCRIPT) \
-I . \
-I ./include \
-I ./STLibrary/inc \
-mcpu=arm7tdmi-s \
-D PACK_STRUCT_END=__attribute\(\(packed\)\) \
-D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) \
-fomit-frame-pointer \
-ffunction-sections


THUMB_SOURCE= \
source/main.c


ARM_SOURCE= \
$(SOURCE_DIR)main.c \
$(SOURCE_DIR)ParTest.c \
$(SOURCE_DIR)serial.c \
$(SOURCE_DIR)serialISR.c \
$(SOURCE_DIR)croutine.c \
$(SOURCE_DIR)list.c \
$(SOURCE_DIR)port.c \
$(SOURCE_DIR)portISR.c \
$(SOURCE_DIR)queue.c \
$(SOURCE_DIR)tasks.c \
$(SOURCE_DIR)portISR.c \
$(SOURCE_DIR)integer.c \
$(SOURCE_DIR)blocktim.c \
$(SOURCE_DIR)BlockQ.c \
$(SOURCE_DIR)comtest.c \
$(SOURCE_DIR)dynamic.c \
$(SOURCE_DIR)flash.c \
$(SOURCE_DIR)heap_2.c \
$(LIB_SOURCE_DIR)75x_adc.c \
$(LIB_SOURCE_DIR)75x_can.c \
$(LIB_SOURCE_DIR)75x_cfg.c \
$(LIB_SOURCE_DIR)75x_dma.c \
$(LIB_SOURCE_DIR)75x_eic.c \
$(LIB_SOURCE_DIR)75x_extit.c \
$(LIB_SOURCE_DIR)75x_gpio.c \
$(LIB_SOURCE_DIR)75x_i2c.c \
$(LIB_SOURCE_DIR)75x_it.c \
$(LIB_SOURCE_DIR)75x_lib.c \
$(LIB_SOURCE_DIR)75x_mrcc.c \
$(LIB_SOURCE_DIR)75x_pwm.c \
$(LIB_SOURCE_DIR)75x_rtc.c \
$(LIB_SOURCE_DIR)75x_smi.c \
$(LIB_SOURCE_DIR)75x_ssp.c \
$(LIB_SOURCE_DIR)75x_tb.c \
$(LIB_SOURCE_DIR)75x_tim.c \
$(LIB_SOURCE_DIR)75x_uart.c \
$(LIB_SOURCE_DIR)75x_wdg.c \
$(LIB_SOURCE_DIR)lcd.c




THUMB_OBJS = $(THUMB_SOURCE:.c=.o)
ARM_OBJS = $(ARM_SOURCE:.c=.o)


all: RTOSDemo.bin

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


RTOSDemo.elf : $(THUMB_OBJS) $(ARM_OBJS) Makefile
$(CC) $(CFLAGS) $(ARM_OBJS) $(THUMB_OBJS) $(LIBS) systemfiles/crt0_STR75x_FreeRTOS.s $(LINKER_FLAGS)

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

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

clean :
rm $(THUMB_OBJS)
rm $(ARM_OBJS)
touch Makefile
rm RTOSDemo.elf



RE: FreeRTOS on STR750 for GCC

Posted by ben e on November 23, 2009
PS: My last error looks like this:


/home/bene/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/bin/ld: section .text.vPortISRStartFirstTask loaded at [20000e58,20000e93] overlaps section .data loaded at [20000e58,20000e9b]

RE: FreeRTOS on STR750 for GCC

Posted by Dave on November 24, 2009
This is not a FreeRTOS problem and probably not a makefile problem, but a linker script problem. Either the linker script does not correctly describe the memory map of your microcontroller, or the built code size is too big to fit in the microcontroller flash.

Check the linker script is correct. It looks like you are already removing unreferenced code so the other option to reduce the built code size it to simply remove some code. Try taking out some of the demo tasks as a lot are included.

RE: FreeRTOS on STR750 for GCC

Posted by ben e on November 24, 2009
Thanks for you answer.
I rechecked the linker and startup code, and it is directly copied from the STR750 demo project for GCC/Raisonance IDE.
Following the map output from the makefile. There is something strange going on, it is remapping the ram to the flash or something strange I do not understand.
Furthermore I tried to cut everything out I could, the error still resists till now.

Any idea what's going on here?

.text.UART_ClearITPendingBit
0x2000602c 0x1c
.text.UART_ClearITPendingBit
0x2000602c 0x1c ./STLibrary/src/75x_uart.o
0x2000602c UART_ClearITPendingBit
.data 0x40000000 0x38 load address 0x20000c00
0x40000000 . = ALIGN (0x4)
0x40000000 _sdata = .
*(.data)
.data 0x40000000 0x4 ./source/portISR.o
0x40000000 ulCriticalNesting
.data 0x40000004 0x0 ./source/main.o
.data 0x40000004 0x30 ./source/ParTest.o
.data 0x40000034 0x4 ./source/serial.o

RE: FreeRTOS on STR750 for GCC

Posted by ben e on November 24, 2009
Today I tried ride7 IDE with this raisonance envirenment. The project file and the systemfiles coming with freertos did not work with this tools either. I followed the instructions on the freertos website and also needed to chance other options to get it compiling at all.
At the end this error is coming up.


Running: LD
\"C:\Programme\Raisonance\Ride\arm-gcc\bin\arm-none-eabi-gcc.exe" -mcpu=arm7tdmi -Wl,-T -Xlinker "C:\Dokumente und Einstellungen\ben\Desktop\FreeRTOSV6.0.1\Demo\ARM7_STR75x_GCC\rtosdemo.elf.ld" -u _start -Wl,-static -Wl,--gc-sections -nostartfiles -Wl,-Map -Xlinker "C:\Dokumente und Einstellungen\ben\Desktop\FreeRTOSV6.0.1\Demo\ARM7_STR75x_GCC\rtosdemo.map"
C:\Dokumente und Einstellungen\ben\Desktop\FreeRTOSV6.0.1\Demo\ARM7_STR75x_GCC\crt0_str75x_freertos.o: In function `_startup':
(.text+0x0): multiple definition of `_start'
C:\Dokumente und Einstellungen\ben\Desktop\FreeRTOSV6.0.1\Demo\ARM7_STR75x_GCC\crt0_str75x_freertos.o:(.text+0x0): first defined here
C:\Dokumente und Einstellungen\ben\Desktop\FreeRTOSV6.0.1\Demo\ARM7_STR75x_GCC\crt0_str75x_freertos.o: In function `_startup':
(.text+0x0): multiple definition of `_startup'
C:\Dokumente und Einstellungen\ben\Desktop\FreeRTOSV6.0.1\Demo\ARM7_STR75x_GCC\crt0_str75x_freertos.o:(.text+0x0): first defined here
C:\Dokumente und Einstellungen\ben\Desktop\FreeRTOSV6.0.1\Demo\ARM7_STR75x_GCC\crt0_str75x_freertos.o: In function `__wrongvector':
(.text+0x40): multiple definition of `__wrongvector'
C:\Dokumente und Einstellungen\ben\Desktop\FreeRTOSV6.0.1\Demo\ARM7_STR75x_GCC\crt0_str75x_freertos.o:(.text+0x40): first defined here
c:/programme/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/bin/ld.exe: section .text.vPortISRStartFirstTask [20001260 -> 2000129b] overlaps section .data [20001260 -> 20001297]
c:/programme/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/bin/ld.exe: section .bss [20001298 -> 2000461b] overlaps section .text.vPortISRStartFirstTask [20001260 -> 2000129b]
c:/programme/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/bin/ld.exe: section .text.vPortEnterCritical [2000129c -> 200012c7] overlaps section .bss [20001298 -> 2000461b]
c:/programme/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/bin/ld.exe: section .text.vCheckTask [2000461c -> 200046fb] overlaps section ._usrstack [2000461c -> 2000521b]
collect2: ld returned 1 exit status


I am wondering how other freertos users get this working. Any hint is welcome :)

RE: FreeRTOS on STR750 for GCC

Posted by ben e on November 25, 2009
Another few hours playing around with freertos and crosscompilers, I discovered something.

It took a while, but I found RIDE6, that was used to create the demo project in 2006. It worked quite out-of-the box and ran in a few minutes on my board.
As they use GCC 3.3 and a WINARM envirenment, I think it is anywhere incompatible with recent buildtools. I found more recent startup files and linker scripts, but the scheduler does not start with these.

Does anyone have more recent linker and startup files or some modified I could use? I've no idea where to proceed so far :\

Thanks for any help!

RE: FreeRTOS on STR750 for GCC

Posted by Richard on November 25, 2009
Strange, I thought I had updated it to RIDE 7. I will have to check that.

Regards.

RE: FreeRTOS on STR750 for GCC

Posted by ben e on December 10, 2009
Thank you richardbarry for your answer. I appreciate, that you want to have a look at my concern.
Did you discovery anything yet? I am still stuck at the old and unstable RIDE6. A recent gcc crosscompiler support would surely help others too.

Thanks

RE: FreeRTOS on STR750 for GCC

Posted by ben e on January 25, 2010
After days of working on it, I rebuilt a makefile, extracting compiling options out of the logfile from ride6.
Is not compatible anymore with the original freertos data structure, also created not very carefully, but at least it works.
For anyone that is running in the same problem like me, here my creation.
Thanks for comments, have fun with it.

#/***********************************************
#
# FDDrumSpine Makefile
#
# FreeRTOS V6.0.1
#
# Target STR750
#
#***********************************************/


CORE_SOURCE_DIR = ./core/
TASKS_SOURCE_DIR = ./tasks/
LIB_SOURCE_DIR = ./STLibrary/src/

CC = arm-elf-gcc
OBJCOPY = arm-elf-objcopy

LDSCRIPT = systemfiles/STR75xFx0_FLASH_FreeRTOS.ld
STARTSCRIPT = systemfiles/crt0_STR75x_FreeRTOS.s

LDFLAGS = \
-mcpu=arm7tdmi \
-nostartfiles -Wl,-Map=Output.map,--cref \
-Xlinker \
-oOUTPUT.elf

ASFLAGS= -mcpu=arm7tdmi \
-DSTR75X_GCC \
-Wa,-I -Xassembler ./STLibrary/inc \
-Wa,-I -Xassembler ./include \
-Wa,-I -Xassembler ./ \
-c \
-Wa,-EL


CFLAGS= \
-DSTR75X_GCC \
-mcpu=arm7tdmi \
-I$(CORE_SOURCE_DIR) \
-I$(TASKS_SOURCE_DIR) \
-I./ \
-I./STLibrary/inc \
-c \
-g \
-mlittle-endian \
-funsigned-char \
-O2 \
-Wall \
-Wshadow \
-Wswitch \
-Wunused \
-fomit-frame-pointer \
-fno-dwarf2-cfi-asm

ARM_SOURCE=\
main.c \
$(TASKS_SOURCE_DIR)adc.c \
$(TASKS_SOURCE_DIR)spidac.c \
$(TASKS_SOURCE_DIR)peltierfb.c \
$(TASKS_SOURCE_DIR)canbus.c \
$(CORE_SOURCE_DIR)misc_stringop.c \
$(CORE_SOURCE_DIR)serial.c \
$(CORE_SOURCE_DIR)serialISR.c \
$(CORE_SOURCE_DIR)list.c \
$(CORE_SOURCE_DIR)port.c \
$(CORE_SOURCE_DIR)queue.c \
$(CORE_SOURCE_DIR)tasks.c \
$(CORE_SOURCE_DIR)heap_2.c \
$(CORE_SOURCE_DIR)portISR.c \
$(LIB_SOURCE_DIR)75x_adc.c \
$(LIB_SOURCE_DIR)75x_can.c \
$(LIB_SOURCE_DIR)75x_ssp.c \
$(LIB_SOURCE_DIR)75x_mrcc.c \
$(LIB_SOURCE_DIR)75x_gpio.c \
$(LIB_SOURCE_DIR)75x_tb.c \
$(LIB_SOURCE_DIR)75x_it.c \
$(LIB_SOURCE_DIR)75x_cfg.c \
$(LIB_SOURCE_DIR)75x_eic.c \
$(LIB_SOURCE_DIR)75x_uart.c


ARM_OBJS = $(ARM_SOURCE:.c=.o)

START_OBJ = $(STARTSCRIPT:.s=.o)

all: OUTPUT.bin

OUTPUT.bin : OUTPUT.elf
$(OBJCOPY) OUTPUT.elf -O binary OUTPUT.bin

OUTPUT.elf : $(ARM_OBJS) $(START_OBJ) Makefile
$(CC) $(LDFLAGS) $(START_OBJ) $(ARM_OBJS) -T $(LDSCRIPT)

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

$(START_OBJ) : $(STARTSCRIPT)
$(CC) $(ASFLAGS) $(STARTSCRIPT) -o $@


clean :
rm -f $(START_OBJ)
rm -f $(ARM_OBJS)
touch Makefile
rm -f OUTPUT.elf
rm -f OUTPUT.bin


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


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner