Hi! I am trying to build ChibiOS based app with platformio. I created new project based on cube32 framework. I need to remove cube part from the build, but dont know how to properly remove it from the build scripts. What is the proper way to build it?
platformio.ini content:
[env:bluepill_f103c8]
platform = ststm32
board = bluepill_f103c8
framework = stm32cube
board_build.ldscript = $PROJECT_DIR/include/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103x8.ld
build_flags =
-DUSE_LINK_GC=yes
-DUSE_LTO=yes
-DUSE_SMART_BUILD=yes
-Wl,--defsym=__process_stack_size__=0x400
-Wl,--defsym=__main_stack_size__=0x400
-L$PROJECT_DIR/include/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/ld
-I$PROJECT_DIR/include/cfg
-I$PROJECT_DIR/include/ChibiOS/os/common/ports/ARMCMx
-I$PROJECT_DIR/include/ChibiOS/os/common/ports/ARMCMx/compilers/GCC
-I$PROJECT_DIR/include/ChibiOS/os/common/startup/ARMCMx/devices/STM32F1xx
-I$PROJECT_DIR/include/ChibiOS/os/rt/include
-I$PROJECT_DIR/include/ChibiOS/os/oslib/include
-I$PROJECT_DIR/include/ChibiOS/os/hal/include
-I$PROJECT_DIR/include/ChibiOS/os/hal/osal/rt-nil
-I$PROJECT_DIR/include/ChibiOS/os/hal/ports/STM32/STM32F1xx
-I$PROJECT_DIR/include/ChibiOS/os/hal/ports/STM32/LLD
-I$PROJECT_DIR/include/ChibiOS/os/hal/ports/STM32/LLD/DMAv1
-I$PROJECT_DIR/include/ChibiOS/os/hal/ports/STM32/LLD/TIMv1
-I$PROJECT_DIR/include/ChibiOS/os/hal/ports/STM32/LLD/GPIOv1
-I$PROJECT_DIR/include/ChibiOS/os/hal/boards/STM32F103C8_MINIMAL
-I$PROJECT_DIR/include/ChibiOS/os/hal/ports/Common/ARMCMx
-I$PROJECT_DIR/include/ChibiOS/os/license
main.c content:
#include "ch.h"
#include "hal.h"
static THD_WORKING_AREA(waThread1, 0);
static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
GPIOv1
while (true) {
chThdSleepMilliseconds(500);
}
}
int main(void) {
halInit();
chSysInit();
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO + 1, Thread1, NULL);
while (true) {
chThdSleepSeconds(1);
}
return 0;
}
build log:
Executing task: C:\Users\ionbuggy\.platformio\penv\Scripts\platformio.exe run <
Processing bluepill_f103c8 (platform: ststm32; board: bluepill_f103c8; framework: stm32cube)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/bluepill_f103c8.html
PLATFORM: ST STM32 (8.1.0) > BluePill F103C8
HARDWARE: STM32F103C8T6 72MHz, 20KB RAM, 64KB Flash
DEBUG: Current (stlink) External (blackmagic, jlink, stlink)
PACKAGES:
- framework-stm32cube 2.0.200813
- tool-ldscripts-ststm32 0.1.0
- toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 11 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <BSP-lis302dl>
| |-- <BSP-Common>
Building in release mode
Compiling .pio\build\bluepill_f103c8\src\main.o
Archiving .pio\build\bluepill_f103c8\lib308\libCommon.a
Compiling .pio\build\bluepill_f103c8\lib422\lis302dl\lis302dl.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_adc.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_adc_ex.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_can.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_cec.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_cortex.o
In file included from include\ChibiOS\os\hal\include/hal.h:29:0,
from src\main.c:2:
include\ChibiOS\os\hal\boards\STM32F103C8_MINIMAL/board.h:45:0: warning: "STM32F103xB" redefined
#define STM32F103xB
<command-line>:0:0: note: this is the location of the previous definition
Archiving .pio\build\bluepill_f103c8\lib422\liblis302dl.a
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_crc.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_dac.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_dac_ex.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_dma.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_eth.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_exti.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_flash.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_flash_ex.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_gpio.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_gpio_ex.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_hcd.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_i2c.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_i2s.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_irda.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_iwdg.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_mmc.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_nand.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_nor.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_pccard.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_pcd.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_pcd_ex.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_pwr.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_rcc.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_rcc_ex.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_rtc.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_rtc_ex.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_sd.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_smartcard.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_spi.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_sram.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_tim.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_tim_ex.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_uart.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_usart.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_hal_wwdg.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_adc.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_crc.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_dac.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_dma.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_exti.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_fsmc.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_gpio.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_i2c.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_pwr.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_rcc.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_rtc.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_sdmmc.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_spi.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_tim.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_usart.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_usb.o
Compiling .pio\build\bluepill_f103c8\FrameworkHALDriver\Src\stm32f1xx_ll_utils.o
Compiling .pio\build\bluepill_f103c8\FrameworkCMSISDevice\gcc\startup_stm32f103xb.o
Compiling .pio\build\bluepill_f103c8\FrameworkCMSISDevice\system_stm32f1xx.o
Archiving .pio\build\bluepill_f103c8\libFrameworkCMSISDevice.a
Archiving .pio\build\bluepill_f103c8\libFrameworkHALDriver.a
Linking .pio\build\bluepill_f103c8\firmware.elf
.pio\build\bluepill_f103c8\src\main.o: In function `Thread1':
main.c:(.text.Thread1+0xe): undefined reference to `chThdSleep'
main.c:(.text.Thread1+0x14): undefined reference to `ch'
.pio\build\bluepill_f103c8\src\main.o: In function `main':
main.c:(.text.startup.main+0x2): undefined reference to `halInit'
main.c:(.text.startup.main+0x6): undefined reference to `chSysInit'
main.c:(.text.startup.main+0x16): undefined reference to `chThdCreateStatic'
main.c:(.text.startup.main+0x1e): undefined reference to `chThdSleep'
.pio\build\bluepill_f103c8\libFrameworkCMSISDevice.a(startup_stm32f103xb.o): In function `LoopFillZerobss':
(.text.Reset_Handler+0x34): undefined reference to `_sidata'
(.text.Reset_Handler+0x38): undefined reference to `_sdata'
(.text.Reset_Handler+0x40): undefined reference to `_sbss'
(.text.Reset_Handler+0x44): undefined reference to `_ebss'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\bluepill_f103c8\firmware.elf] Error 1