Skip to main content
MFäh.1
Associate III
February 25, 2024
Solved

Find out who is writing to memory address

  • February 25, 2024
  • 3 replies
  • 1595 views

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

 

    This topic has been closed for replies.
    Best answer by TDK

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

    3 replies

    Tesla DeLorean
    Guru
    February 25, 2024

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    TDK
    TDKBest answer
    February 26, 2024

    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""."
    MFäh.1
    MFäh.1Author
    Associate III
    February 29, 2024

    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?