Electronic – Sending debug information from MSP430 to CCS Console

debuggingmsp430ti-ccstudiouart

I am debugging some code written for the MSP430F2132, which has very little flash memory available for the program. In order to debug properly, I must send information out to a terminal so that it can be stored and viewed at a later time. Normally I would use printf or a similar command (putchar, perhaps) and have it linked to the CCS 6.1 console. However, due to the lack of program memory on the micro, I am unable to use these functions. I also do not have the option of modifying the board to make use of a built-in UART channel on the micro. I am connected to the micro using the MSP-FET430UIF USB debug interface, which supposedly implements a back-channel UART interface but I think this requires special connections to the target that I do not have. Do I have any options that use very little memory that would allow me to store debug information? I just need to send two long ints each cycle.

EDIT:

Upon further inspection (the design was not originally mine), I notice that the "special connections to the target" required for the MSP-FET430UIF (simply to the UCA0RXD and UCA0TXD pins on the target micro) do exist, but the signals are converted to RS-485 using transceivers on the interface board (a test fixture) and the target board. Perhaps I can use the FET430UIF backchannel UART after all, though I have yet to find good instructions on how to do that. If anyone here has experience doing this and will be able to offer guidance, it would be very helpful.

Best Answer

If you have functioning JTAG connection, you can use the CCS built-in debugger for all your debugging needs.

Just store your debug values in an array and optionally set up an "if" clause with __no_operation() for a breakpoint to check what's going on periodically. Or just pause execution after you come back and see the collected data.

Alternatively, instead of using the memory hungry printf to stdout, you can write to stderr with fprintf. It's by far slower and uses no buffering but for periodic status reports it may be enough.