Hello,
I'm considering to make python script to operate the CSS via DSS.
Can I change the value of variables in Expression Window while debugging? I couldn't find any API to do it.
Thank you.
Miura.
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.
Hello,
I'm considering to make python script to operate the CSS via DSS.
Can I change the value of variables in Expression Window while debugging? I couldn't find any API to do it.
Thank you.
Miura.
Miura-san,
I'm considering to make python script to operate the CSS via DSS.
How are you planning on doing this? Are you trying to launch the CCS IDE from DSS using the technique mentioned below?
https://software-dl.ti.com/ccs/esd/documents/dss_launching_ccs_from_dss.html
Please note that the above feature was only ever validated with JavaScript.
Can I change the value of variables in Expression Window while debugging? I couldn't find any API to do it.
You can use the DSS memory APIs to write values to the address of the variables, like memory.writeWord(). Please see the DSS API documentation.
The DSS symbol.getAddress can return the address of symbols such as global variables.
Thank you
ki
Ki-san,
Thank you for the reply.
>How are you planning on doing this?
➢I only want to change the values of the variables in Expression window. I don't need to launch CSS automatically.
And now I think I can do it using DSS API "memory.writeWord()" as you said.
And the API can be used in python(Jython), isn't it?
Sorry for bothering you because of my lack of understanding.
Ki-san,
I maganed to start debug session via DSS. But I still have a problem.
At first, I wanted to read the address of the struct, and I could do it.
Nevertheless I could not read the address of a specific member.
Could you please teach me what went wrong in my way?
The code quering the address of variables.
The error message about quering the address of a member of the struct.
Thank you.
Miura-san
And the API can be used in python(Jython), isn't it?
Yes, you can use a python script (via jython) to call DSS APIs. Please note that you can only do this from the DSS command line.
Miura-san
Nevertheless I could not read the address of a specific member.
I don't believe you can use that API to get the address of a struct member.
You can use a different APi however. Try:
address = debugSession.expression.evaluate("&gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref")
Thank you
ki
Ki-san,
Thank you for reply.
I sucseeded to read the address of struct member, and it's value.
Now, I'm trying to change the value of the struct member, but it has not worked yet.
I tried 4 command bellow sequencially.
------------------------------------------------------------------------------------------------------------------------
1.data = debugSession.expression.evaluate("gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref")
➢result:data=0x00
2.address = debugSession.expression.evaluate("&gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref")
➢result:address=0xC106
3.debugSession.memory.writeWord(1, address, 10)
4.data = debugSession.expression.evaluate("gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref")
➢result:data=0x00
------------------------------------------------------------------------------------------------------------------------
I expected that the result of sequence 4 would be 0x0a(the value I wrote). But it didn't.
Could you please teach me what went wrong in my way?
as referance, I attached the command line when I tried the sequence.
>>> data = debugSession.expression.evaluate("gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref")
evaluate: ENTRY sExpression: gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref
eval: Requesting evaluation of expression: "gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref"
isConnected: ENTRY
isConnected: Target is connected
isConnected: RETURN true
isHalted: ENTRY
isHalted: Target is not halted
isHalted: RETURN false
waitUntil: ENTRY timeout: infinite
onEvent: Evaluated expression: gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref
waitUntil: RETURN
evaluate: RETURN 0x0
>>> address = debugSession.expression.evaluate("&gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref")
evaluate: ENTRY sExpression: &gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref
eval: Requesting evaluation of expression: "&gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref"
isConnected: ENTRY
isConnected: Target is connected
isConnected: RETURN true
isHalted: ENTRY
isHalted: Target is not halted
isHalted: RETURN false
waitUntil: ENTRY timeout: infinite
onEvent: Evaluated expression: &gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref
waitUntil: RETURN
evaluate: RETURN 0xc106
>>> debugSession.memory.writeWord(1, address, 10)
writeWord: ENTRY nPage: 1 nAddress: 0xc106 nValues: 0xa
getPageCount: ENTRY
getPageCount: RETURN 4
writeWord: Calculating size of a Word
writeWord: Word Size: 16 bits
writeData: ENTRY nPage: 1 nAddress: 0xc106 nValues: 0xa nTypeSize: 16
writeData: Validating page
writeData: Validating start address
writeData: Getting memory object from debug session
writeData: Setting start address: 0xc106
writeData: Setting buffer length: 1
writeData: Filling buffer
writeData: Writing 1 value(s) to target
writeData: Requesting memory write of 1 value(s) to target
waitUntil: ENTRY timeout: infinite
onEvent: Memory request complete
waitUntil: RETURN
writeData: RETURN
writeWord: RETURN
>>> data = debugSession.expression.evaluate("gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref")
evaluate: ENTRY sExpression: gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref
eval: Requesting evaluation of expression: "gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref"
isConnected: ENTRY
isConnected: Target is connected
isConnected: RETURN true
isHalted: ENTRY
isHalted: Target is not halted
isHalted: RETURN false
waitUntil: ENTRY timeout: infinite
onEvent: Evaluated expression: gstr_Dcdc_CPU2CLA.gf32_DCDC_BCM_Vo_ref
waitUntil: RETURN
evaluate: RETURN 0x0
Ki-san,
I resolved above issue.
I unnoticed that the DSS API document says that writeWord() support integer.
And I could change the value of integer variable.
Now, my problems are all cleared.
Thank you for helping me a lot.