Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

How to use stm studio?

1 Answer(s) Available
Answer # 1 #

This tool works with STM32 microcontrollers through JTAG or SWD (serial wire debug) interface. The ST-LINK/v2-1 interface on the mbed ST nucleo and ST discovery boards can be used with STM Studio. The application code shown here provides an example.

Download and Install STM Studio from the ST website.

The STM Studio tool can import .elf or .axf files which contain a memory map of all variables used in your code. However, the mbed online compiler does not generate these files, so instead use the following printf() to show the addresses in a terminal window and then figure out where the vars that you want to monitor (or manipulate) are located and manually paste their addresses into STM Studio.

First declare your vars in your code as usual:

Add printf() to find memory addresses of those vars you wish to monitor or manipulate while executing your code.

This will show up in your terminal like so:

Copy and paste these values into STM Studio:

Create the viewers and send the variables to the desired viewer:

The example code shows a graphical plot of a sine (float variable -100.0..100.0), a char counter (0..255) and a boolean for a user button. There is also a variable (b2) that may be changed on the fly through the STM Studio interface and that will modify the behaviour of the software. The code can be found here:

https://developer.mbed.org/users/wim/code/mbed_nucleo_stmstudio/

It should also be possible to monitor peripheral control registers (eg serial port TX, RX, external ports) by looking up the hardware addresses in the device reference manual and adding a watch for that address in STM Studio.

[4]
Edit
Query
Report
Marcelo Parke
Microbiologist