ChibiOS 18.2.1 and community hal
ChibiOS 18.2.1 and community hal
Hi,
adding community hal leads to make errors
ChibiOS_18.2.1/os/common/startup/ARMCMx/compilers/GCC/rules.mk:229: target `build/obj/hal.o' given more than once in the same rule.
ChibiOS_18.2.1/os/common/startup/ARMCMx/compilers/GCC/rules.mk:229: target `build/obj/hal_st.o' given more than once in the same rule.
etc.....
due to
include ${CHIBIOS}/os/hal/hal.mk in in $(CHIBIOS_CONTRIB)/os/hal/hal.mk
and
include ${CHIBIOS}/os/hal/ports/STM32/STM32F4xx/platform.mk in $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F4xx/platform.mk
adding community hal leads to make errors
ChibiOS_18.2.1/os/common/startup/ARMCMx/compilers/GCC/rules.mk:229: target `build/obj/hal.o' given more than once in the same rule.
ChibiOS_18.2.1/os/common/startup/ARMCMx/compilers/GCC/rules.mk:229: target `build/obj/hal_st.o' given more than once in the same rule.
etc.....
due to
include ${CHIBIOS}/os/hal/hal.mk in in $(CHIBIOS_CONTRIB)/os/hal/hal.mk
and
include ${CHIBIOS}/os/hal/ports/STM32/STM32F4xx/platform.mk in $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F4xx/platform.mk
Re: ChibiOS 18.2.1 and community hal
This is what should be in your makefile:
The hal.mk, and platform.mk that you include from community already includes the chibios hal.mk and platform.mk.
So, you *don't* need the following in your makefile:
Post your makefile if that's not your issue.
Code: Select all
include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F4xx/platform.mkThe hal.mk, and platform.mk that you include from community already includes the chibios hal.mk and platform.mk.
So, you *don't* need the following in your makefile:
Code: Select all
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/ports/STM32/STM32L4xx/platform.mkPost your makefile if that's not your issue.
Re: ChibiOS 18.2.1 and community hal
Yep, I understand it,
but 17.6.3 works fine with makefile like this
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk
include $(CHIBIOS)/os/hal/boards/XXX/board.mk
include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F4xx/platform.mk
but 17.6.3 works fine with makefile like this
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk
include $(CHIBIOS)/os/hal/boards/XXX/board.mk
include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F4xx/platform.mk
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: ChibiOS 18.2.1 and community hal
Hi,
Are you using the "old" or "new" style of makefiles? the .mk files in community do not export the ALLSRC and ALLINC variables required by new makefiles. You may need to add HALSRC HALINC etc to your makefile.
Giovanni
Are you using the "old" or "new" style of makefiles? the .mk files in community do not export the ALLSRC and ALLINC variables required by new makefiles. You may need to add HALSRC HALINC etc to your makefile.
Giovanni
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: ChibiOS 18.2.1 and community hal
vrollei wrote:Hi, Giovanni,
I use Makefile template with ALLSRC and ALLINC
You need to add the variables explored by the community .mk files (HALSRC, HALINC etc) to your Makefile like old makefiles did.
Giovanni
Re: ChibiOS 18.2.1 and community hal
Just had a similar issue.
This is my succesfull build for the testhal/STM32/STM32F1xx/qei example with ChibiOS 18.2.x:
Makefile
This is my succesfull build for the testhal/STM32/STM32F1xx/qei example with ChibiOS 18.2.x:
Makefile
Code: Select all
index 04abc5f..c85c379 100644
@@ -88,6 +88,8 @@ PROJECT = ch
# Imported source files and paths
CHIBIOS = ../../../../../chibios182
CHIBIOS_CONTRIB = $(CHIBIOS)/../chibios_community
+# Licensing files.
+include $(CHIBIOS)/os/license/license.mk
# Startup files.
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk
# HAL-OSAL files (optional).
@@ -108,13 +110,7 @@ LDSCRIPT= $(STARTUPLD)/STM32F103xB.ld
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
-CSRC = $(STARTUPSRC) \
- $(KERNSRC) \
- $(PORTSRC) \
- $(OSALSRC) \
- $(HALSRC) \
- $(PLATFORMSRC) \
- $(BOARDSRC) \
+CSRC = $(ALLCSRC) \
$(TESTSRC) \
main.c
@@ -143,12 +139,10 @@ TCSRC =
TCPPSRC =
# List ASM source files here
-ASMSRC =
-ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
+ASMSRC = $(ALLASMSRC)
+ASMXSRC = $(ALLXASMSRC)
-INCDIR = $(CHIBIOS)/os/license \
- $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
- $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
+INCDIR = $(ALLINC) $(TESTINC) \
$(CHIBIOS_CONTRIB)/os/various
#- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: ChibiOS 18.2.1 and community hal
The problem is that the community code is not updated with the rest, it is up to authors.
You should expect some rework to be required.
Giovanni
You should expect some rework to be required.
Giovanni
Re: ChibiOS 18.2.1 and community hal
Yes, the community code needs some more rework.
Currently I've updated the STM32F1xx to smart build system.
My intension is to use the QEI. Probably I will find some time to make a pull request.
How big is the chance that some subsystems like QEI will find to the main SVN?
Currently I've updated the STM32F1xx to smart build system.
My intension is to use the QEI. Probably I will find some time to make a pull request.
How big is the chance that some subsystems like QEI will find to the main SVN?
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: ChibiOS 18.2.1 and community hal
From what I remember there was nothing that could prevent inclusion except it is a quite a peculiar function.
Giovanni
Giovanni