mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(bootloader_hooks): Fix log_v2 support in bootloader hooks
Closes https://github.com/espressif/esp-idf/issues/18482
This commit is contained in:
+3
-2
@@ -8,9 +8,10 @@ void bootloader_hooks_include(void){
|
||||
|
||||
|
||||
void bootloader_before_init(void) {
|
||||
/* Keep in my mind that a lot of functions cannot be called from here
|
||||
/* Keep in mind that a lot of functions cannot be called from here
|
||||
* as system initialization has not been performed yet, including
|
||||
* BSS, SPI flash, or memory protection. */
|
||||
* BSS, SPI flash, or memory protection.
|
||||
*/
|
||||
ESP_LOGI("HOOK", "This hook is called BEFORE bootloader initialization");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
@@ -6,6 +6,17 @@ from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'default',
|
||||
# log_v2 routes ESP_LOG through esp_rom_output_to_channels() -> _putc2. This config
|
||||
# verifies that logging works correctly in bootloader hooks (before BSS is cleared),
|
||||
# where _putc2 must be initialized to a safe noop rather than left as NULL/garbage.
|
||||
'log_v2',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32s3', 'esp32c3'], indirect=['target'])
|
||||
def test_custom_bootloader_hooks_example(dut: Dut) -> None:
|
||||
# Expect to read both hooks messages
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# This is left intentionally blank. It inherits all configurations from sdkconfig.defaults.
|
||||
@@ -0,0 +1,2 @@
|
||||
CONFIG_LOG_VERSION_2=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
||||
Reference in New Issue
Block a user