intermittent reading wrong pointer value
Hi support,
I am working on a project that is using uC/OS-III running on STM32H750XB using IAR with Segger J-Link debugger.
Recently we encounter a strange issue where reading a pointer (itsScanSampleAnnun) will return a wrong value intermittently. The value can be a random number and usually is an invalid address that will generate hard fault when accessing it.
Thus, I added debug code to cache the pointer value in a static variable and break when their values are different.
But, when I inspect the value of itsScanSampleAnnun in the Memory window, it is correct.
By looking at the assembly code, the pointer value of bkPtr is loaded into R2 register and the pointer value of itsScanSampleAnnun is loaded into R3 register. As you can see below, the R3 register is having a wrong value. Not sure where and how the wrong value is getting loaded into the register.
Appreciate if you can provide any advice to us. Thanks …
rgds,
kc Wong
