今天,看了一下电源管理,下午就动起手来,后来启动后无论怎么搞,都会不断的调用OEMIDLE函数,我在里面加的打印信息,不停的打印。
我就做了下面的修改而已
首先修改bootloader
;Check if the boot is caused by the wake-up from SLEEP mode.
ldr r1,=GSTATUS2
ldr r0,[r1]
tst r0,#0x2
;In case of the wake-up from SLEEP mode, go to SLEEP_WAKEUP handler.
bne WAKEUP_SLEEP
——这里跟IDLE没有关系吧!
这个GSTATUS2不会影响空闲吧。只有CLKCON才会影响的。
GSTATUS2 0x560000b4 R/W Reset status 0x1
GSTATUS2 Bit Description
Reserved [3] Reserved
WDTRST [2] Boot is caused by Watch Dog Reset
cleared by writing !°1
SLEEPRST [1] Boot is caused by wakeup reset in sleep mode
cleared by writing !°1!
PWRST [0] Boot is caused by power on reset
cleared by writing !°1
//------------------------------------------------------------------------------
//
// Function: OEMIdle
//
// This function is called by the kernel when there are no threads ready
// to run. The CPU should be put into a reduced power mode if exists and
// halted. It is important to be able to resume execution quickly upon
// receiving an interrupt.