[SOLVED] No output from ESP_LOGI()

ZacDaMan
Posts: 47
Joined: Wed Dec 22, 2021 7:40 pm

[SOLVED] No output from ESP_LOGI()

Postby ZacDaMan » Sun Nov 13, 2022 10:15 pm

I'm trying to print a line when I push a button, but am not getting any output. The rest of the button code seems to be working fine (board_led_operation toggles an LED):

Code: Select all

static void button_tap_cb(void* arg)
{
    static int thingy = 5;
    ESP_LOGI(TAG, "tap cb");
    if(initial == true){
        initial = false;
        return;
    }

    board_led_operation(dummy_strip, 0, 1);
    
    if(thingy > 0){
        thingy = thingy - 1;
        return;
    }
    esp_bt_controller_disable();

    const int wakeup_time_sec = 10; 
    esp_sleep_enable_timer_wakeup(wakeup_time_sec * 1000000);    
    esp_deep_sleep_start();

    // esp_ble_mesh_node_local_reset();
    // esp_ble_mesh_node_prov_enable(ESP_BLE_MESH_PROV_ADV | ESP_BLE_MESH_PROV_GATT);
}
I've tried setting the log output to verbose, but still nothing. The board I'm using is the Seeed Xiao ESP32C3, connected via the board's USB-C connector and I get the following log output on startup (with log output set to "Info"):

Code: Select all

I (276) esp_image: segment 3: paddr=00100dd4 vaddr=3fc907I (337) cpu_start: Pro cpu start user code
I (337) cpu_start: cpu freq: 160000000
I (337) cpu_start: Application information:
I (340) cpu_start: Project name:     onoff_client
I (345) cpu_start: App version:      568ef7d-dirty
I (351) cpu_start: Compile time:     Nov 14 2022 10:23:55
I (357) cpu_start: ELF file SHA256:  33f64144e06a61c9...
I (363) cpu_start: ESP-IDF:          v4.3.1-dirty
I (368) heap_init: Initializing. RAM available for dynamic allocation:
I (375) heap_init: At 3FC9A810 len 000257F0 (149 KiB): DRAM
I (382) heap_init: At 3FCC0000 len 0001F060 (124 KiB): STACK/DRAM
I (388) heap_init: At 50000018 len 00001FE8 (7 KiB): RTCRAM
I get nothing after this.
Last edited by ZacDaMan on Tue Nov 15, 2022 12:21 am, edited 1 time in total.

ZacDaMan
Posts: 47
Joined: Wed Dec 22, 2021 7:40 pm

Re: No output from ESP_LOGI()

Postby ZacDaMan » Sun Nov 13, 2022 10:35 pm

Tried using LOGW instead of LOGI, no change

ESP_Sprite
Posts: 9749
Joined: Thu Nov 26, 2015 4:08 am

Re: No output from ESP_LOGI()

Postby ESP_Sprite » Mon Nov 14, 2022 1:46 am

If you're using an older ESP-IDF version, you need to use menuconfig to set the logging output to the USB-JTAG-serial device, otherwise you only get the initial bootup chatter.

ZacDaMan
Posts: 47
Joined: Wed Dec 22, 2021 7:40 pm

Re: No output from ESP_LOGI()

Postby ZacDaMan » Mon Nov 14, 2022 2:45 am

ESP_Sprite wrote:
Mon Nov 14, 2022 1:46 am
If you're using an older ESP-IDF version, you need to use menuconfig to set the logging output to the USB-JTAG-serial device, otherwise you only get the initial bootup chatter.
I believe I'm using (one of) the latest versions, 4.3.1 - the only option that looks like what you describe is "Channel for console output", which is set to "Default: UART0"

ESP_Sprite
Posts: 9749
Joined: Thu Nov 26, 2015 4:08 am

Re: No output from ESP_LOGI()

Postby ESP_Sprite » Mon Nov 14, 2022 2:48 am

I think 4.4.3 is actually the most recent version. Regardless, that indeed is the setting you need to change to USB-serial-JTAG.

ZacDaMan
Posts: 47
Joined: Wed Dec 22, 2021 7:40 pm

Re: No output from ESP_LOGI()

Postby ZacDaMan » Mon Nov 14, 2022 2:49 am

ESP_Sprite wrote:
Mon Nov 14, 2022 2:48 am
I think 4.4.3 is actually the most recent version. Regardless, that indeed is the setting you need to change to USB-serial-JTAG.
The only available options are Default: UART0, Custom UART and None

ESP_Sprite
Posts: 9749
Joined: Thu Nov 26, 2015 4:08 am

Re: No output from ESP_LOGI()

Postby ESP_Sprite » Mon Nov 14, 2022 6:26 am

Then you might need to update your ESP-IDF version.

ZacDaMan
Posts: 47
Joined: Wed Dec 22, 2021 7:40 pm

Re: No output from ESP_LOGI()

Postby ZacDaMan » Mon Nov 14, 2022 9:17 pm

ESP_Sprite wrote:
Mon Nov 14, 2022 6:26 am
Then you might need to update your ESP-IDF version.
Updated to latest (4.4.3) and that enabled USB Serial/JTAG Controller, but still nothing from ESP_LOGI. Changing output to verbose, this is the startup output:

Code: Select all

I (326) boot: Loaded app from partition at offset 0x10000
I (326) boot: Disabling RNG early entropy source...
I (329) cpu_start: Pro cpu up.
D (332) efuse: In EFUSE_BLK1__DATA3_REG is used 3 bits starting with 18 bit
D (339) efuse: In EFUSE_BLK1__DATA5_REG is used 5 bits starting with 5 bit
D (346) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 7 bit
D (353) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 14 bit
D (360) efuse: In EFUSE_BLK1__DATA4_REG is used 8 bits starting with 21 bit
D (367) efuse: In EFUSE_BLK1__DATA4_REG is used 3 bits starting with 29 bit
D (374) efuse: In EFUSE_BLK1__DATA5_REG is used 5 bits starting with 0 bit
D (389) clk: RTC_SLOW_CLK calibration value: 3962752
I (398) cpu_start: Pro cpu start user code
I (398) cpu_start: cpu freq: 160000000
I (398) cpu_start: Application information:
I (401) cpu_start: Project name:     onoff_client
I (406) cpu_start: App version:      568ef7d-dirty
I (412) cpu_start: Compile time:     Nov 15 2022 10:11:40
I (418) cpu_start: ELF file SHA256:  58ae0b00989b6a76...
I (424) cpu_start: ESP-IDF:          v4.4.3
V (428) memory_layout: reserved range is 0x3c10c02c - 0x3c10c044
D (435) memory_layout: Checking 4 reserved memory ranges:
D (440) memory_layout: Reserved memory range 0x3fc80000 - 0x3fc92200
D (446) memory_layout: Reserved memory range 0x3fc92200 - 0x3fc9c3c0
D (453) memory_layout: Reserved memory range 0x3fcdf060 - 0x3fce0000
D (459) memory_layout: Reserved memory range 0x50000000 - 0x50000028
D (466) memory_layout: Building list of available memory regions:
V (472) memory_layout: Examining memory region 0x3fc80000 - 0x3fca0000
V (478) memory_layout: Start of region 0x3fc80000 - 0x3fca0000 overlaps reserved 0x3fc80000 - 0x3fc92200
V (488) memory_layout: Start of region 0x3fc92200 - 0x3fca0000 overlaps reserved 0x3fc92200 - 0x3fc9c3c0
D (498) memory_layout: Available memory region 0x3fc9c3c0 - 0x3fca0000
V (504) memory_layout: Examining memory region 0x3fca0000 - 0x3fcc0000
D (511) memory_layout: Available memory region 0x3fca0000 - 0x3fcc0000
V (517) memory_layout: Examining memory region 0x3fcc0000 - 0x3fcdc710
D (524) memory_layout: Available memory region 0x3fcc0000 - 0x3fcdc710
V (531) memory_layout: Examining memory region 0x3fcdc710 - 0x3fce0000
V (537) memory_layout: End of region 0x3fcdc710 - 0x3fce0000 overlaps reserved 0x3fcdf060 - 0x3fce0000
D (546) memory_layout: Available memory region 0x3fcdc710 - 0x3fcdf060
V (553) memory_layout: Examining memory region 0x50000000 - 0x50002000
V (560) memory_layout: Start of region 0x50000000 - 0x50002000 overlaps reserved 0x50000000 - 0x50000028
D (569) memory_layout: Available memory region 0x50000028 - 0x50002000
I (576) heap_init: Initializing. RAM available for dynamic allocation:
D (583) heap_init: New heap initialised at 0x3fc9c3c0
I (588) heap_init: At 3FC9C3C0 len 00040350 (256 KiB): DRAM
I (594) heap_init: At 3FCDC710 len 00002950 (10 KiB): STACK/DRAM
D (601) heap_init: New heap initialised at 0x50000028
I (606) heap_init: At 50000028 len 00001FD8 (7 KiB): RTCRAM
D (613) FLASH_HAL: extra_dummy: 0
V (613) memspi: raw_chip_id: 164020

V (616) memspi: chip_id: 204016

V (620) memspi: raw_chip_id: 164020

V (623) memspi: chip_id: 204016

D (627) spi_flash: trying chip: issi
D (627) spi_flash: trying chip: gd
D (627) spi_flash: trying chip: mxic
D (627) spi_flash: trying chip: winbond
D (627) spi_flash: trying chip: boya
D (627) spi_flash: trying chip: th
D (628) spi_flash: trying chip: generic
I (628) spi_flash: detected chip: generic
I (628) spi_flash: flash io: dio
D (628) cpu_start: calling init function: 0x420bcc50
0x420bcc50: _GLOBAL__sub_I__ZN9__gnu_cxx9__freeresEv at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/eh_alloc.cc:348

D (632) cpu_start: calling init function: 0x420bc9b8
0x420bc9b8: _GLOBAL__sub_I___cxa_get_globals_fast at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/eh_globals.cc:145

D (637) cpu_start: calling init function: 0x420bc8f6
0x420bc8f6: _GLOBAL__sub_I__ZN10__cxxabiv111__terminateEPFvvE at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imc/ilp32/no-rtti/libstdc++-v3/include/riscv32-esp-elf/bits/gthr-default.h:745
 (inlined by) __gnu_cxx::__mutex::__mutex() at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imc/ilp32/no-rtti/libstdc++-v3/include/ext/concurrence.h:135
 (inlined by) __static_initialization_and_destruction_0 at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:36
 (inlined by) _GLOBAL__sub_I__ZN10__cxxabiv111__terminateEPFvvE at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:125

D (642) cpu_start: calling init function: 0x420bc790
0x420bc790: _GLOBAL__sub_I__ZSt7nothrow at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imc/ilp32/no-rtti/libstdc++-v3/include/riscv32-esp-elf/bits/gthr-default.h:745
 (inlined by) __gnu_cxx::__mutex::__mutex() at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imc/ilp32/no-rtti/libstdc++-v3/include/ext/concurrence.h:135
 (inlined by) __static_initialization_and_destruction_0 at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/new_handler.cc:33
 (inlined by) _GLOBAL__sub_I__ZSt7nothrow at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/new_handler.cc:71

D (647) cpu_start: calling init function: 0x420b57f0
0x420b57f0: adc2_init_code_calibration at F:/Users/Isaac/esp-idf/components/driver/esp32c3/adc2_init_cal.c:20

D (652) efuse: In EFUSE_BLK2__DATA4_REG is used 3 bits starting with 0 bit
D (659) efuse: In EFUSE_BLK2__DATA5_REG is used 10 bits starting with 18 bit
V (666) ADC: Calib(V1) ADC1 atten=3: 06B4
D (666) cpu_start: calling init function: 0x420b2bea
0x420b2bea: s_set_default_wifi_log_level at F:/Users/Isaac/esp-idf/components/esp_wifi/src/wifi_init.c:63

D (671) cpu_start: calling init function: 0x4200002a
0x4200002a: esp_ota_init_app_elf_sha256 at F:/Users/Isaac/esp-idf/components/app_update/esp_app_desc.c:68

V (676) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (682) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xC02
D (691) intr_alloc: Connected src 39 to int 2 (cpu 0)
I (696) sleep: Configure to isolate all GPIO pins in sleep state
I (702) sleep: Enable automatic switching of GPIO sleep configuration
I (710) coexist: coexist rom version 9387209
V (710) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (716) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x40E
D (724) intr_alloc: Connected src 50 to int 3 (cpu 0)
I (729) cpu_start: Starting scheduler.
V (729) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (729) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x402
D (729) intr_alloc: Connected src 37 to int 4 (cpu 0)
D (729) heap_init: New heap initialised at 0x3fcdc710
V (729) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (729) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (729) intr_alloc: Connected src 33 to int 7 (cpu 0)
I (739) gpio: GPIO[9]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (739) gpio: GPIO[10]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 

ZacDaMan
Posts: 47
Joined: Wed Dec 22, 2021 7:40 pm

Re: No output from ESP_LOGI()

Postby ZacDaMan » Mon Nov 14, 2022 11:23 pm

Update, having the same issue with the ESP32-C3-DevKitM-1

ZacDaMan
Posts: 47
Joined: Wed Dec 22, 2021 7:40 pm

Re: No output from ESP_LOGI()

Postby ZacDaMan » Tue Nov 15, 2022 12:21 am

Solved, 2 problems:

1, setting the output to the serial jtag was unhelpful, it needed to be set to the default UART0

2, I when I switched from the C3 devkit to the Xiao board I forgot to remove some initializers for an LED that was no longer present; removing these functions allowed everything to work as expected.

Who is online

Users browsing this forum: danpf1 and 158 guests