PlatformIO Community

Build error under Win7 (linux ok)


#1

I’ve beed reported about build errors under Win 7, PIO 3.6. See log below.

Processing genericSTM32F103C8 (platform: ststm32@~4.4.0; board: genericSTM32F103C8; framework: stm32cube)
 
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 64MHz 20KB RAM (64KB Flash)
DEBUG: CURRENT(blackmagic) EXTERNAL(blackmagic, jlink, stlink)

Warning! Cannot find a linker script for the required board! Firmware will be linked with a default linker script!
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 3 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <libfixmath>
|-- <stm32cubemx_init>
Compiling .pioenvs\genericSTM32F103C8\libfc2\libfixmath_ID5575\libfixmath\fix16.o
Compiling .pioenvs\genericSTM32F103C8\libfc2\libfixmath_ID5575\libfixmath\fix16_exp.o
Compiling .pioenvs\genericSTM32F103C8\libfc2\libfixmath_ID5575\libfixmath\fix16_sqrt.o
Compiling .pioenvs\genericSTM32F103C8\libfc2\libfixmath_ID5575\libfixmath\fix16_str.o
Compiling .pioenvs\genericSTM32F103C8\libfc2\libfixmath_ID5575\libfixmath\fix16_trig.o
Compiling .pioenvs\genericSTM32F103C8\libfc2\libfixmath_ID5575\libfixmath\fract32.o
Compiling .pioenvs\genericSTM32F103C8\libfc2\libfixmath_ID5575\libfixmath\uint32.o
Compiling .pioenvs\genericSTM32F103C8\src\app.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_adc.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_adc_ex.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_can.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_cec.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_cortex.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_crc.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_dac.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_dac_ex.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_dma.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_eth.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_flash.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_flash_ex.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_gpio.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_gpio_ex.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_hcd.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_i2c.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_i2s.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_irda.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_iwdg.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_mmc.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_nand.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_nor.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_pccard.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_pcd.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_pcd_ex.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_pwr.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_rcc.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_rcc_ex.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_rtc.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_rtc_ex.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_sd.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_smartcard.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_spi.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_spi_ex.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_sram.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_tim.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_tim_ex.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_uart.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_usart.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_hal_wwdg.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_adc.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_crc.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_dac.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_dma.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_exti.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_fsmc.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_gpio.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_i2c.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_pwr.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_rcc.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_rtc.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_sdmmc.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_spi.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_tim.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_usart.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_usb.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkHALDriver\Src\stm32f1xx_ll_utils.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkCMSISDevice\gcc\startup_stm32f103xb.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkCMSISDevice\system_stm32f1xx.o
Archiving .pioenvs\genericSTM32F103C8\libFrameworkCMSISDevice.a
Archiving .pioenvs\genericSTM32F103C8\libFrameworkHALDriver.a
Linking .pioenvs\genericSTM32F103C8\firmware.elf
.pioenvs\genericSTM32F103C8\libFrameworkCMSISDevice.a(startup_stm32f103xb.o): In function `LoopFillZerobss':
(.text.Reset_Handler+0x2e): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
*** [.pioenvs\genericSTM32F103C8\firmware.elf] Error 1
 
 [SUMMARY]
 [ERROR] Took 3.16 seconds
Environment genericSTM32F103C8  [ERROR]
 [ERROR] Took 3.16 seconds
Environment test_native         [SKIP]

Under linux build works as expected. Can anyone confirm bug? If it’s something known, may be workaround available?


#2

It doesn’t build the stm32cubemx_init lib. This lib of yours has the folders named Src/ and Inc/. It may work under Linux because of a difference in filesystem case-insensitivity. Did you try to renamde them to src/ and inc/?


#3

Thank you for pointing the root of problem!

Those folders are auto-generated by CubeMX java tool. If i change those to lower case, it will be impossible to load content back into CubeMX for update.

Is there any alternative way to fix? May be some change in configs?


#4

Welp, false alarm still doesn’t build after folder rename. I’ll look into it.


#5

See if https://github.com/speedcontrols/ac_sc_grinder/pull/2 works for Win&Linux. There was a problem with the srcFilter, as soon as I removed it was compiling everything (but also system_stm32f1xx.c). I then found out that this works, srcFilter as a string, first add all *.c files then remove the unwanted file, and with all paths relative to actually the ´Src/` folder.


#6

That PR introduced another problem - broken linux build :). Did not tested under Win.


#7

Installed Windows in VirtualBox and found workaround for both platforms:

IMHO that’s a bug in PIO, but not fatal.