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/TMS320F28335: Writing floating point variables using DSS

Part Number: TMS320F28335

Tool/software: Code Composer Studio

Hi, I am trying to set a floating point value through my dss script.

In my C code application I have a variable defined as follows

static float myVariable = 0.0f;

With the DSS API I can set / read this variable to any integer in any of the following ways (I am using '25' as an example but any integer will work):

myDebugSession.expression.evaluate("myVariable=25")

or

var myVariableAddress = myDebugSession.symbol.getAddress("myVariable")

myDebugSession.memory.writeData(pageNum, myVariableAddress, 25, 32)

or

I can use the .memory.writeWord() function

They are all successful in writing an integer value.  However I want to write the value 0.000225 (hex 0x396BEDFA)

using any of the methods above this does not work.  Does anyone know how to do this?

I am using CCS version 7.1.0.000014

Thanks,

Jack

  • Hi Jack,
    You should be able to do something like:

    myDebugSession.memory.writeWord(pageNum, myVariableAddress, parseInt(0x396BEDFA));

    This did the trick for me.

    Thanks
    ki
  • CORRECTION:

    I see you are on a F28335. Do the following instead:

    myDebugSession.memory.writeData(pageNum, myVariableAddress, parseInt(0x396BEDFA), 32);

    Size of a word is 16 bit on that device so you need to use writeData instead.


    Thanks
    ki