Skip to content

printf not show anything on esp32 #88803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
makerinchina-iot opened this issue Apr 18, 2025 · 1 comment · Fixed by #89032
Closed

printf not show anything on esp32 #88803

makerinchina-iot opened this issue Apr 18, 2025 · 1 comment · Fixed by #89032
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug platform: ESP32 Espressif ESP32 priority: low Low impact/importance bug

Comments

@makerinchina-iot
Copy link

Describe the bug

  • What target platform are you using?
    use esp32 board: esp32_devkitc_wrover

  • What have you tried to diagnose or workaround this issue?
    try to use printk function, it show the output

To Reproduce
on zephyr dir:
west build -b esp32_devkitc_wrover/esp32/procpu --sysbuild samples/hello_world
west flash
west esp
west espressif monitor
log shows:

Serial port /dev/ttyACM0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
--- idf_monitor on /dev/ttyACM0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3ffe8000,len:7644
ho 0 tail 12 room 4
load:0x40078000,len:4184
ho 0 tail 12 room 4
load:0x400a0000,len:28236
entry 0x400a216c
I (33) soc_init: MCUboot 2nd stage bootloader
I (33) soc_init: compile time Apr 18 2025 22:41:57
W (33) soc_init: Unicore bootloader
I (35) soc_init: chip revision: v3.0
I (38) flash_init: SPI Speed      : 40MHz
I (42) flash_init: SPI Mode       : DIO
I (45) flash_init: SPI Flash Size : 4MB
I (81) boot: Image index: 0, Swap type: none
I (81) boot: Loading image 0 - slot 0 from flash, area id: 1
I (81) boot: Application start=40082d20h
I (83) boot: DRAM segment: paddr=000261e0h, vaddr=3ffb0000h, size=00aa0h (  2720) load
I (91) boot: IRAM segment: paddr=00020080h, vaddr=40080000h, size=06160h ( 24928) load
I (109) boot: IROM segment: paddr=00040000h, vaddr=400d0000h, size=032F4h ( 13044) map
I (109) boot: DROM segment: paddr=00030000h, vaddr=3f400000h, size=010D0h (  4304) map
I (127) boot: libc heap size 179 kB.
I (127) spi_flash: detected chip: generic
I (127) spi_flash: flash io: dio
W (127) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
*** Booting Zephyr OS build v4.1.0-2348-gd453fb94075c ***


Expected behavior
printf should ouput the message "Hello World...."

Impact

Logs and console output

Environment (please complete the following information):

  • OS: Windows WSL
  • Toolchain Zephyr
  • the lastest version with west update

Additional context

if I added print with printk function as follow on main.c

int main(void)
{
        printf("printf Hello World! %s\n", CONFIG_BOARD_TARGET);
        printk("pirntk Hello World! %s\n", CONFIG_BOARD_TARGET);

        return 0;
}

then rebuild and run, the monitor show like this:

Serial port /dev/ttyACM0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
--- idf_monitor on /dev/ttyACM0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets �ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3ffe8000,len:7644
ho 0 tail 12 room 4
load:0x40078000,len:4184
ho 0 tail 12 room 4
load:0x400a0000,len:28236
entry 0x400a216c
I (33) soc_init: MCUboot 2nd stage bootloader
I (33) soc_init: compile time Apr 18 2025 22:41:57
W (33) soc_init: Unicore bootloader
I (35) soc_init: chip revision: v3.0
I (38) flash_init: SPI Speed      : 40MHz
I (42) flash_init: SPI Mode       : DIO
I (45) flash_init: SPI Flash Size : 4MB
I (81) boot: Image index: 0, Swap type: none
I (81) boot: Loading image 0 - slot 0 from flash, area id: 1
I (81) boot: Application start=40082d20h
I (83) boot: DRAM segment: paddr=000261e0h, vaddr=3ffb0000h, size=00aa0h (  2720) load
I (91) boot: IRAM segment: paddr=00020080h, vaddr=40080000h, size=06160h ( 24928) load
I (109) boot: IROM segment: paddr=00040000h, vaddr=400d0000h, size=03304h ( 13060) map
I (109) boot: DROM segment: paddr=00030000h, vaddr=3f400000h, size=010F0h (  4336) map
I (127) boot: libc heap size 179 kB.
I (127) spi_flash: detected chip: generic
I (127) spi_flash: flash io: dio
W (127) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
*** Booting Zephyr OS build v4.1.0-2348-gd453fb94075c ***
pirntk Hello World! esp32_devkitc_wrover/esp32/procpu


and the .config in build dir is :

SB_CONFIG_BOARD="esp32_devkitc_wrover"
SB_CONFIG_BOARD_REVISION=""
SB_CONFIG_BOARD_ESP32_DEVKITC_WROVER=y
SB_CONFIG_BOARD_ESP32_DEVKITC_WROVER_ESP32_PROCPU=y
SB_CONFIG_BOARD_QUALIFIERS="esp32/procpu"
SB_CONFIG_SOC="esp32"
SB_CONFIG_SOC_SERIES="esp32"
SB_CONFIG_SOC_FAMILY="espressif_esp32"
SB_CONFIG_SOC_PART_NUMBER="ESP32_WROVER_E_N4R8"
SB_CONFIG_SOC_TOOLCHAIN_NAME="espressif_esp32"
SB_CONFIG_SOC_FAMILY_ESPRESSIF_ESP32=y
SB_CONFIG_SOC_SERIES_ESP32=y
SB_CONFIG_SOC_ESP32_WROVER_E_N4R8=y
SB_CONFIG_SOC_ESP32=y
SB_CONFIG_SOC_ESP32_PROCPU=y

#
# Sysbuild image configuration
#

#
# Modules
#

#
# Available modules.
#
SB_CONFIG_ZEPHYR_ACPICA_MODULE=y
SB_CONFIG_ZEPHY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=y
SB_CONFIG_ZEPHYR_LIBMCTP_MODULE=y
SB_CONFIG_ZEPHYR_LIBMETAL_MODULE=y
SB_CONFIG_ZEPHYR_LITTLEFS_MODULE=y
SB_CONFIG_ZEPHYR_LORAMAC_NODE_MODULE=y
SB_CONFIG_ZEPHYR_LVGL_MODULE=y
SB_CONFIG_ZEPHYR_MBEDTLS_MODULE=y
SB_CONFIG_ZEPHYR_MCUBOOT_MODULE=y
SB_CONFIG_ZEPHYR_MIPI_SYS_T_MODULE=y
SB_CONFIG_ZEPHYR_NRF_WIFI_MODULE=y
SB_CONFIG_ZEPHYR_OPEN_AMP_MODULE=y
SB_CONFIG_ZEPHYR_OPENTHREAD_MODULE=y
SB_CONFIG_ZEPHYR_PERCEPIO_MODULE=y
SB_CONFIG_ZEPHYR_PICOLIBC_MODULE=y
SB_CONFIG_ZEPHYR_SEGGER_MODULE=y
SB_CONFIG_ZEPHYR_TINYCRYPT_MODULE=y
SB_CONFIG_ZEPHYR_TRUSTED_FIRMWARE_A_MODULE=y
SB_CONFIG_ZEPHYR_TRUSTED_FIRMWARE_M_MODULE=y
SB_CONFIG_ZEPHYR_UOSCORE_UEDHOC_MODULE=y
SB_CONFIG_ZEPHYR_ZCBOR_MODULE=y
SB_CONFIG_ZEPHYR_NRF_HW_MODELS_MODULE=y

#
# Unavailable modules, please install those via the project manifest.
#
# end of Modules

# SB_CONFIG_WARN_EXPERIMENTAL is not set
SB_CONFIG_WARN_DEPRECATED=y
SB_CONFIG_SUPPORT_BOOTLOADER=y
SB_CONFIG_SUPPORT_BOOTLOADER_MCUBOOT_ZEPHYR=y
# SB_CONFIG_BOOTLOADER_NONE is not set
SB_CONFIG_BOOTLOADER_MCUBOOT=y
# SB_CONFIG_MCUBOOT_MODE_SINGLE_APP is not set
# SB_CONFIG_MCUBOOT_MODE_SWAP_USING_OFFSET is not set
# SB_CONFIG_MCUBOOT_MODE_SWAP_USING_MOVE is not set
# SB_CONFIG_MCUBOOT_MODE_SWAP_WITHOUT_SCRATCH is not set
# SB_CONFIG_MCUBOOT_MODE_SWAP_SCRATCH is not set
SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY=y
# SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP is not set
# SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP_WITH_REVERT is not set
# SB_CONFIG_MCUBOOT_MODE_RAM_LOAD is not set
# SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER is not set
# SB_CONFIG_MCUBOOT_MODE_SINGLE_APP_RAM_LOAD is not set
SB_CONFIG_SIGNATURE_TYPE="NONE"
SB_CONFIG_BOOT_SIGNATURE_TYPE_NONE=y
# SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA is not set
# SB_CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256 is not set
# SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519 is not set
SB_CONFIG_BOOT_SIGNATURE_KEY_FILE=""

#
# Build options
#
# SB_CONFIG_COMPILER_WARNINGS_AS_ERRORS is not set
# end of Build options
@makerinchina-iot makerinchina-iot added the bug The issue is a bug, or the PR is fixing a bug label Apr 18, 2025
Copy link

Hi @makerinchina-iot! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug platform: ESP32 Espressif ESP32 priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants