STM32F1 build failing with "duplicate 'inline'" errors

For the last few days all our Travis CI builds for STM32F1 have been failing with the following errors:

In file included from /home/travis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/stdlib.h:19,
from /home/travis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/8.2.1/cstdlib:75,
from /home/travis/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/8.2.1/stdlib.h:36,
from /home/travis/.platformio/packages/framework-arduinoststm32@2.1.180219/STM32F1/cores/maple/wirish.h:41,
from /home/travis/.platformio/packages/framework-arduinoststm32@2.1.180219/STM32F1/cores/maple/Arduino.h:30,
from Marlin/src/HAL/HAL_STM32F1/HAL.h:41,
from Marlin/src/HAL/HAL_STM32F1/HAL.cpp:34:
/home/travis/.platformio/packages/framework-arduinoststm32@2.1.180219/STM32F1/system/libmaple/stm32f1/include/series/gpio.h:487:15: error: duplicate 'inline'
static inline __always_inline void afio_exti_select(exti_num exti, exti_cfg port) {
^~~~~~~~~~~~~~~
/home/travis/.platformio/packages/framework-arduinoststm32@2.1.180219/STM32F1/system/libmaple/include/libmaple/nvic.h:112:15: error: duplicate 'inline'
static inline __always_inline void nvic_globalirq_enable() {
^~~~~~~~~~~~~~~
/home/travis/.platformio/packages/framework-arduinoststm32@2.1.180219/STM32F1/system/libmaple/include/libmaple/nvic.h:119:15: error: duplicate 'inline'
static inline __always_inline void nvic_globalirq_disable() {
^~~~~~~~~~~~~~~
/home/travis/.platformio/packages/framework-arduinoststm32@2.1.180219/STM32F1/cores/maple/ext_interrupts.h:109:15: error: duplicate 'inline'
static inline __always_inline void interrupts() {
^~~~~~~~~~~~~~~
/home/travis/.platformio/packages/framework-arduinoststm32@2.1.180219/STM32F1/cores/maple/ext_interrupts.h:123:15: error: duplicate 'inline'
static inline __always_inline void noInterrupts() {
^~~~~~~~~~~~~~~
compilation terminated due to -fmax-errors=5.
*** [.pioenvs/STM32F1/src/src/HAL/HAL_STM32F1/HAL.cpp.o] Error 1

For example: Travis CI - Test and Deploy Your Code with Confidence

This appears to be a problem with the arduinoststm32 framework itself. Is there any way we can revert to an earlier version of the framework to get our tests passing again?

Seems to be a problem with the order of our includes. We’ll sort out the dependency spaghetti and figure out what’s (probably) defining __always_inline as inline ahead of the problem include.

I also have this problem. Have you solved it?

Further testing has narrowed it down to the platform. It doesn’t appear to be framework-arduinoststm32@2.1.180219 because earlier builds (last week) which were passing were apparently also using 2.1.180219. I re-started some Travis CI builds from last week which had already passed, and they also now fail with the duplicate inline error.

So, maybe one of the other frameworks or libraries was updated, or maybe the default build flags were changed. In any case, we can’t find the exact cause, and it is out of our hands. We have simply disabled STM32F1 build testing for now. Hopefully this will be narrowed down to a specific change among the platforms and get patched soon.

I solved the problem temporarily.you can try to install the platform from [the development branch],
like this :
[env:genericSTM32F103ZE]

platform = GitHub - platformio/platform-ststm32: ST STM32: development platform for PlatformIO

;platform = ststm32

framework = arduino

board = genericSTM32F103ZE

Fixed in upstream version ST STM32 — PlatformIO latest documentation

1 Like

Has this been resolved? I am still hitting it.

has this been resolved for Marlin builds?

All is well now with Marlin’s STM32 Travis CI builds. Thanks!

platform = ststm32@<4.4.0

still gives me duplicate inline errors.

What does Travis use?

Our .travis.yml installs PIO using pip install with the master branch straight from GitHub.

1 Like