Page 1 of 1

ChibiOS 18.2.1 and community hal

Posted: Wed Jun 27, 2018 3:05 pm
by vrollei
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

Re: ChibiOS 18.2.1 and community hal

Posted: Wed Jun 27, 2018 3:24 pm
by faisal
This is what should be in your makefile:

Code: Select all

include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F4xx/platform.mk


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:

Code: Select all

include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/ports/STM32/STM32L4xx/platform.mk


Post your makefile if that's not your issue.

Re: ChibiOS 18.2.1 and community hal

Posted: Wed Jun 27, 2018 3:29 pm
by vrollei
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

Re: ChibiOS 18.2.1 and community hal

Posted: Wed Jun 27, 2018 3:40 pm
by Giovanni
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

Re: ChibiOS 18.2.1 and community hal

Posted: Wed Jun 27, 2018 3:41 pm
by vrollei
Hi, Giovanni,

I use Makefile template with ALLSRC and ALLINC

Re: ChibiOS 18.2.1 and community hal

Posted: Wed Jun 27, 2018 9:10 pm
by Giovanni
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

Posted: Thu Sep 20, 2018 7:32 am
by wurstnase
Just had a similar issue.

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
 
 #

Re: ChibiOS 18.2.1 and community hal

Posted: Thu Sep 20, 2018 7:42 am
by Giovanni
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

Re: ChibiOS 18.2.1 and community hal

Posted: Thu Sep 20, 2018 9:53 am
by wurstnase
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?

Re: ChibiOS 18.2.1 and community hal

Posted: Thu Sep 20, 2018 11:55 am
by Giovanni
From what I remember there was nothing that could prevent inclusion except it is a quite a peculiar function.

Giovanni