Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

CCS/TMS320F28069: Using - STDIO - Sometimes sprintf is incorrect...

$
0
0

Part Number:TMS320F28069

Tool/software: Code Composer Studio

Hello,

My app is doing the following as a debug print about once every second:

sprintf((Uint8 *)&debug_string[0], "HRC1: H%lu, %lu, L%lu, %lu\r\n", xMessage.int_HRC1pulsewidthhigh0[i], xMessage.frac_HRC1pulsewidthhigh0[i], xMessage.int_HRC1pulsewidthlow0[i], xMessage.frac_HRC1pulsewidthlow0[i] );
USBBufferWrite((tUSBBuffer *)&g_sTxBuffer, (Uint8 *)&debug_string[0], strlen(debug_string));

I'm using the terminal in CCS to see the debug print - also - the app will run for a while and will eventually crash; usually hitting an ESTOP statement in an unhandled vector.  (Only happens when I enable this debug priint output.)

The following is an example output:  (<== marking the issue)

HRC1: H47, 61566, L48, 3970
HRC1: H61566, 47, L3970, 47  <==
HRC1: H47, 61566, L48, 3970
HRC1: H47, 63609, L48, 1927
HRC1: H47, 61682, L48, 3854
HRC1: H47, 61682, L48, 1927
HRC1: H47, 61682, L48, 3854
HRC1: H63609, 47, L3854, 47 <==
HRC1: H47, 63609, L48, 3854
HRC1: H47, 63609, L48, 1927
HRC1: H47, 61682, L48, 3854
HRC1: H47, 61682, L48, 3854

Any advice on this appreciated.

Thanks In Advance,
John


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>