This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: TI-RTOS-PROC
I have a project that outputs through System_printf() with SysMin, how do I use my own application specific output function?
The SysMin module allows users to add their own application specific output function. For example, this can be used to redirect the output to a UART or other peripheral. SysMin buffers data in a circular buffer. When you call System_flush() this data gets pushed to the output function. By default, this output function calls fwrite() (it is actually an internal function used by fwrite in the TI-compiler case) to output the characters to the CIO window in CCS.
Add this to your .cfg file:
SysMin = xdc.useModule('xdc.runtime.SysMin');
System.SupportProxy = SysMin;
SysMin.outputFxn = "&myOutputFunc";
And this output function to your .c file. You can replace the call to fwrite() below with a call to the IO operation of your choice.
#include <stdio.h> // for fwrite()
Void myOutputFunc(Char *buf, UInt size)
fwrite(buf, sizeof(Char), size, stdout);
The circular buffer is output via the System_flush() API. You can call System_flush() after you call to System_printf() or you can call it in a background thread at lower priority. Note that your output function is called with interrupt disabled so you should be careful with the amount of time that your output function takes.
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.