fix(ulp): fixed lp-core not booting during sleep

LP core was unable to boot when system was in deepsleep.
This was due to lp uart init in LP rom using XTAL as clk source,
which is normally powered down during sleep.

This would cause lp uart to get stuck while printing ROM output,
and the app would never boot.

Also fixed wrong wakeup cause used by HP core for ULP wake up
This commit is contained in:
Marius Vikhammer
2024-04-17 13:44:46 +08:00
parent eded4eabf6
commit 1fa59c442b
11 changed files with 36 additions and 23 deletions

View File

@@ -50,6 +50,9 @@ extern "C" {
* RTC_CNTL_STORE5_REG APB bus frequency
* RTC_CNTL_STORE6_REG FAST_RTC_MEMORY_ENTRY
* RTC_CNTL_STORE7_REG FAST_RTC_MEMORY_CRC
* LP_SYS_LP_STORE8_REG sleep mode and wake stub address
* LP_SYS_LP_STORE9_REG LP_UART_INIT_CTRL
* LP_SYS_LP_STORE10_REG LP_ROM_LOG_CTRL
*************************************************************************************
*/
@@ -75,6 +78,10 @@ extern "C" {
#define RTC_SLEEP_WAKE_STUB_ADDR_REG LP_SYSTEM_REG_LP_STORE8_REG
#define RTC_SLEEP_MODE_REG LP_SYSTEM_REG_LP_STORE8_REG
// lp uart init status, 0 - need init, 1 - no init.
#define LP_UART_INIT_CTRL_REG LP_SYSTEM_REG_LP_STORE9_REG
#define ROM_LOG_CTRL_REG LP_SYSTEM_REG_LP_STORE10_REG
typedef enum {
AWAKE = 0, //<CPU ON
LIGHT_SLEEP = BIT0, //CPU waiti, PLL ON. We don't need explicitly set this mode.