I would like use custom linker script so I copied
.platformio\platforms\ststm32\ldscripts\stm32f103x8.ld
to RAM.ld in project directory and added
board_build.ldscript = $PROJECT_DIR/RAM.ld
when add this code to project ( for simple led blinking test)
pinMode(PC13, OUTPUT);
and compile get this message:
c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: .pio/build/bluepill_f103c8/SrcWrapper/src/syscalls.c.o: in function
_sbrk': syscalls.c:(.text._sbrk+0x38): undefined reference to
_Min_Stack_Size’
c:/users/user/.platformio/packages/toolchain-gccarmnoneeabi/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: .pio/build/bluepill_f103c8/SrcWrapper/src/syscalls.c.o:(.data.heap_end.7096+0x0): undefined
reference to `_end’
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\bluepill_f103c8\firmware.elf] Error 1
if I comment out this code its compile, but if remove ld script its works too.
What am I missing? in theory .ld is just a copy why not work from project directory?
(digitalWrite and delay functions compile with RAM.LD as well Serial1.begin )