printf function don't work with Blue Pill

by Juan Jose Quiroz Moreno   Last Updated September 27, 2018 03:25 AM

Well I'm beginner with ARM Cortex-M and I'm learning with Eclipse IDE (with Cross ARM GNU C/C++ Compiler) and Blue Pill board (STM32f103C8T6). My problem is about using printf function. I've configurated as semihosting and I could used functions from Trace.h file and now I would like to use functions like scanf, printf and so on. I've searched information by this web site and intenet, and I haven't could to get a good result.

Now I've set my projects with parameters: 1.-I've setthat flags: -specs=nosys.specs -specs=rdimon.specs -lc -lrdimon 2.- Add extern void initialise_monitor_handles(void) above main. 3.- Add initialise_monitor_handles() before printf function. 4.- Add monitor arm semihosting enable in command startup tab in debug configurations.enter image description here

When I'm debugging and I reach printf function, my board stop and it sent me to a HardFault_handler() function.

I don't know what I'm doing bad.. sometime I think that microcontroller can not use that kind of function due to amount of memory that printf function have to use, therefore I have to redefine size of heap and stack in linker script.

Related Questions

BMC150 initialization does not work

Updated August 24, 2018 13:25 PM

Problem getting STM32 debugging to work

Updated November 06, 2017 00:25 AM

driving WS2812B using DMA and timers

Updated August 20, 2018 16:25 PM

STM32F103 GPIO not working

Updated May 21, 2015 21:10 PM