Here is how to implement System_printf() to write to the console on T.I. CC2640R2F, this is the solution to the unsolved closed issue “CCS/CC2640R2F: Implementation of System_printf()” asked on TIs forum: https://e2e.ti.com/support/tools/ccs/f/81/t/670719.
Chang the .cfg file to include SysMin, include the preprocessor XDC references, add the bufSize, remove all references to SysCallback:
var SysMin = xdc.useModule('xdc.runtime.SysMin'); SysMin.bufSize = 32; System.SupportProxy = SysMin; //var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); //System.SupportProxy = SysCallback; //SysCallback.abortFxn = "&myUserAbort"; //SysCallback.exitFxn = "&myUserExit"; //SysCallback.flushFxn = "&myUserFlush"; //SysCallback.putchFxn = "&myUserPutch"; //SysCallback.readyFxn = "&myUserReady";
Where desired in your code, use System_printf(“Hello World”) and add the System_flush();
System_printf("Hello World"); System_flush();
After changing the .cfg, you absolutely need to rebuild the project, or CCS will not take the change in account!
Menu Project > Clean…
Rebuild, Load, Run.
Open the Console view, select “Display Selected Console” and choose the “:CIO” view.
You should now see “Hello World” printed via System_printf.
Note: The flushing can be quite slow.