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.

CCS/CC1312R: Invalid CIO command (216) in the CIO buffer

Part Number: CC1312R

Tool/software: Code Composer Studio

hi,

we are trying use semi-hosting with CC1312 and sometimes we are getting this error message in the console in red:"Invalid CIO command (216) in the CIO buffer at address (0x20009FE0) was not recognized. Please check the device and program memory maps." The execution of the program is halted waiting for run command to continue. Either the code is running as expected or (sometimes) we are getting much more serious errors which states the Core cannot be halted or run like this: "Cortex_M4_0: Can't Run Target CPU: (Error -2134 @ 0x0) Unable to control device execution state. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 8.2.0.00004) ". This hinders us to make a reliable debug in our system.

I read other threads in e2e to find a solution, but still the error continues. As I understand, during semi-hosting, the debugger places sw breakpoints where printf is used to print the buffer to console. Since we are using heavily printf function to get log messages from our application, sometimes the buffer overflows which results these errors. I realize that when the errors occur, the first couples of bytes in _CIOBUF_ are 0.

This is the functions that are called when the errors occurs and the debugger halts:

My question is how to solve the problem (other than reducing the logs inside printf)

I see that the size of  _CIOBUF_ is defined as CIOBUFSIZ in trgmsg.c and the CIOBUFSIZ is defined as ((BUFSIZ)+32) in trgcio.h. Is it possible to increase this BUFSIZ in stdio.h (right now, it is defined as  #define BUFSIZ    256 in stdio.h) ?  What other options do we have to solve the problem? (I also tried to increase TCLK to 14 MHz and JTAG debugger wont work)

our setup is like this:

Host OS: Linux Ubuntu 18.04

Code Composer Studio : 9.1.0.00010 (tested also with CCS 9.2.0.00013, the same result)

Best Regards