cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to view registers of a running target inside STM32Cube?

GHrib.1
Associate III

I would like to view/modify values of registers while in debugging perspective, while the target is in running state. So far I have discovered that you can view registers only during pause(resume) of program in the SFRs window. Is it possible to have some type of continous refresh of registers values?

1 ACCEPTED SOLUTION

Accepted Solutions

In your code create u16 variable and insert SFR for monitor to it in some refresh code place. For example systick int .

_IO uint16_t mon_odr;
 
mon_odr= GPIOx->ODR;

View solution in original post

15 REPLIES 15
MM..1
Chief III

Maybe yes in live expression, and change in pause over bit access

S.Ma
Principal

Yes live watch or live expression is one way. While the code runs, the debug interface is used to make a memory read access stealing a bus cycle, like a dma would. Of course it is not real time. Something I didn't use was watchpoint, it is like breakpoint on data value matching. If supported, can give other ways to debug a code.

Which registers? The MCU's ?

With peripheral registers it gets to be a bit invasive. The stuff in general can change millions of times a second..

What exactly are you trying to achieve? Perhaps there's a better way or approach?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

How can I view register in Live Expressions window?

Lets say I have a simple blink program, the values inside GPIOA_ODR register should change. How can I see this change?

If I write GPIOA_ODR inside Live Expressions I get Failed to Evaluate Expression inside value space.

The more the better, but i would be satisfied with peripheral registers (TIM, DMA, ADC).

That is true, but when I worked with Texas Instruments CCS I found it very useful, even though it is not real time. I found it very useful for debugging strange behavior of peripherals, where registers are your only source of information.

I don't have a specific problem yet, I am only preparing for them.

Lets say that I have simple blink program, GPIOA_ODR register should therefore change its value. How can I see this change in registers value during debugging?

Semer CHERNI
ST Employee

Hello @Gašper Hribar​ 

First let me thank you for posting.

To watch the IP register, the STM32CubeIDE provide a specific view for this purpose called SFRs:

0693W00000WJJD0QAP.png 

I hope this answer solve your question. If yes, please mark the answer as a Best Answer.

Semer.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Rim LANDOLSI
ST Employee

Hello GHrib.1,

For live update you can use live expressions view.

CubeIDE 1.11.0 to be released soon will include live update from the SFR view .

I am familiar with SFR window. The problem I have is the fact, that this view doesn't show changing of registers values during runtime (values update only on "pause").

How can I use live expressions view to look into registers?

Lets say I have a simple blink program, the values inside GPIOA_ODR register should change. How can I see this change?

If I write GPIOA_ODR inside Live Expressions I get Failed to Evaluate Expression inside value space.

I am very happy to hear about it :D . It would also be great if the opened registers inside SFR view would stay opened after changing perspective (DEBUG->EDIT->DEBUG). Currently I have to open registers I am interested in every time I go into DEBUG perspective.