Skip to content

Stack corruption detected using esp-wifi within an ESP32-PICO-D4 #2717

Answered by bjoernQ
rowanfr asked this question in Q&A
Discussion options

You must be logged in to vote

Seems like the stack-protector is doing a good job here.

From a brief look I'd say reserving memory for 64 sockets is a lot (StackResources<64> )

You can try to reduce that.

You can also use the otherwise unused memory used by the 2nd stage bootloader during boot for the heap.

To do that replace heap_allocator!(72 * 1024); with

    #[link_section = ".dram2_uninit"]
    static mut HEAP2: core::mem::MaybeUninit<[u8; 64 * 1024]> = core::mem::MaybeUninit::uninit();

    unsafe {
        esp_alloc::HEAP.add_region(esp_alloc::HeapRegion::new(
            HEAP2.as_mut_ptr() as *mut u8,
            core::mem::size_of_val(&*core::ptr::addr_of!(HEAP2)),
            esp_alloc::MemoryCapability::Inte…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@MabezDev
Comment options

@rowanfr
Comment options

Answer selected by rowanfr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants