Disabling of UART0 ROM boot messages not working

MikeMyhre
Posts: 54
Joined: Sat Nov 05, 2022 3:32 am

Disabling of UART0 ROM boot messages not working

Postby MikeMyhre » Sun Jan 01, 2023 8:01 pm

According to the technical datasheet for ESP32-s3 module I should be able to disable the UART0 ROM boot messages by changing a register value. The register has precedence over the eFuse (which is 0b00) and both of those have precedence over GPIO46 state.

I found code to set the bits here:
https://github.com/espressif/esp-idf/bl ... /rom/rtc.h

Code: Select all

#define RTC_DISABLE_ROM_LOG ((1 << 0) | (1 << 16)) //!< Disable logging from the ROM code.
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);
}
This doesn't seem to work. messages continue to be dumped over UART0 and USB after the command is executed.
This would be the perfect solution for me as I don't care about messages dumped on that port until I take control of the UART0 port.
Has anyone gotten this to work?

MikeMyhre
Posts: 54
Joined: Sat Nov 05, 2022 3:32 am

Re: Disabling of UART0 ROM boot messages not working

Postby MikeMyhre » Fri Jan 06, 2023 5:30 pm

I think I found the issue.
Apparently this RTC_CNTL_STORE4_REG flag is only checked on reset. Since it is in the RTC memory, you must first check for the reason for reset (powerup, WDT, SW (esp_restart) or other) and set the register, then do a esp_restart() to force it to be read and to cause the UART0 Log messages to be disabled.
Now I only get characters sent for the initial boot, check the esp_reset_reason() and do this code on poweron (or reset button):

REG_SET_BIT(RTC_CNTL_STORE4_REG,RTC_DISABLE_ROM_LOG);
esp_restart();

Who is online

Users browsing this forum: Google [Bot] and 135 guests