Skip to content

Examples fail due to lack of memory #42

@yanshay

Description

@yanshay

I tried to run the sync_client and async_client examples on ESP32, both had memory issues as below.

I tried to increase the esp_wifi heap size incrementally and tested, it always failed on memory allocation, until it couldn't compile anymore due to too large heap, reporting: section .dram2_uninit' will not fit in region dram2_seg'

Any way to get it to work? And even if I do, does it mean no memory will be left for my app? I don't need much but would need something.

Here are the execution logs:

INFO - esp-wifi configuration Config { rx_queue_size: 5, tx_queue_size: 3, static_rx_buf_num: 10, dynamic_rx_buf_num: 32, static_tx_buf_num: 0, dynamic_tx_buf_num: 32, ampdu_rx_enable: 0, ampdu_tx_enable: 0, amsdu_tx_enable: 0, rx_ba_win: 6, max_burst_size: 1, country_code: "CN", country_code_operating_class: 0, mtu: 1492, heap_size: 95000, tick_rate_hz: 100, listen_interval: 3, beacon_timeout: 6, ap_beacon_timeout: 300, failure_retry_cnt: 1, scan_method: 0 }
Call wifi_connect
Wait to get connected
Wait to get an ip address
Got ip Ok(IpInfo { ip: 192.168.10.96, subnet: Subnet { gateway: 192.168.10.1, mask: Mask(24) }, dns: Some(192.168.10.1), secondary_dns: None })
We are connected!
Making HTTP request
Start tls connect
WARN - Unable to allocate 1044 bytes
WARN - Unable to allocate 1044 bytes



!! A panic occured in 'examples/sync_client.rs', at line 125, column 33:
PanicInfo {
    payload: Any { .. },
    message: Some(
        called `Result::unwrap()` on an `Err` value: MbedTlsError(-9984),
    ),
    location: Location {
        file: "examples/sync_client.rs",
        line: 125,
        col: 33,
    },
    can_unwind: true,
    force_no_backtrace: false,
}

Backtrace:

0x400ee68b
0x400ee68b - core::result::unwrap_failed
    at /Users/my_user/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/result.rs:1679
0x400d69e5
0x400d69e5 - core::result::Result<T,E>::unwrap
    at /Users/my_user/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/result.rs:1102
0x400ec44c
0x400ec44c - Reset
    at /Users/my_user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/xtensa-lx-rt-0.16.0/src/lib.rs:70
0x400ebda1
0x400ebda1 - ESP32Reset
    at /Users/my_user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-hal-0.19.0/src/soc/esp32/mod.rs:114
0x3ffffffd
0x40079a81
0x400806b5
0x400806b5 - log::__private_api::log
    at /Users/my_user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/log-0.4.22/src/__private_api.rs:72
0x40007c31
0x4000073d
0x3ffffffd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions