ESP32 + SSD1306 - called `Result::unwrap()` on an `Err` value: BusWriteError

35p32fan
Posts: 12
Joined: Wed Oct 11, 2023 1:12 pm

ESP32 + SSD1306 - called `Result::unwrap()` on an `Err` value: BusWriteError

Postby 35p32fan » Sat Dec 16, 2023 12:32 pm

Hi,
found the Source Code at: https://github.com/andy31415/rust-esp32-c3-demos

Compile works, but did not run on my ESP-WROOM-32D

Console Output:

Code: Select all

ELF file SHA256: 0000000000000000

Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_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:0x3fff0030,len:7104
0x3fff0030 - g_ticks_per_us_app
    at ??:??
load:0x40078000,len:15576
0x40078000 - __udivmoddi4
    at ??:??
load:0x40080400,len:4
0x40080400 - _invalid_pc_placeholder
    at ??:??
ho 8 tail 4 room 4
load:0x40080404,len:3876
0x40080404 - _iram_text_start
    at ??:??
entry 0x4008064c
0x4008064c - _iram_text_start
    at ??:??
I (31) boot: ESP-IDF v5.1-beta1-378-gea5e0ff298-dirt 2nd stage bootloader
I (31) boot: compile time Jun  7 2023 07:48:23
I (33) boot: Multicore bootloader
I (37) boot: chip revision: v3.1
I (41) boot.esp32: SPI Speed      : 40MHz
I (46) boot.esp32: SPI Mode       : DIO
I (50) boot.esp32: SPI Flash Size : 4MB
I (55) boot: Enabling RNG early entropy source...
I (60) boot: Partition Table:
I (64) boot: ## Label            Usage          Type ST Offset   Length
I (71) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (79) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (86) boot:  2 factory          factory app      00 00 00010000 003f0000
I (94) boot: End of partition table
I (98) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=20628h (132648) map
I (154) esp_image: segment 1: paddr=00030650 vaddr=3ffb0000 size=02054h (  8276) load
I (158) esp_image: segment 2: paddr=000326ac vaddr=40080000 size=0c454h ( 50260) load
I (181) esp_image: segment 3: paddr=0003eb08 vaddr=00000000 size=01510h (  5392) 
I (183) esp_image: segment 4: paddr=00040020 vaddr=400d0020 size=4f71ch (325404) map
I (310) boot: Loaded app from partition at offset 0x10000
I (310) boot: Disabling RNG early entropy source...
I (321) cpu_start: Multicore app
I (322) cpu_start: Pro cpu up.
I (322) cpu_start: Starting app cpu, entry point is 0x400817a8
0x400817a8 - call_start_cpu1
    at /home/developer/rust/esp32-ssd1306/.embuild/espressif/esp-idf/v5.1.1/components/esp_system/port/cpu_start.c:154
I (309) cpu_start: App cpu up.
I (340) cpu_start: Pro cpu start user code
I (340) cpu_start: cpu freq: 160000000 Hz
I (340) cpu_start: Application information:
I (345) cpu_start: Project name:     libespidf
I (350) cpu_start: App version:      1
I (354) cpu_start: Compile time:     Dec 16 2023 13:14:09
I (360) cpu_start: ELF file SHA256:  0000000000000000...
I (366) cpu_start: ESP-IDF:          v5.1.1
I (371) cpu_start: Min chip rev:     v0.0
I (376) cpu_start: Max chip rev:     v3.99 
I (381) cpu_start: Chip rev:         v3.1
I (386) heap_init: Initializing. RAM available for dynamic allocation:
I (393) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (399) heap_init: At 3FFB2950 len 0002D6B0 (181 KiB): DRAM
I (405) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (411) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (418) heap_init: At 4008C454 len 00013BAC (78 KiB): IRAM
I (425) spi_flash: detected chip: generic
I (429) spi_flash: flash io: dio
W (433) rmt(legacy): legacy driver is deprecated, please migrate to `driver/rmt_tx.h` and/or `driver/rmt_rx.h`
W (443) pcnt(legacy): legacy driver is deprecated, please migrate to `driver/pulse_cnt.h`
W (452) timer_group: legacy driver is deprecated, please migrate to `driver/gptimer.h`
I (461) app_start: Starting scheduler on CPU0
I (466) app_start: Starting scheduler on CPU1
I (466) main_task: Started on CPU0
I (476) main_task: Calling app_main()
thread 'main' panicked at src/main.rs:27:20:
called `Result::unwrap()` on an `Err` value: BusWriteError
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

abort() was called at PC 0x400fbf02 on core 0
0x400fbf02 - panic_abort::__rust_start_panic::abort
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_abort/src/lib.rs:43


Backtrace: 0x4008229e:0x3ffb5530 0x4008606d:0x3ffb5550 0x4008b152:0x3ffb5570 0x400fbf02:0x3ffb55e0 0x400fbef6:0x3ffb5600 0x400dbd46:0x3ffb5620 0x400dbcf8:0x3ffb5670 0x400e2ecf:0x3ffb56e0 0x400e2d5c:0x3ffb5710 0x400dbac2:0x3ffb5730 0x40108ef0:0x3ffb5760 0x401091cf:0x3ffb57a0 0x400d7239:0x3ffb5800 0x400d7316:0x3ffb5830 0x4011e187:0x3ffb5cd0 0x400d6e04:0x3ffb5cf0 0x400e4b56:0x3ffb5d10 0x400d6df4:0x3ffb5d40 0x400d7563:0x3ffb5d70 0x400d8ddb:0x3ffb5d90 0x4011f11f:0x3ffb5db0
0x4008229e - panic_abort
    at /home/developer/rust/esp32-ssd1306/.embuild/espressif/esp-idf/v5.1.1/components/esp_system/panic.c:452
0x3ffb5530 - _heap_start
    at ??:??
0x4008606d - esp_system_abort
    at /home/developer/rust/esp32-ssd1306/.embuild/espressif/esp-idf/v5.1.1/components/esp_system/port/esp_system_chip.c:84
0x3ffb5550 - _heap_start
    at ??:??
0x4008b152 - abort
    at /home/developer/rust/esp32-ssd1306/.embuild/espressif/esp-idf/v5.1.1/components/newlib/abort.c:38
0x3ffb5570 - _heap_start
    at ??:??
0x400fbf02 - panic_abort::__rust_start_panic::abort
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_abort/src/lib.rs:43
0x3ffb55e0 - _heap_start
    at ??:??
0x400fbef6 - __rust_start_panic
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_abort/src/lib.rs:38
0x3ffb5600 - _heap_start
    at ??:??
0x400dbd46 - rust_panic
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/std/src/panicking.rs:757
0x3ffb5620 - _heap_start
    at ??:??
0x400dbcf8 - std::panicking::rust_panic_with_hook
    at ??:??
0x3ffb5670 - _heap_start
    at ??:??
0x400e2ecf - std::panicking::begin_panic_handler::{{closure}}
    at ??:??
0x3ffb56e0 - _heap_start
    at ??:??
0x400e2d5c - std::sys_common::backtrace::__rust_end_short_backtrace
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:170
0x3ffb5710 - _heap_start
    at ??:??
0x400dbac2 - rust_begin_unwind
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/std/src/panicking.rs:595
0x3ffb5730 - _heap_start
    at ??:??
0x40108ef0 - core::panicking::panic_fmt
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/panicking.rs:67
0x3ffb5760 - _heap_start
    at ??:??
0x401091cf - core::result::unwrap_failed
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/result.rs:1652
0x3ffb57a0 - _heap_start
    at ??:??
0x400d7239 - core::result::Result<T,E>::unwrap
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/result.rs:1077
0x3ffb5800 - _heap_start
    at ??:??
0x400d7316 - esp32_ssd1306::main
    at /home/developer/rust/esp32-ssd1306/src/main.rs:27
0x3ffb5830 - _heap_start
    at ??:??
0x4011e187 - core::ops::function::FnOnce::call_once
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/ops/function.rs:250
0x3ffb5cd0 - _heap_start
    at ??:??
0x400d6e04 - std::rt::lang_start::{{closure}}
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/std/src/rt.rs:166
0x3ffb5cf0 - _heap_start
    at ??:??
0x400e4b56 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/ops/function.rs:284
0x3ffb5d10 - _heap_start
    at ??:??
0x400d6df4 - std::rt::lang_start
    at /home/developer/.rustup/toolchains/esp/lib/rustlib/src/rust/library/std/src/rt.rs:165
0x3ffb5d40 - _heap_start
    at ??:??
0x400d7563 - main
    at ??:??
0x3ffb5d70 - _heap_start
    at ??:??
0x400d8ddb - app_main
    at /home/developer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-sys-0.33.7/src/start.rs:49
0x3ffb5d90 - _heap_start
    at ??:??
0x4011f11f - main_task
    at /home/developer/rust/esp32-ssd1306/.embuild/espressif/esp-idf/v5.1.1/components/freertos/app_startup.c:208
0x3ffb5db0 - _heap_start
    at ??:??

35p32fan
Posts: 12
Joined: Wed Oct 11, 2023 1:12 pm

Re: ESP32 + SSD1306 - called `Result::unwrap()` on an `Err` value: BusWriteError

Postby 35p32fan » Sat Dec 16, 2023 12:44 pm

changed the gpio 21 with 22 and 22 with 21
now it works

Who is online

Users browsing this forum: No registered users and 8 guests