Skip to main content
NZask.1
Associate
March 17, 2020
Solved

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

  • March 17, 2020
  • 4 replies
  • 1275 views

0693W000000U6yWQAS.png

This topic has been closed for replies.
Best answer by NZask.1

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

__WFI();

4 replies

NZask.1
NZask.1Author
Associate
March 18, 2020

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

NZask.1
NZask.1AuthorBest answer
Associate
March 18, 2020

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

__WFI();

Piranha
Principal III
March 18, 2020

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
April 2, 2020

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.