cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to execute HALT instruction in STM8l discovry.

NPaba
Associate II

Hello Respective,

I am using STM8l discovery board and trying to put my controller in Sleep(HALT) for some time and waking up again when any external interrupt comes.

Previously the code was working fine, but now it's not working as expected.

I am using stvd IDE and Cosmic compiler, using _asm("halt"); instruction to switch to halt mode. But this is not working every time, controller is neither going to sleep nor it's continuing the execution.

I tried to execute the halt instruction after clearing all the interrupt pending bit and clearing the following bits:

SWBSY flag in the CLK_SWCR register

EEBUSY flag in the CLK_REGCSR register

RTCSWBSY flag in the CLK_CRTCR register

BEEPSWBSY flag in the CLK_CBEEPR register when the Beep is enabled in Activehalt mode.

0 REPLIES 0