mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-06 06:04:33 +02:00
rtc: supported disable rom log temporarily
This commit is contained in:
@@ -184,6 +184,24 @@ uint32_t calc_rtc_memory_crc(uint32_t start_addr, uint32_t crc_len);
|
|||||||
*/
|
*/
|
||||||
void set_rtc_memory_crc(void);
|
void set_rtc_memory_crc(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Suppress ROM log by setting specific RTC control register.
|
||||||
|
* @note This is not a permanent disable of ROM logging since the RTC register can not retain after chip reset.
|
||||||
|
*
|
||||||
|
* @param None
|
||||||
|
*
|
||||||
|
* @return None
|
||||||
|
*/
|
||||||
|
static inline void rtc_suppress_rom_log(void)
|
||||||
|
{
|
||||||
|
/* To disable logging in the ROM, only the least significant bit of the register is used,
|
||||||
|
* but since this register is also used to store the frequency of the main crystal (RTC_XTAL_FREQ_REG),
|
||||||
|
* you need to write to this register in the same format.
|
||||||
|
* Namely, the upper 16 bits and lower should be the same.
|
||||||
|
*/
|
||||||
|
REG_SET_BIT(RTC_CNTL_STORE4_REG, RTC_DISABLE_ROM_LOG);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Software Reset digital core.
|
* @brief Software Reset digital core.
|
||||||
*
|
*
|
||||||
|
@@ -71,6 +71,8 @@ extern "C" {
|
|||||||
#define RTC_RESET_CAUSE_REG RTC_CNTL_STORE6_REG
|
#define RTC_RESET_CAUSE_REG RTC_CNTL_STORE6_REG
|
||||||
#define RTC_MEMORY_CRC_REG RTC_CNTL_STORE7_REG
|
#define RTC_MEMORY_CRC_REG RTC_CNTL_STORE7_REG
|
||||||
|
|
||||||
|
#define RTC_DISABLE_ROM_LOG ((1 << 0) | (1 << 16)) //!< Disable logging from the ROM code.
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
AWAKE = 0, //<CPU ON
|
AWAKE = 0, //<CPU ON
|
||||||
@@ -164,6 +166,24 @@ WAKEUP_REASON rtc_get_wakeup_cause(void);
|
|||||||
*/
|
*/
|
||||||
uint32_t calc_rtc_memory_crc(uint32_t start_addr, uint32_t crc_len);
|
uint32_t calc_rtc_memory_crc(uint32_t start_addr, uint32_t crc_len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Suppress ROM log by setting specific RTC control register.
|
||||||
|
* @note This is not a permanent disable of ROM logging since the RTC register can not retain after chip reset.
|
||||||
|
*
|
||||||
|
* @param None
|
||||||
|
*
|
||||||
|
* @return None
|
||||||
|
*/
|
||||||
|
static inline void rtc_suppress_rom_log(void)
|
||||||
|
{
|
||||||
|
/* To disable logging in the ROM, only the least significant bit of the register is used,
|
||||||
|
* but since this register is also used to store the frequency of the main crystal (RTC_XTAL_FREQ_REG),
|
||||||
|
* you need to write to this register in the same format.
|
||||||
|
* Namely, the upper 16 bits and lower should be the same.
|
||||||
|
*/
|
||||||
|
REG_SET_BIT(RTC_CNTL_STORE4_REG, RTC_DISABLE_ROM_LOG);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set CRC of Fast RTC memory 0-0x7ff into RTC STORE7.
|
* @brief Set CRC of Fast RTC memory 0-0x7ff into RTC STORE7.
|
||||||
*
|
*
|
||||||
|
@@ -71,6 +71,8 @@ extern "C" {
|
|||||||
#define RTC_RESET_CAUSE_REG RTC_CNTL_STORE6_REG
|
#define RTC_RESET_CAUSE_REG RTC_CNTL_STORE6_REG
|
||||||
#define RTC_MEMORY_CRC_REG RTC_CNTL_STORE7_REG
|
#define RTC_MEMORY_CRC_REG RTC_CNTL_STORE7_REG
|
||||||
|
|
||||||
|
#define RTC_DISABLE_ROM_LOG ((1 << 0) | (1 << 16)) //!< Disable logging from the ROM code.
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
AWAKE = 0, //<CPU ON
|
AWAKE = 0, //<CPU ON
|
||||||
LIGHT_SLEEP = BIT0, //CPU waiti, PLL ON. We don't need explicitly set this mode.
|
LIGHT_SLEEP = BIT0, //CPU waiti, PLL ON. We don't need explicitly set this mode.
|
||||||
@@ -172,6 +174,24 @@ uint32_t calc_rtc_memory_crc(uint32_t start_addr, uint32_t crc_len);
|
|||||||
*/
|
*/
|
||||||
void set_rtc_memory_crc(void);
|
void set_rtc_memory_crc(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Suppress ROM log by setting specific RTC control register.
|
||||||
|
* @note This is not a permanent disable of ROM logging since the RTC register can not retain after chip reset.
|
||||||
|
*
|
||||||
|
* @param None
|
||||||
|
*
|
||||||
|
* @return None
|
||||||
|
*/
|
||||||
|
static inline void rtc_suppress_rom_log(void)
|
||||||
|
{
|
||||||
|
/* To disable logging in the ROM, only the least significant bit of the register is used,
|
||||||
|
* but since this register is also used to store the frequency of the main crystal (RTC_XTAL_FREQ_REG),
|
||||||
|
* you need to write to this register in the same format.
|
||||||
|
* Namely, the upper 16 bits and lower should be the same.
|
||||||
|
*/
|
||||||
|
REG_SET_BIT(RTC_CNTL_STORE4_REG, RTC_DISABLE_ROM_LOG);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Fetch entry from RTC memory and RTC STORE reg
|
* @brief Fetch entry from RTC memory and RTC STORE reg
|
||||||
*
|
*
|
||||||
|
@@ -65,6 +65,7 @@ extern "C" {
|
|||||||
#define RTC_ENTRY_ADDR_REG RTC_CNTL_STORE6_REG
|
#define RTC_ENTRY_ADDR_REG RTC_CNTL_STORE6_REG
|
||||||
#define RTC_MEMORY_CRC_REG RTC_CNTL_STORE7_REG
|
#define RTC_MEMORY_CRC_REG RTC_CNTL_STORE7_REG
|
||||||
|
|
||||||
|
#define RTC_DISABLE_ROM_LOG ((1 << 0) | (1 << 16)) //!< Disable logging from the ROM code.
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
AWAKE = 0, //<CPU ON
|
AWAKE = 0, //<CPU ON
|
||||||
@@ -159,6 +160,24 @@ WAKEUP_REASON rtc_get_wakeup_cause(void);
|
|||||||
*/
|
*/
|
||||||
uint32_t calc_rtc_memory_crc(uint32_t start_addr, uint32_t crc_len);
|
uint32_t calc_rtc_memory_crc(uint32_t start_addr, uint32_t crc_len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Suppress ROM log by setting specific RTC control register.
|
||||||
|
* @note This is not a permanent disable of ROM logging since the RTC register can not retain after chip reset.
|
||||||
|
*
|
||||||
|
* @param None
|
||||||
|
*
|
||||||
|
* @return None
|
||||||
|
*/
|
||||||
|
static inline void rtc_suppress_rom_log(void)
|
||||||
|
{
|
||||||
|
/* To disable logging in the ROM, only the least significant bit of the register is used,
|
||||||
|
* but since this register is also used to store the frequency of the main crystal (RTC_XTAL_FREQ_REG),
|
||||||
|
* you need to write to this register in the same format.
|
||||||
|
* Namely, the upper 16 bits and lower should be the same.
|
||||||
|
*/
|
||||||
|
REG_SET_BIT(RTC_CNTL_STORE4_REG, RTC_DISABLE_ROM_LOG);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set CRC of Fast RTC memory 0-0x7ff into RTC STORE7.
|
* @brief Set CRC of Fast RTC memory 0-0x7ff into RTC STORE7.
|
||||||
*
|
*
|
||||||
|
@@ -47,13 +47,8 @@ void esp_rom_delay_us(uint32_t us);
|
|||||||
void esp_rom_install_channel_putc(int channel, void (*putc)(char c));
|
void esp_rom_install_channel_putc(int channel, void (*putc)(char c));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable logging from the ROM code.
|
* @brief Install UART1 as the default console channel, equivalent to `esp_rom_install_channel_putc(1, esp_rom_uart_putc)`
|
||||||
*/
|
*/
|
||||||
void esp_rom_disable_logging(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Install UART1 as the default console channel, equivalent to `esp_rom_install_channel_putc(1, esp_rom_uart_putc)`
|
|
||||||
*/
|
|
||||||
void esp_rom_install_uart_printf(void);
|
void esp_rom_install_uart_printf(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@@ -1245,5 +1245,5 @@ static uint32_t get_power_down_flags(void)
|
|||||||
|
|
||||||
void esp_deep_sleep_disable_rom_logging(void)
|
void esp_deep_sleep_disable_rom_logging(void)
|
||||||
{
|
{
|
||||||
esp_rom_disable_logging();
|
rtc_suppress_rom_log();
|
||||||
}
|
}
|
||||||
|
@@ -84,9 +84,7 @@ static void init_ulp_program(void)
|
|||||||
*/
|
*/
|
||||||
rtc_gpio_isolate(GPIO_NUM_12);
|
rtc_gpio_isolate(GPIO_NUM_12);
|
||||||
rtc_gpio_isolate(GPIO_NUM_15);
|
rtc_gpio_isolate(GPIO_NUM_15);
|
||||||
#if CONFIG_IDF_TARGET_ESP32
|
|
||||||
esp_deep_sleep_disable_rom_logging(); // suppress boot messages
|
esp_deep_sleep_disable_rom_logging(); // suppress boot messages
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void start_ulp_program(void)
|
static void start_ulp_program(void)
|
||||||
|
Reference in New Issue
Block a user