syscalls.c and tiny_printf.c used together

Share code examples or discuss embedded software, including device drivers, interrupt handlers, middleware and application code.

Moderators: Markus Girdland, Mattias Norlander

phoenix2000
Posts: 14
Joined: Sun Aug 12, 2018 11:02 am

syscalls.c and tiny_printf.c used together

Postby phoenix2000 » Tue Aug 14, 2018 7:36 am

Hi everyone
My board is stm32f429i discovery. I tried to redirect the printf as the videos of Atollic page on youtube says.
I'mean I added the syscalls.c to Src and changed the _write function as I should. But I got nothing on SWV consol although If I used ITM_SendChar('h'); Instead of printf, I could see h character.
Anyway, at last, it was solved after that I added the tiny_printf.c to Src too. which was not mentioned anywhere.
So does anybody know why?

Mattias Norlander
Posts: 263
Joined: Fri Apr 29, 2016 10:01 am

Re: syscalls.c and tiny_printf.c used together

Postby Mattias Norlander » Fri Aug 31, 2018 2:33 pm

Different mcus (cortex-M0 --> M7) uses different run-time library combinations depending on which features of printf() you use etc.
Some of these will call putc() and other functions instead of _write(). That can create a problem.
As you correctly guessed adding tiny_printf.c will override run-time library and make sure you get a function that calls _write().

Which video link are you referring to?

phoenix2000
Posts: 14
Joined: Sun Aug 12, 2018 11:02 am

Re: syscalls.c and tiny_printf.c used together

Postby phoenix2000 » Tue Jan 15, 2019 8:35 am

Mattias Norlander wrote:Different mcus (cortex-M0 --> M7) uses different run-time library combinations depending on which features of printf() you use etc.
Some of these will call putc() and other functions instead of _write(). That can create a problem.
As you correctly guessed adding tiny_printf.c will override run-time library and make sure you get a function that calls _write().

Which video link are you referring to?

https://www.youtube.com/watch?v=qSzme7qcBb0&t=4s


Return to “Embedded target code development discussions”

Who is online

Users browsing this forum: No registered users and 1 guest