Redirect printf and Console to custom function

elektron314
Posts: 7
Joined: Wed Oct 27, 2021 5:15 pm

Redirect printf and Console to custom function

Postby elektron314 » Wed Oct 27, 2021 5:18 pm

Can I redirect/reroute printf functions and also all console messages to my own written functions? What exactly I need is to route them to my own software uart that I have written by myself. Why? 3 HW UARTS are very busy already doing their job and we need one more SW UART for getting messages from the processor. :geek:

username
Posts: 477
Joined: Thu May 03, 2018 1:18 pm

Re: Redirect printf and Console to custom function

Postby username » Thu Oct 28, 2021 2:27 am

Search the forum, this has been asked a few times in the past.

elektron314
Posts: 7
Joined: Wed Oct 27, 2021 5:15 pm

Re: Redirect printf and Console to custom function

Postby elektron314 » Thu Oct 28, 2021 5:29 am

username wrote:
Thu Oct 28, 2021 2:27 am
Search the forum, this has been asked a few times in the past.
Already done. I have found different solutions but not redirecting to SW UART or my own custom function.

elektron314
Posts: 7
Joined: Wed Oct 27, 2021 5:15 pm

Re: Redirect printf and Console to custom function

Postby elektron314 » Mon Nov 15, 2021 7:38 am

But does anybody know how to exactly redirect printf to my own function?


kohait00
Posts: 1
Joined: Mon Dec 11, 2023 11:30 pm

Re: Redirect printf and Console to custom function

Postby kohait00 » Mon Dec 11, 2023 11:51 pm

quite some information provided here, but..

this is not for the real printf, which goes over vfs console file descriptors
this is all is for the ESP_LOGx facility..

hence again, the question:
is there an easy way to override the destination for printf (whatever is defined in sdkconfig) to, say, log in a buffer ?
I mean without messing with the vfs or trying to redirect or sth like that..
Any help is appreciated

Who is online

Users browsing this forum: No registered users and 84 guests