2

I've noticed that the syscalls.c file for an STM32F407-DISC project (Made through the STM32CubeIDE) has __io_putchar() and __io_getchar() as externs.
But I can't locate any file within the project where these functions are actually defined.

This is what is present in the syscalls.c file:

extern int __io_putchar(int ch) __attribute__((weak));
extern int __io_getchar(void) __attribute__((weak));

Does anyone know what file these externs are pulling from?

Thanks in advance!

Reza Rahemtola
  • 1,182
  • 7
  • 16
  • 30

1 Answers1

2

They are in the standard library. So there is no code in your project. You need to download (clone) the source code of the standard library implementation used by the STMCubeIDE toolchain.

Simply write your own ones and they will replace those with the weak linkages.

0___________
  • 60,014
  • 4
  • 34
  • 74