I’m having issues building a bare-metal bootloader for stm32. The code is here: GitHub - Spongman/STM32duino-bootloader: Bootloader for STM32F103 boards, for use with the Arduino_STM32 repo and the Arduino IDE I’m trying to build the env:generic-pc13
target.
The relevant parts of the platformio.ini file:
[platformio]
src_dir = .
framework=
[env]
platform = ststm32
board_build.ldscript = stm32_lib/c_only_md_high_density.ld
src_filter = +<*> -<sketch_combiner/> -<stm32_lib/c_only_startup_user.s>
[common]
build_flags = --specs=nosys.specs -Istm32_lib -Iusb_lib --verbose -Wl,--verbose -nostartfiles -nodefaultlibs -nostdlib -Wl,-nolibc -Wl,--gc-sections -ffreestanding -fno-builtin
[env:generic-pc13]
board = genericSTM32F103C8
build_flags = ${common.build_flags} -DTARGET_GENERIC_F103_PC13
the problem is that, for some reason, the compiler insists on linking with libc/libgcc, and that’s causing various link-time errors, like :
attempt to open c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-m\libc.a succeeded
(c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-m\libc.a)lib_a-exit.o
(c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-m\libc.a)lib_a-impure.o
(c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-m\libc.a)lib_a-init.o
(c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-m\libc.a)lib_a-memset.o
(c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-m\libc.a)lib_a-__call_atexit.o
(c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-m\libc.a)lib_a-atexit.o
(c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-m\libc.a)lib_a-fini.o
(c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-m\libc.a)lib_a-lock.o
(c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-m\libc.a)lib_a-__atexit.o
libc section `._usrstack' will not fit in region `RAM'
section .init LMA [08001910,08001913] overlaps section .data LMA [08001910,0800200b]
region `RAM' overflowed by 128 bytes
I don’t have a framework specified, i’m throwing all sorts of compiler flags to avoid this, but none of it is working. anyone know how to get this to build?