Question

Discussions and support about ChibiOS/RT, the free embedded RTOS.
sazem
Posts: 17
Joined: Thu Jun 28, 2018 9:48 am

Question

Postby sazem » Thu Jun 28, 2018 10:02 am

Hi ;

I hope you are well. I want to test a small demo for reading data from sensors of STM32F303 discovery kit. This demo can serve for reading data into graph and at each orientation you take a value of accelerometer, gyroscope and magnetometer.

I have done all main configurations and I have changed the makefile corresponding with my borad.

The opendOCD work well without error, but the compilation (build project) tells that it has an error in make-file, the followinf error is:

04:38:21 **** Incremental Build of configuration Default for project ARMCM4-STM32F303-DISCOVERY ****
make -j8 all
Makefile:244: *** missing separator. Stop.

04:38:21 Build Finished (took 120ms)

I share my make file with you and please one of yours can help me as soon as possible.

Best regards;
SAMIR ZEMAM

# Jerome
# ChibiOS-RT project compilation, for STM32F3 Discovery Board

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

# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
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 = no
endif

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

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

# Enables the use of FPU on Cortex-M4.
# Enable this if you really want to use the STM FWLib.
ifeq ($(USE_FPU),)
USE_FPU = no
endif

# 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 = rtos_demo
# Imported source files and paths
#CHIBIOS = ../..
#CHIBIOS = /Users/jleny/Software/Embedded/ChibiOS_git
CHIBIOS = ../../../ChibiOS_2_6_6
include $(CHIBIOS)/boards/ST_STM32F3_DISCOVERY/board.mk
include $(CHIBIOS)/os/hal/platforms/STM32F30x/platform.mk
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F3xx/port.mk
include $(CHIBIOS)/os/kernel/kernel.mk
include $(CHIBIOS)/test/test.mk

# Define linker script file here
LDSCRIPT= $(PORTLD)/STM32F303xC.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/chprintf.c \
usbcfg.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/devices_lib/accel \
$(CHIBIOS)/os/various

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

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

MCU = cortex-m4

#TRGT = arm-elf-
TRGT = arm-none-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 = -DCHPRINTF_USE_FLOAT=TRUE

# 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_FPU),yes)
USE_OPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant
DDEFS += -DCORTEX_USE_FPU=TRUE
else
DDEFS += -DCORTEX_USE_FPU=FALSE
endif

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


##############################################################################
# Jerome: recipes for programming the board immediately after compiling
# with 'make program'
# location of OpenOCD Board .cfg files (only used with 'make program')
#OPENOCD_BOARD_DIR=/usr/local/Cellar/open-ocd/0.9.0/share/openocd/scripts/board
OPENOCD_BOARD_DIR=C:/ChibiStudio/tools/openocd/scripts/board

# Configuration (cfg) file containing programming directives for OpenOCD
#OPENOCD_PROC_FILE=extra/stm32f3-openocd.cfg

.PHONY: all program

all: $(MAKE)

program: all
openocd -f $(OPENOCD_BOARD_DIR)/stm32f3discovery.cfg -c "program `pwd`/build/$(PROJECT).elf verify reset exit"
#openocd -f $(OPENOCD_BOARD_DIR)/stm32f3discovery.cfg -f $(OPENOCD_PROC_FILE) -c "stm_flash `pwd`/build/$(PROJECT).bin" -c shutdown

User avatar
Giovanni
Site Admin
Posts: 11946
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 537 times
Been thanked: 449 times
Contact:

Re: Question

Postby Giovanni » Thu Jun 28, 2018 10:17 am

Hi,

ChibiOS 2.6.6 is very old and unsupported, the error is at line 244 apparently, look there, the makefile lost formatting.

If you need to past things to the forum please use the "code display" quoting or formatting is removed from code.

Giovanni

sazem
Posts: 17
Joined: Thu Jun 28, 2018 9:48 am

Re: Question

Postby sazem » Thu Jun 28, 2018 3:35 pm

Giovanni wrote:Hi,

ChibiOS 2.6.6 is very old and unsupported, the error is at line 244 apparently, look there, the makefile lost formatting.

If you need to past things to the forum please use the "code display" quoting or formatting is removed from code.

Giovanni



Thank you Giovanni for your fast response, but, really I don't really understand it, what do you mean by "formating is removed from code".

Have you a good solution to suggest me please, I need trully that my problem will be solved today.

Thank you very much giovanni

SAMIR ZEMAM

faisal
Posts: 242
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 35 times
Been thanked: 32 times

Re: Question

Postby faisal » Thu Jun 28, 2018 3:44 pm

sazem wrote:
Giovanni wrote:Hi,

ChibiOS 2.6.6 is very old and unsupported, the error is at line 244 apparently, look there, the makefile lost formatting.

If you need to past things to the forum please use the "code display" quoting or formatting is removed from code.

Giovanni



Thank you Giovanni for your fast response, but, really I don't really understand it, what do you mean by "formating is removed from code".

Have you a good solution to suggest me please, I need trully that my problem will be solved today.

Thank you very much giovanni

SAMIR ZEMAM


Highlight the text that you want to format like code, and then click on the fourth button from the left of your editor toolbar (looks like <> .. <>).

Code: Select all

Sort of like this!

User avatar
Giovanni
Site Admin
Posts: 11946
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 537 times
Been thanked: 449 times
Contact:

Re: Question

Postby Giovanni » Thu Jun 28, 2018 3:46 pm

The makefile you posted lost its spaces and is not well readable -> lost formatting. Spaces and tabs have meaning in makefiles.

Additionally, that makefile looks like a modification of ChibiOS makefiles, the problem seems to be in the added part. Try removing everything after this line:

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

Giovanni

sazem
Posts: 17
Joined: Thu Jun 28, 2018 9:48 am

Re: Question

Postby sazem » Thu Jun 28, 2018 3:56 pm

faisal wrote:
sazem wrote:
Giovanni wrote:Hi,

ChibiOS 2.6.6 is very old and unsupported, the error is at line 244 apparently, look there, the makefile lost formatting.

If you need to past things to the forum please use the "code display" quoting or formatting is removed from code.

Giovanni



Thank you Giovanni for your fast response, but, really I don't really understand it, what do you mean by "formating is removed from code".

Have you a good solution to suggest me please, I need trully that my problem will be solved today.

Thank you very much giovanni

SAMIR ZEMAM


Highlight the text that you want to format like code, and then click on the fourth button from the left of your editor toolbar (looks like <> .. <>).

Code: Select all

Sort of like this!


you mean that i do the following command to correct the line 144:

<> .. <> openocd -f $(OPENOCD_BOARD_DIR)/stm32f3discovery.cfg -c "program `pwd`/build/$(PROJECT).elf verify reset exit"

what do you mean by fourth button, i am very sorry because I am new in embedded and code.

Can you do that and send me a good syntax for this, I would be grateful

Tnak you very much M giovanni.

faisal
Posts: 242
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 35 times
Been thanked: 32 times

Re: Question

Postby faisal » Thu Jun 28, 2018 4:18 pm

Highlight a section of text, and click on the button circled in the attachment screenshot.

You will see it will wrap the text in "code" tags, like below:

Code: Select all

This text is wrapped in "code" tags. When you submit the post, it will apply code formatting to it.
Attachments
Capture.PNG

sazem
Posts: 17
Joined: Thu Jun 28, 2018 9:48 am

Re: Question

Postby sazem » Thu Jun 28, 2018 5:06 pm

Thanks Giovanni for your help.
Ok, This is a code, the 144 the Line of code is the Line before the last line.

P.J: refer you of the previous messages if you want to understand my problem.

Best regard;
Samir Zemam

The Line of error is:

Code: Select all

openocd -f $(OPENOCD_BOARD_DIR)/stm32f3discovery.cfg -c "program `pwd`/build/$(PROJECT).elf verify reset exit"

What is the correction of this syntax?
The ****error is missing separator *****

The following full make file code is:

Code: Select all


# ChibiOS-RT project compilation, for STM32F3 Discovery Board

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

# Compiler options here.
ifeq ($(USE_OPT),)
  USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
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 = no
endif

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

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

# Enables the use of FPU on Cortex-M4.
# Enable this if you really want to use the STM FWLib.
ifeq ($(USE_FPU),)
  USE_FPU = no
endif

# 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 = rtos_demo
# Imported source files and paths
#CHIBIOS = ../..
#CHIBIOS = /Users/jleny/Software/Embedded/ChibiOS_git
CHIBIOS = ../../../ChibiOS_2_6_6
include $(CHIBIOS)/boards/ST_STM32F3_DISCOVERY/board.mk
include $(CHIBIOS)/os/hal/platforms/STM32F30x/platform.mk
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F3xx/port.mk
include $(CHIBIOS)/os/kernel/kernel.mk
include $(CHIBIOS)/test/test.mk

# Define linker script file here
LDSCRIPT= $(PORTLD)/STM32F303xC.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/chprintf.c \
       usbcfg.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/devices_lib/accel \
         $(CHIBIOS)/os/various

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

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

MCU  = cortex-m4

#TRGT = arm-elf-
TRGT = arm-none-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 = -DCHPRINTF_USE_FLOAT=TRUE

# 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_FPU),yes)
  USE_OPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant
  DDEFS += -DCORTEX_USE_FPU=TRUE
else
  DDEFS += -DCORTEX_USE_FPU=FALSE
endif

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


##############################################################################
# Jerome: recipes for programming the board immediately after compiling
# with 'make program'
# location of OpenOCD Board .cfg files (only used with 'make program')
#OPENOCD_BOARD_DIR=/usr/local/Cellar/open-ocd/0.9.0/share/openocd/scripts/board
OPENOCD_BOARD_DIR=C:/ChibiStudio/tools/openocd/scripts/board

# Configuration (cfg) file containing programming directives for OpenOCD
#OPENOCD_PROC_FILE=extra/stm32f3-openocd.cfg

.PHONY: all program

all: $(MAKE)

program: all
    openocd -f $(OPENOCD_BOARD_DIR)/stm32f3discovery.cfg -c "program `pwd`/build/$(PROJECT).elf verify reset exit"
   #openocd -f $(OPENOCD_BOARD_DIR)/stm32f3discovery.cfg -f $(OPENOCD_PROC_FILE) -c "stm_flash `pwd`/build/$(PROJECT).bin" -c shutdown

User avatar
Giovanni
Site Admin
Posts: 11946
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 537 times
Been thanked: 449 times
Contact:

Re: Question

Postby Giovanni » Thu Jun 28, 2018 6:08 pm

I think that your problem is that the following lines are not started with a TAB but four spaces:

Code: Select all

    openocd -f $(OPENOCD_BOARD_DIR)/stm32f3discovery.cfg -c "program `pwd`/build/$(PROJECT).elf verify reset exit"
       #openocd -f $(OPENOCD_BOARD_DIR)/stm32f3discovery.cfg -f $(OPENOCD_PROC_FILE) -c "stm_flash `pwd`/build/$(PROJECT).bin" -c shutdown


Probably your editor transformed the TABs in spaces. Makefiles require rules to start with TABs.

Giovanni

sazem
Posts: 17
Joined: Thu Jun 28, 2018 9:48 am

Re: Question

Postby sazem » Thu Jun 28, 2018 7:00 pm

Hi Giovanni;

I was look in TABs syntax in C++ , and i have found the

Code: Select all

 \t
command

I have transformed my line of code into:

Code: Select all

\t openocd -f $(OPENOCD_BOARD_DIR)/stm32f3discovery.cfg -c "program `pwd`/build/$(PROJECT).elf verify reset exit"


The same message appears.

I look forward to hearing your reply.

Thank you very much.

Giovanni wrote:I think that your problem is that the following lines are not started with a TAB but four spaces:

Code: Select all

    openocd -f $(OPENOCD_BOARD_DIR)/stm32f3discovery.cfg -c "program `pwd`/build/$(PROJECT).elf verify reset exit"
       #openocd -f $(OPENOCD_BOARD_DIR)/stm32f3discovery.cfg -f $(OPENOCD_PROC_FILE) -c "stm_flash `pwd`/build/$(PROJECT).bin" -c shutdown


Probably your editor transformed the TABs in spaces. Makefiles require rules to start with TABs.

Giovanni


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 1 guest