How to redirect stdio?

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
Respected Member
Posts: 296
Joined: Thu Dec 10, 2009 10:33 pm

How to redirect stdio?

Postby Heater » Fri Apr 22, 2011 9:50 am

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?
Posts: 11
Joined: Thu Oct 06, 2016 4:58 am

Postby gcore » Wed Jan 31, 2018 12:01 am

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...

Who is online

Users browsing this forum: No registered users and 1 guest