2020-03-30 01:44 AM
We are trying to achieve the same kind of variable watching Keil has but with the STM32CubeIDE. The variables do not appear in the Variables tab under the Debug view so we added dummy variables to the expression tab. The initial value of the variable shows fine and then when we resume the program after the HAL_Init breakpoint the 'Target not available.' error appears. Was anyone able to get the feature to work? Or are we supposed to use another program if we want this feature?
Thanks,
David.
2020-12-01 03:11 AM
So you don't use CubeIde to debug ?
The Live variables view (the subject of this thread) is on CubeIde, I think you should post a new thread and question how to use openocd to do what you want to do.
If you use the latest openocd, there has been a recent change to be able to use several gdb connections.
But you must specify it in target cfg (-gdb-max-connections 2) because the default is only one connection allowed.
Rgds,
Laurent
2020-12-01 03:50 AM
No i use CubeIDE on my host computer. But since it now supports remote, I want to use CubeIDE on my computer, connected remotely to a raspberry pi with stlink/jtag (i have both) to the actual STM32 chip. That way my computer doesn't have to be physically connected to the STM32 device.
I have gotten everything to work except the live variables, where if i try to use the Cube-generated config (that uses stlink-dap.cfg and dapdirect_swd), i get the error described in the previous post
2020-12-01 05:01 AM
OK, so to try your cfg and your openocd, see in your target cfg that you have this option (-gdb-max-connections 2) added in target create.
And try to see if live variables work then.
If not, update your openocd to have this feature (commit is merged a month ago since 4 November 2020)).
Rgds,
Laurent
2020-12-02 02:54 AM
Hi @EHyld.1 ,
Live Watching is claimed as new feature of the latest STM32CubeIDE release V1.5.
Olivier
2021-09-02 04:31 PM
Is there a way to adjust the live expressions update frequency ?
What is it by default ? I cannot seem to find how to change its sampling rate or what the rate actually is.
It works is all I know.
2023-10-19 12:09 AM
Two Steps:
1 Project-properties-C/C++build-Setting-McuGccCompiler-Optimization-None(-O0)
2 move the variable to globle (out of main)as static.
That's all.