Platformio + STN32CubeMonitor

I understand that the question is off topic, and the problem is probably not in the platformio, but maybe someone has encountered it. I receive data via st-link2 to the stm32CubeMonitor program. For the test, I created a ++variable, but it does not change its value either. The ST-link reacts to the start of monitoring, the red LED starts blinking, apparently for some reason I do not receive data.

[platformio]
include_dir = Core/Inc
src_dir = Core/Src

[env:demo_f030f4]
platform = ststm32
board = demo_f030f4
framework = stm32cube
upload_protocol = stlink
lib_archive = no

;build_unflags = -Os
build_flags =
;-Og
-ggdb





Debugging in the IDE works, but getting data into CubeMonitor did not work. I will be glad to any suggestions.
Снимок экрана 2022-02-18 в 11.08.12

The addresses of these variables may change on every compile, and especially in optimized vs. debug builds. If you start debugging, by default, it will compile the firmware with build_type = debug and -Og, while after a regular upload, it will compile it with -Os. The addresses of these target variables may be completely different in those two builds. You should debug-print the address of these variables and update them in that GUI accordingly. Or, add build_type = debug in the platformio.ini so that there’s no difference between release and debug uploads any more, start debugging, note the address of the variables in the Debug Console through GDB commands (p &varname) and update the values accordingly.

1 Like

Thank you! I really did just that! But one more correction for future users (this is really a very convenient, and most importantly, real time, tool). For some reason, the manuals do not pay attention to the value of the Access point parameter, but only after setting it to 0 did I get the data.
So, if someone, like me, is tired of displaying variables through the monitor, here is a ready-made recipe. In the platform.ini only needs to add build_flags = -gdb and build_type = debug. This debug_tool = st link is only needed when debugging inside the IDE.

[env:demo_f030f4]
platform = ststm32
board = demo_f030f4
framework = stm32cube
upload_protocol = stlink
lib_archive = no
build_type = debug
build_flags = -ggdb
After that, just select your st-link in the Cube Monitor settings, specify the elf file, select variables for monitoring and you are the owner of your own Interslellar!
1


2

3 Don’t forget about the Access point parameter :upside_down_face:

4

Now you can monitor your variables in real time, display them on a graph, text or arrows, and most importantly, you can worry less about the performance of your MCU, because this is not a slow serial connection!
To date, this is the best, in my opinion, alternative to all known solutions, including this wonderful tool GitHub - devinaconley/arduino-plotter: An Arduino library for easy graphing on host computer via serial communication!

1 Like