I have a newly acquired xCORE-200 USB sliceKIT that I am using to try out some of the examples included with xTIMEcomposer 14. The one of most importance to me is the "USB Test and Measurement Device [AN00135]" example. I can run the example as is with the LabVIEW example provided and with LabVIEW code of my own. I've also been able to customize small parts of the example to implement different commands and responses which is really cool.
One thing I noticed almost instantly is that if I modify line 32 in scpi_cmds.c from the following:
Code: Select all
SCPI_ResultInt(context, DUMMY_MEAS_RESULT_VAL);
to this:
I run into some problems. This code change allows me to return a double (the constant 33.3) instead of an integer (DUMMY_MEAS_RESULT_VAL is a #define equal to 10). When I run the LabVIEW code to send *MEASure:VOLTage:DC? I get 33.3 as a result which is what I expect. However, if I run it again the debugger notifies me that the program crashed with:
Code: Select all
tile[0] core[1] (Suspended: Signal 'ET_ILLEGAL_PC' received. Description: Illegal program counter.)
2 <symbol is not available> 0x0000001c
1 _TrapHandler() 0x00040108
I know that this exception means that the program counter register was written to with a bogus and inaccessible memory address. I was able to narrow down the culprit to an eventual call to snprintf which takes the double (33.3) parameter and convert it to a string for output. If I comment out snprintf or hard-code a string in place, I no longer crash. Debugging this has proved to be difficult since I can't find what call lead to this.
Can someone verify this problem with this example?
How can I go about debugging this further?
Thanks!!