I’m trying to work with an SD card on the bluepill_f103c8 with the mbed framework but the program can’t be compiled. I reduced the code so it’s easier to reproduce the issue.
Main.cpp:
#include <mbed.h>
#include "FATFileSystem.h"
#include "SDBlockDevice.h"
SDBlockDevice sd(B15 ,B14,B13,B12);
FATFileSystem fs("sd", &sd);
Serial pc(B6,B7,57600);//TX, RX,BAUD RATE
int main()
{
// put your setup code here, to run once:
pc.printf("START\n");
while(1) {
// put your main code here, to run repeatedly:
}
}
Platformio.ini:
[env:bluepill_f103c8]
platform = ststm32
board = bluepill_f103c8
framework = mbed
build_flags = -DDEVICE_RTC=1 -D PIO_FRAMEWORK_MBED_RTOS_PRESENT -D PIO_FRAMEWORK_MBED_EVENTS_PRESENT -D PIO_FRAMEWORK_MBED_FILESYSTEM_PRESENT
(while not all of these flags are used in the code i need them for what i’m going to do)
Console output with verbose :
[04/20/18 12:44:56] Processing bluepill_f103c8 (platform: ststm32; build_flags: -DDEVICE_RTC=1 -D PIO_FRAMEWORK_MBED_RTOS_PRESENT; board: bluepill_f103c8; framework: mbed)
PLATFORM: ST STM32 > BluePill F103C8
SYSTEM: 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(light)
Collected 19 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <mbed-rtos> (C:\.platformio\packages\framework-mbed\rtos)
|-- <SDBlockDevice> (C:\Users\?scar Garc?a\Documents\Semestre 9\Makerlab\Test\lib\SDBlockDevice)
| |-- <mbed-filesystem> (C:\.platformio\packages\framework-mbed\features\filesystem)
|-- <mbed-filesystem> (C:\.platformio\packages\framework-mbed\features\filesystem)
arm-none-eabi-g++ -o .pioenvs\bluepill_f103c8\firmware.elf -mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,-T".pioenvs\bluepill_f103c8\STM32F103XB.ld.link_script.ld" @"C:\Users\?scar Garc?a\Documents\Semestre 9\Makerlab\Test\.pioenvs\bluepill_f103c8\longcmd-a4f60a5b6360b5bb3ab2fe4191b12cd7" -LC:\.platformio\platforms\ststm32\ldscripts -L.pioenvs\bluepill_f103c8 -Wl,--start-group .pioenvs\bluepill_f103c8\lib576\libSDBlockDevice.a -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -lc -lstdc++ -Wl,--end-group
C:\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py:1303: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
val = [x for x in val if x not in dk]
c:/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: .pioenvs\bluepill_f103c8\firmware.elf section `.text' will not fit in region `FLASH'
c:/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by 14800 bytes
collect2.exe: error: ld returned 1 exit status
*** [.pioenvs\bluepill_f103c8\firmware.elf] Error 1
[ERROR] Took 4.32 seconds
Home Version: 0.9.5
Core Version: 3.5.3a9
ST STM32 Version: 4.2.0