Problems importing STM32F100-Discovery into Atollic Stuio

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
Stomper85
Posts: 23
Joined: Tue Mar 19, 2013 1:25 pm

Problems importing STM32F100-Discovery into Atollic Stuio

Post by Stomper85 »

Hi,

I was trying the wohle morning getting ChibiOs to run on the STM32VL-Discovery Board with Atollic Studio Lite.
First I was on doubt if Atollic is able to compile it with the Atollic Tool Chain, but I read this: http://www.atollic.com/index.php/truest ... ercompiler
and so I think it should run.

But I am not able to get a working makefile.

Has andybody got this to work with Atollic Lite?

Here is my Makefile:

Code: Select all

##############################################################################
# Build global options
# NOTE: Can be overridden externally.
#

# Compiler options here.
ifeq ($(USE_OPT),)
  USE_OPT = -c -g -O0
endif

# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
  USE_COPT =
endif

# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
  USE_CPPOPT = -fno-rtti
endif

# Enable this if you want the linker to remove unused code and data
ifeq ($(USE_LINK_GC),)
  USE_LINK_GC = yes
endif

# If enabled, this option allows to compile the application in THUMB mode.
ifeq ($(USE_THUMB),)
  USE_THUMB = yes
endif

# Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),)
  USE_VERBOSE_COMPILE = yes
endif

#
# Build global options
##############################################################################

##############################################################################
# Architecture or project specific options
#

# Enable this if you really want to use the STM FWLib.
ifeq ($(USE_FWLIB),)
  USE_FWLIB = no
endif

#
# Architecture or project specific options
##############################################################################

##############################################################################
# Project, sources and paths
#

# Define project name here
PROJECT = ch

# Imported source files and paths
CHIBIOS = ../..
include $(CHIBIOS)/boards/ST_STM32VL_DISCOVERY/board.mk
include $(CHIBIOS)/os/hal/platforms/STM32F1xx/platform.mk
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F1xx/port.mk
include $(CHIBIOS)/os/kernel/kernel.mk
include $(CHIBIOS)/test/test.mk

# Define linker script file here
LDSCRIPT= $(PORTLD)/stm32_flash.ld

# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(PORTSRC) \
       $(KERNSRC) \
       $(TESTSRC) \
       $(HALSRC) \
       $(PLATFORMSRC) \
       $(BOARDSRC) \
       $(CHIBIOS)/os/various/evtimer.c \
       $(CHIBIOS)/os/various/syscalls.c \
       main.c

# C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CPPSRC =

# C sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
#       option that results in lower performance and larger code size.
ACSRC =

# C++ sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
#       option that results in lower performance and larger code size.
ACPPSRC =

# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
#       option that results in lower performance and larger code size.
TCSRC =

# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
#       option that results in lower performance and larger code size.
TCPPSRC =

# List ASM source files here
ASMSRC = $(PORTASM)

INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
         $(HALINC) $(PLATFORMINC) $(BOARDINC) \
         $(CHIBIOS)/os/various

#
# Project, sources and paths
##############################################################################

##############################################################################
# Compiler settings
#

MCU  = cortex-m3

#TRGT = arm-elf-
TRGT = arm-atollic-eabi-
CC   = $(TRGT)gcc
CPPC = $(TRGT)g++
# Enable loading with g++ only if you need C++ runtime support.
# NOTE: You can use C++ even without C++ support if you are careful. C++
#       runtime support makes code size explode.
LD   = $(TRGT)gcc
#LD   = $(TRGT)g++
CP   = $(TRGT)objcopy
AS   = $(TRGT)gcc -x assembler-with-cpp
OD   = $(TRGT)objdump
HEX  = $(CP) -O ihex
BIN  = $(CP) -O binary

# ARM-specific options here
AOPT =

# THUMB-specific options here
TOPT = -mthumb -DTHUMB

# Define C warning options here
CWARN = -Wall -Wextra -Wstrict-prototypes

# Define C++ warning options here
CPPWARN = -Wall -Wextra

#
# Compiler settings
##############################################################################

##############################################################################
# Start of default section
#

# List all default C defines here, like -D_DEBUG=1
DDEFS =

# List all default ASM defines here, like -D_DEBUG=1
DADEFS =

# List all default directories to look for include files here
DINCDIR =

# List the default directory to look for the libraries here
DLIBDIR =

# List all default libraries here
DLIBS =

#
# End of default section
##############################################################################

##############################################################################
# Start of user section
#

# List all user C define here, like -D_DEBUG=1
UDEFS =

# Define ASM defines here
UADEFS =

# List all user directories here
UINCDIR =

# List the user directory to look for the libraries here
ULIBDIR =

# List all user libraries here
ULIBS =

#
# End of user defines
##############################################################################

ifeq ($(USE_FWLIB),yes)
  include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
  CSRC += $(STM32SRC)
  INCDIR += $(STM32INC)
  USE_OPT += -DUSE_STDPERIPH_DRIVER
endif

include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk



Best regards
Stomper
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problems importing STM32F100-Discovery into Atollic Stui

Post by Giovanni »

Hi,

I don't know about Atollic but you could simply download ChibiStudio and not suffer any limitation.

Giovanni
Stomper85
Posts: 23
Joined: Tue Mar 19, 2013 1:25 pm

Re: Problems importing STM32F100-Discovery into Atollic Stui

Post by Stomper85 »

Hi Giovanni,

thanks for the advice, but unfortunatelly it does not work with chibistudio for me.

I imported the files, but I cant get an working makefile. here are my outputs:

Code: Select all

07:41:39 **** Incremental Build of configuration Default for project ARMCM3-STM32F100-DISCOVERY ****
make all
Compiling ../../os/ports/GCC/ARMCMx/crt0.c
process_begin: CreateProcess(NULL, arm-none-eabi-gcc -c -mcpu=cortex-m3 -O2 -ggdb -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-common -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/lst/crt0.lst -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -MD -MP -MF .dep/crt0.o.d -mthumb -DTHUMB -I. -I../../os/ports/common/ARMCMx/CMSIS/include -I../../os/ports/common/ARMCMx -I../../os/ports/GCC/ARMCMx -I../../os/ports/GCC/ARMCMx/STM32F1xx -I../../os/kernel/include -I../../test -I../../os/hal/include -I../../os/hal/platforms/STM32F1xx -I../../os/hal/platforms/STM32 -I../../os/hal/platforms/STM32/GPIOv1 -I../../os/hal/platforms/STM32/I2Cv1 -I../../os/hal/platforms/STM32/RTCv1 -I../../os/hal/platforms/STM32/SPIv1 -I../../os/hal/platforms/STM32/USARTv1 -I../../os/hal/platforms/STM32/USBv1 -I../../boards/ST_STM32VL_DISCOVERY -I../../os/various ../../os/ports/GCC/ARMCMx/crt0.c -o build/obj/crt0.o, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.

make: *** [build/obj/crt0.o] Error 2


Best regards
Stomper
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problems importing STM32F100-Discovery into Atollic Stui

Post by Giovanni »

Do you mean ChibiStudio does not work or that you can't use it?

The only thing I see in that log is that make.exe is unable to find the file, probably you have to adjust the ChibiOS path in the Makefile.

Giovanni
Stomper85
Posts: 23
Joined: Tue Mar 19, 2013 1:25 pm

Re: Problems importing STM32F100-Discovery into Atollic Stui

Post by Stomper85 »

It finaly worked with chibistudio!

The problem was not the paths in the makefile but the paths in the PATH environment variable.
The makefile of yagarto was on the right side of the string and so it tried to use the wrong make.exe i think.
I put the yagarto tools and the yagarto make.exe at the very left side of the string, so that it will be found first.

Now it is working.

Thank you for your help!

Best regards
Stomper
Post Reply