Using stm studio for variable monitoring

Here is how I was able to reproduce it.

first add a build_opt.h file in your arduino sketch and add inside the line -g -ggdb

Then add a variable in your Arduino loop that you wanna log.

For example the current measurements as suggested by @Candas1


PhaseCurrent_s current;
void loop(){
    ....
    current = current_sense.getPhaseCurrents();
    ....
}

And then compile the code.
Onece when your code is uploaded and complied it will output:

Open your stmstudio and import the variables form the elf file indicated by the arudino ide compilation

And then add the variables to the viewer

For more precision of the visualization you might need to adjust the acquisition settings. In y case I’ve used these settings:

3 Likes