I need a way to send some data to the ucontroller through Trace32. I heard that this is possible some way, but I have no idea where to start.
What I am actually trying to do is run a piece of code on a Aurix TC297 ucontroller to do some measurements (runtime, RAM, etc.). This piece of code is actually a Kalman filter that needs as input a vector of structs that I have too send from the computer through Trace32. Please help !
Asked
Active
Viewed 1,355 times
-2

El Puerco Total
- 25
- 6
-
1An answer to that question is likely dependent on your specific target and toolchain - you should add that information if you want a hope of getting an answer rather then down-votes or closure. You probably need need to look in the debugger and/or toolchain documentation for information relating to *"semihosting"* - this allows I/O on the debugger host to be used by the target. – Clifford Jan 06 '17 at 16:37
-
What do you mean "send data"? Please clarify. – Lundin Jan 09 '17 at 08:49
-
Sorry for the vague question. What I am actually trying to do is run a piece of code on a Aurix TC297 ucontroller to do some measurements (runtime, RAM, etc.). This piece of code is actually a Kalman filter that needs as input a vector of structs that I have too send from the computer through Trace32. – El Puerco Total Jan 09 '17 at 09:34
1 Answers
2
"A way to send some data to the ucontroller through Trace32" is a little bit vague. There are various possibilities depending on what your actually try to achieve and might also depend on the used CPU family and target OS. Anyhow one of the following might work:
- Simply writing some raw data to the target memory can be achieved with the
Data.Set
command. - To transfer a big amount of data (or even a whole application) from a file to the target memory the Data.LOAD commands might be the right choice. E.g.
Data.LOAD.Binary
command for a raw binary file. - To set variables in your application or even initiate C-style data arrays use the
Var.Set
command. - To write data to NOR flash or onchip flash memory you'll need the
FLASH.AUTO
command in addition to the previously mentioned commands (after declaring the flash memory to TRACE32). - To write data to a NAND, SPI or other serial flash memory you probably should use the
FLASHFILE.Set
command (after initialization of the FLASHFILE programming system). - To transfer data from TRACE32 to your target while the CPU is running you might have to configure correctly
SYStem.MemAccess
and use the memory access class prefix "E".
E.g.Data.Set E:<addr> <data>
orVar.Set %E <expression>
. - You can use
FDX
for a bidirectional data transfer between debugger and a running target application. - To enable the target application to open and read files from the computer running TRACE32, you have to compile your application with suitable semihosting code and initiate semihosting in TRACE32 with
TERM.GATE
command.

Holger
- 3,920
- 1
- 13
- 35
-
Thanks for the response ! Sorry for the vague question. What I am actually trying to do is run a piece of code on a Aurix TC297 ucontroller to do some measurements (runtime, RAM, etc.). This piece of code is actually a Kalman filter that needs as input a vector of structs that I have too send from the computer through Trace32. From what you've said, I'd go for declaring my struct in the code and then set it using Var.Set. I've never used Trace32. Is Var.Set the best way to go for what I want to achieve ? – El Puerco Total Jan 09 '17 at 08:50
-
Var.Set is definitely the easiest solution for setting a vector declared as struct. However you will likely need several calls of Var.Set to initialize all elements of your struct and and all structs of your array. Thus I recommend to do this via a PRACTICE script: Create a text file with suffix ".cmm" and put there all the required Var.Set commands inside. You might also want to use a WHILE loop in this script or use the OPEN/READ/CLOSE commands in the script to read the data from a plain text file first. See also http://www.lauterbach.com/reference_card_web.pdf – Holger Jan 09 '17 at 09:57
-