Page 1 of 1

How to redirect stdio?

Posted: Fri Apr 22, 2011 9:50 am
by Heater
Firstly I have read somewhere that when I use printf and such in my programs the processor goes into a debug mode. All threads are halted and the IO is performed, which I eventually get to see in my Eclipse console. When done debug mode is exited and all threads started again. So:

1) Is this description correct?

2) How can I intercept this and redirect stdio to my own uarts or other IO devices?

3) How can do the same for the file system, fopen, fread, fwrite, fclose etc etc. When I implement my own block drivers and file system?

4) How can I remove that debug mode code from my builds?

Re: How to redirect stdio?

Posted: Wed Jan 31, 2018 12:01 am
by gcore
I would like to ask the same question. I would like to leverage the infrastructure that allows any core to print to the debug console at the expense of one channel per tile, and rather than send all the messages out via xScope/xConnect to the xTimeComposer console, send them to a task of my choosing (on the XMOS) to be handled in a way specific to my application. This could be used for say gathering the debug messages and saving them to flash or sending them over Ethernet when it's not possible to run with the xTag attached.

I'm guessing this is not possible as no one has responded to this thread, but one doesn't find out unless one asks...