ChibiOS 18.2.1 and community hal

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
vrollei
Posts: 104
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 5 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: 145
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 21 times
Been thanked: 18 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: 104
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 5 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: 11025
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 354 times
Been thanked: 298 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: 104
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 5 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: 11025
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 354 times
Been thanked: 298 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


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 1 guest