ChibiOS 18.2.1 and community hal

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

ChibiOS 18.2.1 and community hal

Postby vrollei » Wed Jun 27, 2018 3:05 pm

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
Vitaly

faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

Re: ChibiOS 18.2.1 and community hal

Postby faisal » Wed Jun 27, 2018 3:24 pm

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.

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: ChibiOS 18.2.1 and community hal

Postby vrollei » Wed Jun 27, 2018 3:29 pm

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
Vitaly

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

Re: ChibiOS 18.2.1 and community hal

Postby Giovanni » Wed Jun 27, 2018 3:40 pm

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

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: ChibiOS 18.2.1 and community hal

Postby vrollei » Wed Jun 27, 2018 3:41 pm

Hi, Giovanni,

I use Makefile template with ALLSRC and ALLINC
Vitaly

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

Re: ChibiOS 18.2.1 and community hal

Postby Giovanni » Wed Jun 27, 2018 9:10 pm

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

User avatar
wurstnase
Posts: 121
Joined: Tue Oct 17, 2017 2:24 pm
Has thanked: 43 times
Been thanked: 30 times
Contact:

Re: ChibiOS 18.2.1 and community hal

Postby wurstnase » Thu Sep 20, 2018 7:32 am

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
 
 #
\o/ Nico

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

Re: ChibiOS 18.2.1 and community hal

Postby Giovanni » Thu Sep 20, 2018 7:42 am

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

User avatar
wurstnase
Posts: 121
Joined: Tue Oct 17, 2017 2:24 pm
Has thanked: 43 times
Been thanked: 30 times
Contact:

Re: ChibiOS 18.2.1 and community hal

Postby wurstnase » Thu Sep 20, 2018 9:53 am

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?
\o/ Nico

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

Re: ChibiOS 18.2.1 and community hal

Postby Giovanni » Thu Sep 20, 2018 11:55 am

From what I remember there was nothing that could prevent inclusion except it is a quite a peculiar function.

Giovanni


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 7 guests