/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / What was the problem with the WFI instruction?

Username:     
Password:     
             

Forum
  • Index
  •  » circleOS
  •  » What was the problem with the WFI instruction?

# 1   2007-09-02 01:20:07 What was the problem with the WFI instruction?

tev
New member
Registered: 2007-09-02
Posts: 2

What was the problem with the WFI instruction?

The Release Note for V1.3a says:
     "CircleOS - Version 1.3a : 23.08.2007
     - Removed WFI mode in the main loop, causing locks in some cases"

What are the problems with using WFI? I might want to use this if I want the unit to go easier on its batteries.

Are there any special programming precautions?

Offline

 

# 2   2007-09-03 06:53:05 What was the problem with the WFI instruction?

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: What was the problem with the WFI instruction?

At the moment, we don't know... we sent a report to ST for analysis and/or explanation. What we see is a permanent "hard fault  exception"  when we keep WFI in the main loop. This exception makes the CPU running, and it also disturbs the accesses to the debug module (used for programming). Conclusion: we decided to remove WFI until understanding how to configure the core to make it working properly.

Offline

 

# 3   2007-09-10 07:48:20 What was the problem with the WFI instruction?

tev
New member
Registered: 2007-09-02
Posts: 2

Re: What was the problem with the WFI instruction?

A bit of research on this CPU (tricky, ST doesn't document the CPU, that's ARM's job) indicates there are "Sleep on Exit" modes that might be set wrong. Refer to Section 5.9.2 in the Cortex M3 Technical Reference Manual at or about <http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337e/ch05s09s02.html>. The CPU initialisation might have "Sleep on Exit" enabled which would explain these problems. Section 7,2 says "Sleep-on-exit might return to base under various situations such as debug. Therefore, you must provide base code such as an idle loop or idle thread."

It might also be due to if/how the SLEEPING and SLEEPDEEP hardware signals are handled in hardware. Details on this in section 7.2 as well.

Offline

 

# 4   2007-09-13 11:52:15 What was the problem with the WFI instruction?

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: What was the problem with the WFI instruction?

ST is still investigating this issue, but -as you reported- the issue seems to be within the combination SLEEP mode / DEBUG mode.
A solution could be to discard the WFI while debugging, and to keep it for the release version, but "circle_mgr.exe" needs the DEBUG mode for programming. At least we should find out how to workaround the issue when programming.
Francis

Offline

 

  • Index
  •  » circleOS
  •  » What was the problem with the WFI instruction?

Board footer