cancel
Showing results for 
Search instead for 
Did you mean: 

Find out who is writing to memory address

MFäh.1
Associate II

Hi 

Is there a way to sort of set a breakpoint to figure out which part of my code is messing with a specific memory address in STM32CubeIDE?

I've got this dynamically allocated address that keeps getting changed by something else in my code, and I'm trying to track down where it's happening. Any tips on how I can find the culprit function or module would be awesome :beaming_face_with_smiling_eyes:

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Create the expression in the expressions window. Now right click it and set a hardware watchpoint. The code will break when it gets modified.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3

Depending on the core there's DWT / FPB to watch and break point.

You could instrument flow, and check values in SysTick. Pin down where and when it changes

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

Create the expression in the expressions window. Now right click it and set a hardware watchpoint. The code will break when it gets modified.

If you feel a post has answered your question, please click "Accept as Solution".

Thank you, this works...

Now, i have to find the problem :-). It seems that it is suddenly being changed at numerous locations in the code, but I dynamically allocated it and have not freed it.

 

Any ideas?