6 years, 9 months ago.

printf no longer working after exporting program to eclipse_gcc_arm

Hi,

Starting from a program which works fine with the online mbed compiler on a ST NucleoL053R8 board (prints on a PC terminal connected to the STLINK COM port), I exported it to eclipse_arm_gcc (compilation toolchain arm-none-eabi-gcc/g++). After compiling the program without changing the generated Makefile, the printf are no longer working (no output on the serial link).

    Serial pcf (D1,D0);
    pcf.printf("init start \n");

With arm-none-eabi-gcc, I have the impression that the pcf.printf() line is implemented thanks to libc (calls to vfprintf, _vfprintf_r, _swsetup_r), but I do not find how libc is connected to HAL_UART driver (which would be needed to output characters on the serial link).

Can someone give me hints on what to look for so as to have printf redirected on the UART when compiling with arm-none-eabi-gcc ?

Best regards, Damien

Be the first to answer this question.