cancel
Showing results for 
Search instead for 
Did you mean: 

Hi! I have a problem with a chart. It plots the variables but most of the time their values seem to be 0 (what is not correct). I'm using stm32f103re with st-link/v2

NZask.1
Associate II
1 ACCEPTED SOLUTION

Accepted Solutions
NZask.1
Associate II

Guys, I found what caused this strange behavior, it was

__WFI();

View solution in original post

4 REPLIES 4
NZask.1
Associate II

I've tried dicovery board, and it plots just what i expect.0693W000000UB0MQAW.png

NZask.1
Associate II

Guys, I found what caused this strange behavior, it was

__WFI();

Piranha
Chief II

Sleep

It is not a requirement for the processor hardware to drain any pending memory activity before suspending execution to enter a sleep mode. Therefore, software has to handle this by adding barrier instructions if the sleep mode used could affect data transfer. A DSB should be used to ensure that there are no outstanding memory transactions prior to executing the WFI or WFE instruction.

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0321a/BIHHFHJB.html

stephane.legargeant
ST Employee

When the processor is in WFI, the tool is not able anymore to access the memory : when the tool reads data, the probe returns 0 and not the real value.

So it is not possible to get the data when MCU uses WFI instruction.