PlatformIO not longer working with MySensors



  • Hello,

    after some updates MySensors not longer working with MySensors.
    Here are the error:

    Linking .pioenvs\genericSTM32F103C8\firmware.elf
    .pioenvs\genericSTM32F103C8\src\main.cpp.o: In function premain()': main.cpp:(.text.startup._Z7premainv+0x0): multiple definition of premain()'
    .pioenvs\genericSTM32F103C8\FrameworkArduino\main.cpp.o:main.cpp:(.text.startup._Z7premainv+0x0): first defined here
    .pioenvs\genericSTM32F103C8\src\main.cpp.o: In function main': main.cpp:(.text.startup.main+0x0): multiple definition of main'
    .pioenvs\genericSTM32F103C8\FrameworkArduino\main.cpp.o:main.cpp:(.text.startup.main+0x0): first defined here
    collect2.exe: error: ld returned 1 exit status
    *** [.pioenvs\genericSTM32F103C8\firmware.elf] Error 1
    ===================================================== [ERROR] Took 30.84 seconds =====================================================
    The terminal process terminated with exit code: 1

    I don't know if it is an error from PlatformIO or from MySensors. My other projects without MySensors Library are working fine.

    Best regards

    Elmar



  • @fishermans, I would look into this for you but I do not have enough information to be able to reproduce your error.

    The error looks a little strange. Please post the contents of your platformio.ini.

    As a first hipshot, I would try removing .pioenvs and then compile and upload your blobs.

    HTH



  • Hello,

    thank you for your help. I remove the .pioenvs folder and get the following messages:

    Executing task in folder DimmerLED: C:\Users\elmar faber.platformio\penv\Scripts\platformio.exe run <

    Processing genericSTM32F103C8 (framework: arduino; platform: ststm32; board: genericSTM32F103C8)

    Verbose mode can be enabled via -v, --verbose option
    CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/genericSTM32F103C8.html
    PLATFORM: ST STM32 > STM32F103C8 (20k RAM. 64k Flash)
    HARDWARE: STM32F103C8T6 72MHz 20KB RAM (64KB Flash)
    DEBUG: CURRENT(blackmagic) EXTERNAL(blackmagic, jlink, stlink)
    Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF MODES: FINDER(chain) COMPATIBILITY(soft)
    Collected 84 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- <MySensors> 2.3.2-beta #7d907d1
    | |-- <Wire> 1.0
    | |-- <SdFat> 1.1.0
    | | |-- <SPI> 1.0
    | |-- <EEPROM>
    | |-- <SPI> 1.0
    | |-- <Time> 1.5
    |-- <MySNodeID>
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduinoVariant\board.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduinoVariant\wirish\boards.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduinoVariant\wirish\boards_setup.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduinoVariant\wirish\start.S.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduinoVariant\wirish\start_c.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduinoVariant\wirish\syscalls.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\HardwareSerial.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\HardwareTimer.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\IPAddress.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\Print.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\Stream.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\WString.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\avr\dtostrf.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\cxxabi-compat.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\ext_interrupts.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\hooks.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\itoa.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\adc.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\adc_f1.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\bkp_f1.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\dac.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\dma.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\dma_f1.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\exc.S.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\exti.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\exti_f1.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\flash.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\fsmc_f1.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\gpio.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\gpio_f1.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\i2c.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\i2c_f1.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\iwdg.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\nvic.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\pwr.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\rcc.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\rcc_f1.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\spi.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\spi_f1.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\stm32f1\performance\isrs.S.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\stm32f1\performance\vector_table.S.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\systick.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\timer.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\timer_f1.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\usart.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\usart_f1.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\usart_private.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\usb\stm32f1\usb.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\usb\stm32f1\usb_cdcacm.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\usb\stm32f1\usb_reg_map.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\usb\usb_lib\usb_core.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\usb\usb_lib\usb_init.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\usb\usb_lib\usb_mem.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\usb\usb_lib\usb_regs.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\util.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\main.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\new.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\pwm.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\sdio.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\stm32f1\util_hooks.c.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\stm32f1\wiring_pulse_f1.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\stm32f1\wirish_debug.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\stm32f1\wirish_digital_f1.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\tone.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\usb_serial.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\wirish_analog.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\wirish_digital.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\wirish_math.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\wirish_shift.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\wirish_time.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\src\main.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\lib7e7\Wire\SoftWire.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\lib7e7\Wire\Wire.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\lib7e7\Wire\utility\WireBase.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libaed\SPI\SPI.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\FatLib\FatFile.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\FatLib\FatFileLFN.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\FatLib\FatFilePrint.cpp.o
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src\SPI.cpp: In member function 'uint16_t SPIClass::transfer16(uint16_t) const':
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src\SPI.cpp:379:5: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
    while (spi_is_busy(spi_d) != 0); // wait until BSY=0
    ^~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src\SPI.cpp:380:2: note: ...this statement, but the latter is misleadingly
    indented as if it were guarded by the 'while'
    uint16_t ret = spi_rx_reg(spi_d)<<8; // read and shift high byte
    ^~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src\SPI.cpp:383:5: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
    while (spi_is_busy(spi_d) != 0); // wait until BSY=0
    ^~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src\SPI.cpp:384:2: note: ...this statement, but the latter is misleadingly
    indented as if it were guarded by the 'while'
    ret += spi_rx_reg(spi_d); // read low byte
    ^~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src\SPI.cpp: In function 'spi_baud_rate determine_baud_rate(spi_dev*, uint32_t)':
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src\SPI.cpp:762:12: warning: enumeration value 'RCC_AHB' not handled in switch [-Wswitch]
    switch (rcc_dev_clk(dev->clk_id))
    ^
    In file included from .piolibdeps\MySensors/hal/architecture/STM32F1/MyHwSTM32F1.h:26:0,
    from .piolibdeps\MySensors/hal/architecture/STM32F1/MyHwSTM32F1.cpp:20,
    from .piolibdeps\MySensors/MySensors.h:70,
    from src\main.cpp:23:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\FatLib\FatFileSFN.cpp.o
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SdCard/SdSpiCard.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/BlockDriver.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatVolume.h:34,
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\FatLib\FatVolume.cpp.ofrom C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFile.h:38,

    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFilePrint.cpp:26:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SdCard/SdSpiCard.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/BlockDriver.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatVolume.h:34,
    fArom C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFile.h:38,rchiving .pioenvs\genericSTM32F103C8\lib7e7\libWire.a

    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFileLFN.cpp:25:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SdCard/SdSpiCard.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/BlockDriver.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatVolume.h:34,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFile.h:38,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFile.cpp:25:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    Indexing .pioenvs\genericSTM32F103C8\lib7e7\libWire.a
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\FatLib\FmtNumber.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\FatLib\StdioStream.cpp.o
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SdCard/SdSpiCard.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/BlockDriver.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatVolume.h:34,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFile.h:38,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFileSFN.cpp:25:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SdCard/SdSpiCard.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/BlockDriver.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatVolume.h:34,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatVolume.cpp:26:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    Archiving .pioenvs\genericSTM32F103C8\libaed\libSPI.a
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\FatLib\fstream.cpp.o
    Indexing .pioenvs\genericSTM32F103C8\libaed\libSPI.a
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\FatLib\istream.cpp.o
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SdCard/SdSpiCard.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/BlockDriver.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatVolume.h:34,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFile.h:38,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\StdioStream.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\StdioStream.cpp:25:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\FatLib\ostream.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\MinimumSerial.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\SdCard\SdSpiCard.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\SdCard\SdSpiCardEX.cpp.o
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SdCard/SdSpiCard.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/BlockDriver.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatVolume.h:34,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFile.h:38,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\ios.h:27,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\istream.h:31,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\istream.cpp:28:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SdCard/SdSpiCard.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/BlockDriver.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatVolume.h:34,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFile.h:38,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\fstream.h:31,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\fstream.cpp:25:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SdCard/SdSpiCard.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/BlockDriver.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatVolume.h:34,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\FatFile.h:38,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\ios.h:27,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\ostream.h:31,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\FatLib\ostream.cpp:26:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\SdCard\SdioCardEX.cpp.oIn file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,

    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SdCard\SdSpiCard.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SdCard\SdSpiCard.cpp:25:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\MinimumSerial.cpp:25:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\SdCard\SdioTeensy.cpp.o
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SdCard\SdSpiCard.h:32,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SdCard\SdSpiCardEX.cpp:25:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\SpiDriver\SdSpiESP8266.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\SpiDriver\SdSpiParticle.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\SpiDriver\SdSpiSAM3X.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\SpiDriver\SdSpiSTM32.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\libe7f\SdFat_ID322\SpiDriver\SdSpiTeensy3.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\lib7a1\EEPROM\EEPROM.cpp.o
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src/SysCall.h:33:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SdCard\SdioCard.h:27,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SdCard\SdioCardEX.cpp:25:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    Compiling .pioenvs\genericSTM32F103C8\lib7a1\EEPROM\flash_stm32.c.o
    Compiling .pioenvs\genericSTM32F103C8\lib608\Time_ID44\DateStrings.cpp.o
    Compiling .pioenvs\genericSTM32F103C8\lib608\Time_ID44\Time.cpp.o
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SpiDriver\SdSpiDriver.h:32:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SpiDriver\SdSpiSAM3X.cpp:25:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SpiDriver\SdSpiDriver.h:32:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SpiDriver\SdSpiSTM32.cpp:26:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    Compiling .pioenvs\genericSTM32F103C8\lib776\MySensors\MyASM.S.o
    C:\users\elmar faber.platformio\lib\Time_ID44\DateStrings.cpp: In function 'char* monthStr(uint8_t)':
    C:\users\elmar faber.platformio\lib\Time_ID44\DateStrings.cpp:19:60: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    #define pgm_read_word(addr) ((const unsigned char *)(addr))
    ^
    C:\users\elmar faber.platformio\lib\Time_ID44\DateStrings.cpp:20:45: note: in definition of macro 'strcpy_P'
    #define strcpy_P(dest, src) strcpy((dest), (src))
    ^~~
    C:\users\elmar faber.platformio\lib\Time_ID44\DateStrings.cpp:72:29: note: in expansion of macro 'pgm_read_word'
    strcpy_P(buffer, (PGM_P)pgm_read_word(&(monthNames_P[month])));
    ^~~~~~~~~~~~~
    C:\users\elmar faber.platformio\lib\Time_ID44\DateStrings.cpp: In function 'char
    dayStr(uint8_t)':
    C:\users\elmar faber.platformio\lib\Time_ID44\DateStrings.cpp:19:60: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    #define pgm_read_word(addr) (
    (const unsigned char **)(addr))
    ^
    C:\users\elmar faber.platformio\lib\Time_ID44\DateStrings.cpp:20:45: note: in definition of macro 'strcpy_P'
    #define strcpy_P(dest, src) strcpy((dest), (src))
    ^~~
    C:\users\elmar faber.platformio\lib\Time_ID44\DateStrings.cpp:86:28: note: in expansion of macro 'pgm_read_word'
    strcpy_P(buffer, (PGM_P)pgm_read_word(&(dayNames_P[day])));
    ^~~~~~~~~~~~~
    Archiving .pioenvs\genericSTM32F103C8\lib56a\libMySNodeID.a
    Indexing .pioenvs\genericSTM32F103C8\lib56a\libMySNodeID.a
    In file included from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SpiDriver\SdSpiDriver.h:32:0,
    from C:\users\elmar faber.platformio\lib\SdFat_ID322\src\SpiDriver\SdSpiTeensy3.cpp:25:
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
    static void (*_spi2_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
    static void (*_spi1_this);
    ^~~~~~~~~~
    C:\users\elmar faber.platformio\packages\framework-arduinoststm32-maple\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
    static uint8_t ff = 0XFF;
    ^~
    Archiving .pioenvs\genericSTM32F103C8\lib776\libMySensors.a
    Archiving .pioenvs\genericSTM32F103C8\libe7f\libSdFat_ID322.a
    Indexing .pioenvs\genericSTM32F103C8\lib776\libMySensors.a
    Indexing .pioenvs\genericSTM32F103C8\libe7f\libSdFat_ID322.a
    Archiving .pioenvs\genericSTM32F103C8\lib7a1\libEEPROM.a
    Archiving .pioenvs\genericSTM32F103C8\lib608\libTime_ID44.a
    Indexing .pioenvs\genericSTM32F103C8\lib7a1\libEEPROM.a
    Indexing .pioenvs\genericSTM32F103C8\lib608\libTime_ID44.a
    Linking .pioenvs\genericSTM32F103C8\firmware.elf
    .pioenvs\genericSTM32F103C8\src\main.cpp.o: In function premain()': main.cpp:(.text.startup._Z7premainv+0x0): multiple definition of premain()'
    .pioenvs\genericSTM32F103C8\FrameworkArduino\main.cpp.o:main.cpp:(.text.startup._Z7premainv+0x0): first defined here
    .pioenvs\genericSTM32F103C8\src\main.cpp.o: In function main': main.cpp:(.text.startup.main+0x0): multiple definition of main'
    .pioenvs\genericSTM32F103C8\FrameworkArduino\main.cpp.o:main.cpp:(.text.startup.main+0x0): first defined here
    collect2.exe: error: ld returned 1 exit status
    *** [.pioenvs\genericSTM32F103C8\firmware.elf] Error 1
    ======================================================================= [ERROR] Took 7.30 seconds =======================================================================
    The terminal process terminated with exit code: 1

    Terminal will be reused by tasks, press any key to close it.

    Yesterday I found a solution:

    If I change the following line

    // #include <MySensors.h>
    #include <core/MySensorsCore.h>

    then I could compile the code.

    Best regards

    Elmar



  • Hi Elmar

    You probably need to peg the version of MySensors to an older one.

    See some examples here:
    https://github.com/oneyb/template-mysensors-platformio/blob/master/platformio.ini

    Again, please post the contents of your platformio.ini file
    Best wishes



  • Hello,
    oh ok I forgot the platformio.ini 😳 😳 😳

    [env:genericSTM32F103C8]
    platform = ststm32
    board = genericSTM32F103C8
    framework = arduino

    lib_extra_dirs = D:\Dropbox\Elektronik\platformio\libraries

    lib_deps = https://github.com/mysensors/MySensors.git#development

    upload_protocol = stlink

    Best regards



  • Dropping this here for future searchers:

    I'm seeing this with the platformio framework-arduinoststm32-maple framework as well.
    The problem appears to be multiple definitions of premain() and main(). I suspect one should be marked with the "weak" attribute to allow the other to override as needed. Though the question is which one?
    (NOTE: I'm not sure if the Arduino compiler/linker know/care about "weak")

    I'm new to the platformio so am having trouble sorting out what is coming from where in order to know who to ask about this. I'm suspecting its the stm32duino folks.

    Take a look at this forum comment where I've shown the syntax for the "weak" attribute if interested in going this route.


Log in to reply
 

Suggested Topics

  • 3
  • 1
  • 2
  • 5

60
Online

11.4k
Users

11.1k
Topics

112.6k
Posts