[SOLVED] Error compiling STM32duino on PlatformIO

Development environment specific, Arduino, Eclipse, VS2013,Em::Blocks etc
Post Reply
stanleyseow
Posts: 47
Joined: Sun Sep 27, 2015 3:26 am
Location: Kuala Lumpur, Malaysia
Contact:

[SOLVED] Error compiling STM32duino on PlatformIO

Post by stanleyseow » Fri Oct 13, 2017 1:32 pm

Tried the latest PlatformIO on Linux (cloud9) n mac OSX , getting the same error on compilation ...

Any idea why there were errors ?

Thanks


Code: Select all

Using a blank main.c :-
$ cat src/main.c
#include <Arduino.h>

void setup() {
}

void loop() {
}


$ pio run
[Fri Oct 13 21:30:17 2017] Processing genericSTM32F103C8 (platform: ststm32; board: genericSTM32F103C8; framework: arduino)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Collected 26 compatible libraries
Looking for dependencies...
Project does not have dependencies
Compiling .pioenvs/genericSTM32F103C8/src/main.o

[Fri Oct 13 12:58:02 2017] Processing genericSTM32F103C8 (platform: ststm32; board: genericSTM32F103C8; framework: arduino)

In file included from .platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/boards.h:38:0,
from .platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/wirish.h:54,
from .platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/Arduino.h:30,
from src/main.c:1:
.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/wirish_types.h:66:1: error: unknown type name 'bool'
typedef bool boolean;
^
In file included from .platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/wirish.h:54:0,
from .platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/Arduino.h:30,
from src/main.c:1:
.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/boards.h:111:1: error: unknown type name 'bool'
bool boardUsesPin(uint8 pin);
^
Last edited by stanleyseow on Sat Oct 14, 2017 3:07 pm, edited 1 time in total.
Stanley
9W2SVT / N5SVT

stevestrong
Posts: 1746
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Error compiling STM32duino on PlatformIO

Post by stevestrong » Fri Oct 13, 2017 2:31 pm

Please activate "verbose" in order to check the arguments passed to the compiler at build time, and post the output here.

stanleyseow
Posts: 47
Joined: Sun Sep 27, 2015 3:26 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Error compiling STM32duino on PlatformIO

Post by stanleyseow » Fri Oct 13, 2017 3:44 pm

Code: Select all

$ pio run -v
[Fri Oct 13 23:43:06 2017] Processing genericSTM32F103C8 (platform: ststm32; board: genericSTM32F103C8; framework: arduino)
--------------------------------------------------------------------------------
Collected 26 compatible libraries
Looking for dependencies...
Project does not have dependencies
arm-none-eabi-gcc -o .pioenvs/genericSTM32F103C8/src/main.o -c -g -Os -ffunction-sections -fdata-sections -Wall -mthumb -nostdlib -mcpu=cortex-m3 --param max-inline-insns-single=500 -march=armv7-m -DF_CPU=72000000L -DGENERIC_STM32F103C -DPLATFORMIO=30401 -DARDUINO_GENERIC_STM32F103C -DMCU_STM32F103C8 -DARDUINO=10610 -DBOARD_generic_stm32f103c -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -DDEBUG_LEVEL=DEBUG_NONE -D__STM32F1__ -DARDUINO_ARCH_STM32F1 -DVECT_TAB_ADDR=134217728 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/include -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/stm32f1 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/usb_lib -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c -Isrc src/main.c
In file included from /home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/boards.h:38:0,
from /home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/wirish.h:54,
from /home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/Arduino.h:30,
from src/main.c:1:
/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/wirish_types.h:66:1: error: unknown type name 'bool'
typedef bool boolean;
^
Stanley
9W2SVT / N5SVT

stevestrong
Posts: 1746
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Error compiling STM32duino on PlatformIO

Post by stevestrong » Fri Oct 13, 2017 5:14 pm

It seems that the path to core folders is missing.
You should add to .platformio\platforms\platform-ststm32\builder\frameworks\arduino\stm32duino.py
following

Code: Select all

	CPPPATH=[
			join(FRAMEWORK_DIR, "cores", board.get("build.core"), "libmaple"),
...
There are some threads regarding PlatformIO, you can read the whole thread:
viewtopic.php?f=41&t=728&start=40#p25531
viewtopic.php?f=41&t=728&start=50#p25832

stanleyseow
Posts: 47
Joined: Sun Sep 27, 2015 3:26 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Error compiling STM32duino on PlatformIO

Post by stanleyseow » Sat Oct 14, 2017 3:36 am

Thanks for pointing me to the right directions...

I shall figure out what is wrong n post the fixes/solution here for others in the future..

Edit, I replaced the below lines, the compile error was gone but new errors shows up ...

Code: Select all

    CPPPATH=[
# Manually changed
        join(FRAMEWORK_DIR, "cores", board.get("build.core"), "libmaple"),
#        join(FRAMEWORK_DIR, "cores", board.get("build.core")),
        join(FRAMEWORK_DIR, "system", "libmaple"),
        join(FRAMEWORK_DIR, "system", "libmaple", "include"),
        join(FRAMEWORK_DIR, "system", "libmaple", "usb", "stm32f1"),
        join(FRAMEWORK_DIR, "system", "libmaple", "usb", "usb_lib")
    ],
Compile errors :-

fatal error: Arduino.h: No such file or directory

Where are the settings for includes of Arduino.h ??

Code: Select all


Collected 26 compatible libraries
Looking for dependencies...
Project does not have dependencies
arm-none-eabi-gcc -o .pioenvs/genericSTM32F103C8/src/main.o -c -g -Os -ffunction-sections -fdata-sections -Wall -mthumb -nostdlib -mcpu=cortex-m3 --param max-inline-insns-single=500 -march=armv7-m -DF_CPU=72000000L -DGENERIC_STM32F103C -DPLATFORMIO=30401 -DARDUINO_GENERIC_STM32F103C -DMCU_STM32F103C8 -DARDUINO=10610 -DBOARD_generic_stm32f103c -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -DDEBUG_LEVEL=DEBUG_NONE -D__STM32F1__ -DARDUINO_ARCH_STM32F1 -DVECT_TAB_ADDR=134217728 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/include -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/stm32f1 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/usb_lib -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c -Isrc src/main.c
src/main.c:1:21: fatal error: Arduino.h: No such file or directory
#include <Arduino.h>
^
compilation terminated.
arm-none-eabi-g++ -o .pioenvs/genericSTM32F103C8/FrameworkArduinoVariant/board.o -c -fno-rtti -fno-exceptions -g -Os -ffunction-sections -fdata-sections -Wall -mthumb -nostdlib -mcpu=cortex-m3 --param max-inline-insns-single=500 -march=armv7-m -DF_CPU=72000000L -DGENERIC_STM32F103C -DPLATFORMIO=30401 -DARDUINO_GENERIC_STM32F103C -DMCU_STM32F103C8 -DARDUINO=10610 -DBOARD_generic_stm32f103c -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -DDEBUG_LEVEL=DEBUG_NONE -D__STM32F1__ -DARDUINO_ARCH_STM32F1 -DVECT_TAB_ADDR=134217728 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/include -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/stm32f1 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/usb_lib -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c /home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c/board.cpp
arm-none-eabi-g++ -o .pioenvs/genericSTM32F103C8/FrameworkArduinoVariant/wirish/boards.o -c -fno-rtti -fno-exceptions -g -Os -ffunction-sections -fdata-sections -Wall -mthumb -nostdlib -mcpu=cortex-m3 --param max-inline-insns-single=500 -march=armv7-m -DF_CPU=72000000L -DGENERIC_STM32F103C -DPLATFORMIO=30401 -DARDUINO_GENERIC_STM32F103C -DMCU_STM32F103C8 -DARDUINO=10610 -DBOARD_generic_stm32f103c -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -DDEBUG_LEVEL=DEBUG_NONE -D__STM32F1__ -DARDUINO_ARCH_STM32F1 -DVECT_TAB_ADDR=134217728 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/include -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/stm32f1 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/usb_lib -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c /home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c/wirish/boards.cpp
/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c/board.cpp:40:28: fatal error: HardwareSerial.h: No such file or directory
#include <HardwareSerial.h>
^
compilation terminated.
arm-none-eabi-g++ -o .pioenvs/genericSTM32F103C8/FrameworkArduinoVariant/wirish/boards_setup.o -c -fno-rtti -fno-exceptions -g -Os -ffunction-sections -fdata-sections -Wall -mthumb -nostdlib -mcpu=cortex-m3 --param max-inline-insns-single=500 -march=armv7-m -DF_CPU=72000000L -DGENERIC_STM32F103C -DPLATFORMIO=30401 -DARDUINO_GENERIC_STM32F103C -DMCU_STM32F103C8 -DARDUINO=10610 -DBOARD_generic_stm32f103c -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -DDEBUG_LEVEL=DEBUG_NONE -D__STM32F1__ -DARDUINO_ARCH_STM32F1 -DVECT_TAB_ADDR=134217728 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/include -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/stm32f1 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/usb_lib -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c /home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c/wirish/boards_setup.cpp
/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c/wirish/boards.cpp:48:20: fatal error: boards.h: No such file or directory
#include <boards.h>
^
compilation terminated.
/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c/wirish/boards_setup.cpp:37:28: fatal error: boards_private.h: No such file or directory
#include "boards_private.h"
^
compilation terminated.
arm-none-eabi-g++ -o .pioenvs/genericSTM32F103C8/FrameworkArduino/pwm.o -c -fno-rtti -fno-exceptions -g -Os -ffunction-sections -fdata-sections -Wall -mthumb -nostdlib -mcpu=cortex-m3 --param max-inline-insns-single=500 -march=armv7-m -DF_CPU=72000000L -DGENERIC_STM32F103C -DPLATFORMIO=30401 -DARDUINO_GENERIC_STM32F103C -DMCU_STM32F103C8 -DARDUINO=10610 -DBOARD_generic_stm32f103c -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -DDEBUG_LEVEL=DEBUG_NONE -D__STM32F1__ -DARDUINO_ARCH_STM32F1 -DVECT_TAB_ADDR=134217728 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/include -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/stm32f1 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/usb_lib -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c /home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/pwm.cpp
arm-none-eabi-g++ -o .pioenvs/genericSTM32F103C8/FrameworkArduino/stm32f1/wiring_pulse_f1.o -c -fno-rtti -fno-exceptions -g -Os -ffunction-sections -fdata-sections -Wall -mthumb -nostdlib -mcpu=cortex-m3 --param max-inline-insns-single=500 -march=armv7-m -DF_CPU=72000000L -DGENERIC_STM32F103C -DPLATFORMIO=30401 -DARDUINO_GENERIC_STM32F103C -DMCU_STM32F103C8 -DARDUINO=10610 -DBOARD_generic_stm32f103c -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -DDEBUG_LEVEL=DEBUG_NONE -D__STM32F1__ -DARDUINO_ARCH_STM32F1 -DVECT_TAB_ADDR=134217728 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/include -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/stm32f1 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/usb_lib -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c /home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/stm32f1/wiring_pulse_f1.cpp
In file included from /home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/pwm.cpp:38:0:
/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/boards.h:38:26: fatal error: wirish_types.h: No such file or directory
#include <wirish_types.h>
^
compilation terminated.
arm-none-eabi-g++ -o .pioenvs/genericSTM32F103C8/FrameworkArduino/stm32f1/wirish_debug.o -c -fno-rtti -fno-exceptions -g -Os -ffunction-sections -fdata-sections -Wall -mthumb -nostdlib -mcpu=cortex-m3 --param max-inline-insns-single=500 -march=armv7-m -DF_CPU=72000000L -DGENERIC_STM32F103C -DPLATFORMIO=30401 -DARDUINO_GENERIC_STM32F103C -DMCU_STM32F103C8 -DARDUINO=10610 -DBOARD_generic_stm32f103c -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -DDEBUG_LEVEL=DEBUG_NONE -D__STM32F1__ -DARDUINO_ARCH_STM32F1 -DVECT_TAB_ADDR=134217728 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/include -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/stm32f1 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/usb_lib -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c /home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/stm32f1/wirish_debug.cpp
/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/stm32f1/wiring_pulse_f1.cpp:1:26: fatal error: wiring_pulse.h: No such file or directory
#include <wiring_pulse.h>
^
compilation terminated.
*** [.pioenvs/genericSTM32F103C8/src/main.o] Error 1
*** [.pioenvs/genericSTM32F103C8/FrameworkArduinoVariant/board.o] Error 1
*** [.pioenvs/genericSTM32F103C8/FrameworkArduinoVariant/wirish/boards.o] Error 1
*** [.pioenvs/genericSTM32F103C8/FrameworkArduinoVariant/wirish/boards_setup.o] Error 1
arm-none-eabi-g++ -o .pioenvs/genericSTM32F103C8/FrameworkArduino/stm32f1/wirish_digital_f1.o -c -fno-rtti -fno-exceptions -g -Os -ffunction-sections -fdata-sections -Wall -mthumb -nostdlib -mcpu=cortex-m3 --param max-inline-insns-single=500 -march=armv7-m -DF_CPU=72000000L -DGENERIC_STM32F103C -DPLATFORMIO=30401 -DARDUINO_GENERIC_STM32F103C -DMCU_STM32F103C8 -DARDUINO=10610 -DBOARD_generic_stm32f103c -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -DDEBUG_LEVEL=DEBUG_NONE -D__STM32F1__ -DARDUINO_ARCH_STM32F1 -DVECT_TAB_ADDR=134217728 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/include -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/stm32f1 -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/system/libmaple/usb/usb_lib -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/variants/generic_stm32f103c /home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/stm32f1/wirish_digital_f1.cpp
*** [.pioenvs/genericSTM32F103C8/FrameworkArduino/pwm.o] Error 1
*** [.pioenvs/genericSTM32F103C8/FrameworkArduino/stm32f1/wiring_pulse_f1.o] Error 1
/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/stm32f1/wirish_debug.cpp:32:26: fatal error: wirish_debug.h: No such file or directory
#include <wirish_debug.h>
^
compilation terminated.
*** [.pioenvs/genericSTM32F103C8/FrameworkArduino/stm32f1/wirish_debug.o] Error 1
/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/stm32f1/wirish_digital_f1.cpp:32:16: fatal error: io.h: No such file or directory
#include <io.h>
^
compilation terminated.
*** [.pioenvs/genericSTM32F103C8/FrameworkArduino/stm32f1/wirish_digital_f1.o] Error 1

Stanley
9W2SVT / N5SVT

stanleyseow
Posts: 47
Joined: Sun Sep 27, 2015 3:26 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Error compiling STM32duino on PlatformIO

Post by stanleyseow » Sat Oct 14, 2017 7:01 am

After readings docs on platformio on build-flags http://docs.platformio.org/en/latest/pr ... uild-flags
I added build_flags = -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple
to platformio.ini AND rename the main.c to main.ino the compile is working now ....

Thanks

Summary fixes / changes :-

platformio.ini :-
Add this line :-
build_flags = -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple

Code: Select all

[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
build_flags = -I/home/mqtt/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple
~/.platformio/platforms/ststm32/builder/frameworks/arduino/stm32duino.py
Edit this line :-
join(FRAMEWORK_DIR, "cores", board.get("build.core"), "libmaple"),

Code: Select all

    CPPPATH=[
# Manually change, add "libmaple" to cores
        join(FRAMEWORK_DIR, "cores", board.get("build.core"), "libmaple"),
#        join(FRAMEWORK_DIR, "cores", board.get("build.core")),
        join(FRAMEWORK_DIR, "system", "libmaple"),
        join(FRAMEWORK_DIR, "system", "libmaple", "include"),
        join(FRAMEWORK_DIR, "system", "libmaple", "usb", "stm32f1"),
        join(FRAMEWORK_DIR, "system", "libmaple", "usb", "usb_lib")
    ],
Stanley
9W2SVT / N5SVT

stevestrong
Posts: 1746
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Error compiling STM32duino on PlatformIO

Post by stevestrong » Sat Oct 14, 2017 8:32 am

The first change is replaceable by

Code: Select all

   CPPPATH=[
# Manually change, add "libmaple" to cores
        join(FRAMEWORK_DIR, "cores", board.get("build.core")),
        join(FRAMEWORK_DIR, "cores", board.get("build.core"), "libmaple"),
        join(FRAMEWORK_DIR, "system", "libmaple"),
        join(FRAMEWORK_DIR, "system", "libmaple", "include"),
        join(FRAMEWORK_DIR, "system", "libmaple", "usb", "stm32f1"),
        join(FRAMEWORK_DIR, "system", "libmaple", "usb", "usb_lib")
    ],
So basically uncomment the commented line in stm32duino.py
So overall one added line here would solve the issue.

ubis
Posts: 9
Joined: Tue Jun 07, 2016 12:16 pm

Re: [SOLVED] Error compiling STM32duino on PlatformIO

Post by ubis » Thu Nov 09, 2017 10:49 am

Sorry for bumping old thread, but in fact, you don't need to change anything in stm32duino.py.
You're trying to compile main file with C compiler, hence the error:

Code: Select all

error: unknown type name 'bool'
because bool doesn't exist in C. You should just rename your

Code: Select all

main.c
to

Code: Select all

main.cpp
and that's it.

I've answered your issue about this in GitHub aswell https://github.com/platformio/platform- ... /issues/71.

Post Reply