Psi
September 4, 2019, 2:45pm
1
Hi,
I’ve a project wich does not compile with PIO but with Arduino IDE so I’m looking for the right platformio.ini settings.
Arduino IDE:
I’ve tried various combinations with
platform = ststm32
framework = arduino
board = bluepill_f103c8
board = genericSTM32F103CB
board_build.core = maple
board_build.core = stm32
But I always get some or more compile errors for this sketch
//- -----------------------------------------------------------------------------------------------------------------------
// AskSin++
// 2018-08-09 papa Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
// ci-test=yes board=bluepill aes=no
//- -----------------------------------------------------------------------------------------------------------------------
// define this to read the device id, serial and device type from bootloader section
// #define USE_OTA_BOOTLOADER
#define STORAGEDRIVER at24cX<0x50,128,32>
#define TICKS_PER_SECOND 500UL
// Derive ID and Serial from the device UUID
#define USE_HW_SERIAL
#include <SPI.h> // when we include SPI.h - we can use LibSPI class
#include <Wire.h>
#include <EEPROM.h> // the EEPROM library contains Flash Access Methods
#include <OneWireSTM.h>
#include <AskSinPP.h>
This file has been truncated. show original
You can get it to compile with three changes:
Rename the .ino
file to main.cpp
(optional but recommended)
Insert #include <Arduino.h>
at the top of the file
Use the below platformio.ini
file:
[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
lib_deps =
https://github.com/pa-pa/AskSinPP.git
2 Likes
Psi
September 5, 2019, 7:49am
3
Thx for your fast answer!
Sadly there is still a problem with LowPower:
.pio/libdeps/genericSTM32F103C8/AskSinPP_ID2900/AlarmClock.h:204:4: warning: #warning "RTC not supported" [-Wcpp]
#warning "RTC not supported"
^~~~~~~
Compiling .pio/build/genericSTM32F103C8/lib197/EEPROM/EEPROM.cpp.o
In file included from ~/.platformio/lib/Low-Power_ID38/LowPower.cpp:47:0:
~/.platformio/lib/Low-Power_ID38/LowPower.h:162:6: error: #error "Please ensure chosen MCU is ATSAMD21G18A."
#error "Please ensure chosen MCU is ATSAMD21G18A."
^~~~~
~/.platformio/lib/Low-Power_ID38/LowPower.cpp:1189:3: error: #error "Please ensure chosen MCU is ATSAMD21G18A."
#error "Please ensure chosen MCU is ATSAMD21G18A."
^~~~~
The program you have described intially does not use the Lower Power library. So it looks as if we are talking about a different program now. Can you add the source code incl. platformio.ini
?
Psi
September 5, 2019, 9:45am
5
You’re right, I’ve pasted the errors from the wrong Sketch but the linked one HM-DW-WM.ino
is the same.
[platformio]
src_dir = .
[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
lib_deps =
AskSinPP
and the main.cpp
is same as the one from the github repo with ´#include <Arduino.h>´ inserted.
// #define USE_OTA_BOOTLOADER
#include <Arduino.h>
#define STORAGEDRIVER at24cX<0x50,128,32>
#define TICKS_PER_SECOND 500UL
#define USE_HW_SERIAL
...
Here is the full log: https://pastebin.com/RBBKitZB
I’m afraid I can’t reprodcue the problem.
For reasons that I don’t understand PlatformIO identifies Low-Power as a dependency. However, the library is not compatible with the STM32 architecture and not needed for this Arduino sketch. And it shouldn’t be included because the AskSinPP library only includes it for compatible architectures.
In my environment, it’s not identified as a dependency and therefore works.
Have you installed the library manually before? Can you delete the directory /home/psi/.platformio/lib/Low-Power_ID38
and try building again (and run the Clean task first)?
1 Like
Psi
September 5, 2019, 11:46am
7
Yay! I removed the ~/.platformio
and ./.pio
and now it compiles flawlessly!
Thank you very much!
1 Like