WIP / POC for using the ESP32C3 wifi drivers in bare-metal Rust

Overview

Wifi on ESP32C3 (on bare-metal Rust)

About

This is experimental and work-in-progress! You are welcome to contribute but probably shouldn't use this for something real yet.

This uses the WiFi driver found in https://github.com/espressif/esp-wireless-drivers-3rdparty

Version used

esp-wireless-drivers-3rdparty-055f1ef49d0cb72c24bd492fbbdd37497a90bdae 45701c0

https://github.com/espressif/esp-wireless-drivers-3rdparty/archive/45701c0.zip

Example

  • dhcp
    • set SSID and PASSWORD env variable
    • gets an ip address via DHCP
    • it prints the ip address it gets
    • if everything works you should be able to ping and connect to port 4321

What works?

  • scanning for WiFi access points
  • connect to WiFi access point

Directory Structure

  • src/timer.rs: systimer code used for timing and task switching
  • src/preemt/: a bare minimum RISCV round-robin task scheduler
  • src/log/: code used for logging
  • src/binary/: generated bindings to the WiFi driver
  • src/compat/: code needed to emulate enough of an (RT)OS to use the driver
    • malloc.rs: a homegrown allocator - this is NOT used on the Rust side (the Rust side of this is currently no-alloc)
    • common.rs: basics like semaphores and recursive mutexes
    • timer_compat.rs: code to emulate timer related functionality
  • headers: headers found in the WiFi driver archive (bindings are generated from these)
  • libs: static libraries found in the WiFi driver archive (these get linked into the binary)
  • mkbindings.bat: generate the bindings / just calls bindgen
  • rom_functions.x: the WiFi driver uses some of these so it needs to get linked
  • esp32c3-wifi-link.x: the main linker script - needs to get cleaned up
  • examples/dhcp.rs: example using the code

Missing / To be done

  • separating chip specific / architecture specific code (and create implementations for others)
  • Bluetooth (and coex)
  • esp-now
  • powersafe support

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Comments
  • Update embedded svc

    Update embedded svc

    This is based on the #82 branch, so until that's merged this is blocked. I only implemented the Wifi trait on the Wifi struct, but where should I implement the Interface trait. This contains the actual IP info, should I directly implement it into Wifi or should we change places into Network, what should we do with the poll_dhcp function then in Wifi

    Closes #83

    opened by ImUrX 22
  • Remove the embedded-nal / smoltcp-nal dependencies from `wifi_interface.rs` and esp-wifi

    Remove the embedded-nal / smoltcp-nal dependencies from `wifi_interface.rs` and esp-wifi

    While smoltcp itself has no alternative in the embedded world, I'm less than convinced that embedded-nal is the no-brainer for embedded networking: it still relies on the nb "async" approach, which is essentially just busylooping with constant polling of the networking layer. While this might have been the norm a few years ago, it is no more:

    • embedded-hal is moving away from nb in favor of the async-based traits
    • smoltcp itself has an async support and an async feature since quite some time, so it is very easy to bind it to an async executor of your choice, if you prefer so

    In my opinion:

    • We need to remove from esp-wifi all dependencies / reliance on embedded-nal / smoltcp-nal. This stuff is anyway a thin wrapper on top of the heavy lifting done by smoltcp itself
    • The Wifi struct can instead take directly the smoltcp IP interface, i.e. the "ethernet" var
    • This way, the create_network_stack utility will construct and return directly the smoltcp interface instead of the embedded-nal wrapper. Perhaps, we should rename the utility to create_network_interface or suchlike
    • The network_stack method of the Wifi struct should instead directly return the native smoltcp interface

    With that little surgery, users would be free to either use smoltcp-nal on top of the smoltcp interface returned by Wifi, or the smoltcp built-in async facilities, with an async executor of their choice.

    opened by ivmarkov 17
  • DHCP example fails to get an IP address on ESP32-C3

    DHCP example fails to get an IP address on ESP32-C3

    Hi, I tried running the DHCP example (commit a0a6b5fbcf7) on my esp32-c3-mini and it appears as though the code is racy. It fails to get an ip address, unless I do some random permutation of dump_packets, wifi_logs, and manually putting in for i in 1000 {} style loops.

    I'm working with @ImUrX and he also cannot get the example working on his PCB, although his is a lolin_c3_mini v1.0.0 (which may have hardware issues with wifi, so could be a red herring).

    If I use --release it works consistently.

    opened by TheButlah 16
  • dhcp_esp32c3 example fails to get an IP address when compiled in Release

    dhcp_esp32c3 example fails to get an IP address when compiled in Release

    When the dhcp_esp32c3 is ran in release it hangs at Start busy loop on main and never continues. This same dhcp_esp32c3 example gets an IP address from DHCP as expected for me when it's ran in debug.

    Related to #6?

    bug 
    opened by D1plo1d 16
  • Getting linking issues when using esp-wifi

    Getting linking issues when using esp-wifi

    I was adding esp32 support to my esp32c3 project and for some reason I'm getting linking issues when activating the esp-wifi feature I have. I honestly dont understand much so maybe I can get some help in here: This is the linking error and this is the project

    opened by ImUrX 10
  • Fix ESP32-C3 development mode

    Fix ESP32-C3 development mode

    This should address the issue reported in #88

    Additionally

    • updated embedded-io to 0.3.1
    • improve mkbindings.bat
    • don't report StaDisconnected as connected anymore
    opened by bjoernQ 8
  • Update drivers

    Update drivers

    This closes #52

    • update the drivers for ESP32 and ESP32-C3
    • improve the examples

    While this PR seems to be huge, it isn't. Most of the changes are in C headers and generated bindings.

    opened by bjoernQ 8
  • Swap out the current allocator for `esp-alloc`

    Swap out the current allocator for `esp-alloc`

    ~~This builds on #39, and as such cannot be merged until that PR is.~~

    This works on the ESP32-C3 without issue, however building for the ESP32 results in a linker error:

    error: linking with `xtensa-esp32-elf-gcc` failed: exit status: 1
      |
      = note: "xtensa-esp32-elf-gcc" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.0.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.1.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.10.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.11.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.12.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.13.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.14.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.15.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.2.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.3.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.4.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.5.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.6.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.7.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.8.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.dhcp_esp32.cb737b37-cgu.9.rcgu.o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b.iwnybrojg66ry1h.rcgu.o" "-Wl,--as-needed" "-L" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps" "-L" "/Users/jesse/Work/esp-wifi/target/release/deps" "-L" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/build/esp-wifi-4cf6e16cf3490c76/out" "-L" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/build/xtensa-lx-4a114887ea50d4c3/out" "-L" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/build/xtensa-lx-rt-ef310f0681dc9281/out" "-L" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/build/esp32-hal-981d4cfdf0ff5b85/out" "-L" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/build/esp32-5c76282a31736b6e/out" "-L" "/Users/jesse/.rustup/toolchains/esp/lib/rustlib/xtensa-esp32-none-elf/lib" "-Wl,-Bstatic" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libesp_wifi-fbe4abcbcf215b69.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libesp_alloc-c060953ba804a78a.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/liblinked_list_allocator-4ef263736359aad4.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libspinning_top-21c5f0355a2085be.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libsmoltcp-0bba41ed2db86d27.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libbitflags-2a9f9e706eec8442.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libmanaged-0f6b57e1625fcb7e.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libatomic_polyfill-bb467dab1e9b276f.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libcritical_section-36eac500ce94d399.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/liblog-ca5de0a110cc2fb9.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libesp_println-f12f43cb0797d101.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libesp32_hal-49cf89aa123eccd0.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libesp_hal_common-6d4f0442eb78b1f6.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libcritical_section-279312af61635534.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libcfg_if-778cc715c08c90dd.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libsmart_leds_trait-bf02318b2b258ba1.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/librgb-a61c6a77a5526a3b.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libbytemuck-95ec8e92ea41d238.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libxtensa_lx_rt-8f3e4a9df978c770.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libr0-27ef6ffbef74e8fa.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libfugit-f3d074f1f67858f7.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libgcd-aaa05ddbeaa2620a.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libesp32-7a9f161a7164ba4b.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libxtensa_lx-92fa6630c50fa721.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libspin-dc50f05a7a63865a.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/liblock_api-1b5268dfcd1bf4d3.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libscopeguard-4fd0099d2fa4a15e.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libmutex_trait-f357cef0832b190b.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libbare_metal-8c92058f831287bd.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libvcell-96a925c0101a1afe.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libembedded_hal-5849c01705429e94.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libvoid-e716c48010b93998.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libnb-7384b7c50b3fc834.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libnb-f671a0f55f07f463.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libembedded_svc-0c32aacbbd83c2a9.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libheapless-99bb4813e7ca9dec.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libhash32-23fe63db3bca42b9.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libbyteorder-3eec2d3701626149.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libserde-506dfce2d6d3eeca.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libno_std_net-c8aed46919778570.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libenumset-efb2872dc7c531a5.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libembedded_io-39243cccb0fb937d.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/liballoc-cab08ec8de2630a1.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/librustc_std_workspace_core-2bb66c92ab28eb50.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libcore-822e4434f606ddd3.rlib" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/deps/libcompiler_builtins-23011b67784957ef.rlib" "-Wl,-Bdynamic" "-lbtdm_app" "-lcoexist" "-lcore" "-lespnow" "-lmesh" "-lnet80211" "-lphy" "-lpp" "-lrtc" "-lsmartconfig" "-lwapi" "-lwpa_supplicant" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/Users/jesse/.rustup/toolchains/esp/lib/rustlib/xtensa-esp32-none-elf/lib" "-o" "/Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b" "-Wl,--gc-sections" "-no-pie" "-Wl,-O1" "-nodefaultlibs" "-Tlinkall.x" "-Tesp32_rom_functions.x"
      = note: /Users/jesse/.espressif/tools/xtensa-esp32-elf-gcc/8_4_0-esp-2021r2-patch3-x86_64-apple-darwin/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/jesse/Work/esp-wifi/target/xtensa-esp32-none-elf/release/examples/dhcp_esp32-db6b59f4ab95624b section `.bss' will not fit in region `dram_seg'
              /Users/jesse/.espressif/tools/xtensa-esp32-elf-gcc/8_4_0-esp-2021r2-patch3-x86_64-apple-darwin/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: region `dram_seg' overflowed by 35876 bytes
              collect2: error: ld returned 1 exit status
    

    Not sure why dram_seg is overflowing. Reducing the heap size allows it to build, but results in runtime errors instead.

    opened by jessebraham 8
  • Can't connect to any AP?

    Can't connect to any AP?

    I've been playing around trying to get this work. Scanning works perfectly, I can see a table of networks near me, but If I try to connect to any (I've tried 4 in total, on two different esp32c3's), the WiFi state never transitions to STA_CONNECTED. Judging by the logs below is transitions to STA_STOP.

    wifi_connect returned 0
    D (405) wifi:scan end: arg=0x0, status=0, ss_state=0x03
    V (405) wifi:hint scan, stop scan
    V (405) wifi:back home chan=<1,0>, current chan=<10,0>
    V (408) wifi:ht20 freq=2412, chan=1
    D (412) wifi:filter: set rx policy=4
    D (412) wifi:first chan=1
    V (416) wifi:scan_done: arg=0x0, status=0, cur_time=647416, scan_id=128, scan state=00
    V (423) wifi:call scan_done cb, arg=0x0
    D (427) wifi:handoff_cb: status=0
    D (431) wifi:clear rc list
    D (431) wifi:clear blacklist
    D (435) wifi:send disconnect event
    D (438) wifi:connect status 1 -> 3
    D (442) wifi:disable connect timer
    D (443) wifi:clear scan ap list
    

    Things I've tried

    • Different AP's
    • Different boards
    • Changing the country code in wifi_init

    I've sniffed the connect packed with my laptop in promiscuous mode and the packet seems normal.

    opened by MabezDev 6
  • Feature Request: UDP Sockets

    Feature Request: UDP Sockets

    I'm interested in using a esp32c3 to received UDP packets. I've been playing with the DHCP example and it looks like it is working quite well (kudos!) and I'm excited to use this more - is there any chance that UDP support is coming soon?

    opened by D1plo1d 5
  • lld_pdu.c assertions running BLE example on `esp32` chip

    lld_pdu.c assertions running BLE example on `esp32` chip

     $ cargo "+esp" run --example ble --release --target xtensa-esp32-none-elf --features "esp32,ble"
       Compiling esp-wifi v0.1.0 (/Users/brandonros/Desktop/esp-wifi)
        Finished release [optimized] target(s) in 1.66s
         Running `espflash --speed 921600 --monitor target/xtensa-esp32-none-elf/release/examples/ble`
    Detected 2 serial ports. Ports which match a known common dev board are highlighted.
    
    Serial port: /dev/tty.usbserial-02728E37
    Connecting...
    
    WARN setting baud rate higher than 115200 can cause issues.
    Chip type:         ESP32 (revision 3)
    Crystal frequency: 40MHz
    Flash size:        16MB
    Features:          WiFi, BT, Dual Core, 240MHz, Coding Scheme None
    MAC address:       94:b9:7e:57:4b:18
    App/part. size:    294688/16711680 bytes, 1.76%
    [00:00:00] ########################################      16/16      segment 0x1000                                                                                                                                              [00:00:00] ########################################       1/1       segment 0x8000                                                                                                                                              [00:00:03] ########################################     156/156     segment 0x10000                                                                                                                                             
    Flashing has completed!
    Commands:
        CTRL+R    Reset chip
        CTRL+C    Exit
    
    ets Jul 29 2019 12:21:46
    rst:0x1 (POWERON_RESET),boot:0x17 (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:0x3fff0048,len:12
    ho 0 tail 12 room 4
    load:0x3fff0054,len:4800
    load:0x40078000,len:17448
    0x40078000 - r_rwip_reset
        at ??:??
    load:0x4007c428,len:4840
    0x4007c428 - r_rwip_reset
        at ??:??
    entry 0x4007c6a0
    0x4007c6a0 - r_rwip_reset
        at ??:??
    WARN - coex_register_bt_cb 0x40081698
    0x40081698 - coex_bt_callback
        at ??:??
    WARN - coex_schm_register_btdm_callback 0x400df318
    0x400df318 - coex_schm_btdm_callback
        at ??:??
    WARN - coex_wifi_channel_get
    Ok(CommandComplete { num_packets: 5, opcode: 3075, data: [0] })
    Ok(CommandComplete { num_packets: 5, opcode: 8198, data: [0] })
    Ok(CommandComplete { num_packets: 5, opcode: 8200, data: [0] })
    Ok(CommandComplete { num_packets: 5, opcode: 8202, data: [0] })
    started advertising
    ASSERT_PARAM(9 0), in lld_pdu.c at line 605
    Exception occured Illegal Context { PC: 400816df, PS: 60c11, A0: 80081ac5, A1: 3ffff1e0, A2: 0, A3: 9, A4: 0, A5: 3f4110da, A6: 25d, A7: fffffffc, A8: 8000814b, A9: 3ffff150, A10: 0, A11: 3ffff173, A12: 3ffff11f, A13: 35, A14: 0, A15: 3ffff124, SAR: 4, EXCCAUSE: 0, EXCVADDR: 0, LBEG: 400819cd, LEND: 400819d5, LCOUNT: 0, THREADPTR: 0, SCOMPARE1: 0, BR: 0, ACCLO: 0, ACCHI: 0, M0: 0, M1: 0, M2: 0, M3: 0, F64R_LO: 0, F64R_HI: 0, F64S: 0, FCR: 0, FSR: 80, F0: 433b8000, F1: 426c0000, F2: 43800000, F3: 0, F4: 0, F5: 0, F6: 0, F7: 0, F8: 0, F9: 0, F10: 0, F11: 0, F12: 0, F13: 0, F14: 0, F15: 0 }
    0x400816df
    0x400816df - r_assert
        at ??:??
    0x40081ac5
    0x40081ac5 - r_assert_param
        at ??:??
    0x40086364
    0x40086364 - r_lld_pdu_rx_handler
        at ??:??
    0x40084be4
    0x40084be4 - r_lld_evt_end
        at ??:??
    0x400848f5
    0x400848f5 - r_lld_evt_end_isr
        at ??:??
    0x400870b1
    0x400870b1 - r_rwble_isr
        at ??:??
    0x40088432
    0x40088432 - r_rwbtdm_isr_wrapper
        at ??:??
    0x400d3521
    0x400d3521 - RWBLE
        at ??:??
    0x4008ba44
    0x4008ba44 - _ZN14esp_hal_common9interrupt8vectored16handle_interrupt17hd4ff79f68e7aaaf8E
        at ??:??
    0x4008b9fd
    0x4008b9fd - _ZN14esp_hal_common9interrupt8vectored17handle_interrupts17h66a646a6760229b5E
        at ??:??
    0x4008af91
    0x4008af91 - __level_3_interrupt
        at ??:??
    0x4008bc92
    0x4008bc92 - .RestoreContext
        at ??:??
    ets Jul 29 2019 12:21:46
    rst:0x1 (POWERON_RESET),boot:0x17 (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:0x3fff0048,len:12
    ho 0 tail 12 room 4
    load:0x3fff0054,len:4800
    load:0x40078000,len:17448
    0x40078000 - r_rwip_reset
        at ??:??
    load:0x4007c428,len:4840
    0x4007c428 - r_rwip_reset
        at ??:??
    entry 0x4007c6a0
    0x4007c6a0 - r_rwip_reset
        at ??:??
    WARN - coex_register_bt_cb 0x40081698
    0x40081698 - coex_bt_callback
        at ??:??
    WARN - coex_schm_register_btdm_callback 0x400df318
    0x400df318 - coex_schm_btdm_callback
        at ??:??
    WARN - coex_wifi_channel_get
    Ok(CommandComplete { num_packets: 5, opcode: 3075, data: [0] })
    Ok(CommandComplete { num_packets: 5, opcode: 8198, data: [0] })
    Ok(CommandComplete { num_packets: 5, opcode: 8200, data: [0] })
    Ok(CommandComplete { num_packets: 5, opcode: 8202, data: [0] })
    started advertising
    INFO - polled: Some(AsyncData(AclPacket { handle: 0, boundary_flag: FirstAutoFlushable, bc_flag: PointToPoint, data: [3, 0, 4, 0, 2, f, 2] }))
    INFO - att: ExchangeMtu { mtu: 20f }
    INFO - Requested MTU 527, returning 23
    INFO - src_handle 0
    INFO - data [3, 17, 0]
    INFO - encoded_l2cap [3, 0, 4, 0, 3, 17, 0]
    INFO - writing [2, 0, 20, 7, 0, 3, 0, 4, 0, 3, 17, 0]
    INFO - polled: Some(Event(NumberOfCompletedPackets { number_of_connection_handles: 1, connection_handles: 0, completed_packets: 1 }))
    INFO - polled: Some(AsyncData(AclPacket { handle: 0, boundary_flag: FirstAutoFlushable, bc_flag: PointToPoint, data: [3, 0, 4, 0, a, 3, 0] }))
    INFO - att: ReadReq { handle: 3 }
    INFO - src_handle 0
    INFO - data [b, 48, 65, 6c, 6c, 6f, 20, 42, 61, 72, 65, 2d, 4d, 65, 74, 61, 6c, 20, 42, 4c, 45]
    INFO - encoded_l2cap [15, 0, 4, 0, b, 48, 65, 6c, 6c, 6f, 20, 42, 61, 72, 65, 2d, 4d, 65, 74, 61, 6c, 20, 42, 4c, 45]
    INFO - writing [2, 0, 20, 19, 0, 15, 0, 4, 0, b, 48, 65, 6c, 6c, 6f, 20, 42, 61, 72, 65, 2d, 4d, 65, 74, 61, 6c, 20, 42, 4c, 45]
    INFO - polled: Some(Event(NumberOfCompletedPackets { number_of_connection_handles: 1, connection_handles: 0, completed_packets: 1 }))
    ASSERT_PARAM(0 182), in lld_pdu.c at line 605
    Exception occured Illegal Context { PC: 400816df, PS: 60811, A0: 80081ac5, A1: 3ffd8e80, A2: 0, A3: 0, A4: b6, A5: 3f4110da, A6: 25d, A7: fffffffc, A8: 8000814b, A9: 3ffd8df0, A10: 0, A11: 3ffd8e13, A12: 3ffd8dbf, A13: 35, A14: 0, A15: 3ffd8dc4, SAR: 4, EXCCAUSE: 0, EXCVADDR: 0, LBEG: 400819cd, LEND: 400819d5, LCOUNT: 0, THREADPTR: 0, SCOMPARE1: 0, BR: 0, ACCLO: 0, ACCHI: 0, M0: 0, M1: 0, M2: 0, M3: 0, F64R_LO: 0, F64R_HI: 0, F64S: 0, FCR: 0, FSR: 0, F0: 0, F1: 0, F2: 0, F3: 0, F4: 0, F5: 0, F6: 0, F7: 0, F8: 0, F9: 0, F10: 0, F11: 0, F12: 0, F13: 0, F14: 0, F15: 0 }
    0x400816df
    0x400816df - r_assert
        at ??:??
    0x40081ac5
    0x40081ac5 - r_assert_param
        at ??:??
    0x40086364
    0x40086364 - r_lld_pdu_rx_handler
        at ??:??
    0x40084be4
    0x40084be4 - r_lld_evt_end
        at ??:??
    0x400848f5
    0x400848f5 - r_lld_evt_end_isr
        at ??:??
    0x400870b1
    0x400870b1 - r_rwble_isr
        at ??:??
    0x40088432
    0x40088432 - r_rwbtdm_isr_wrapper
        at ??:??
    0x400d3521
    0x400d3521 - RWBLE
        at ??:??
    0x4008ba44
    0x4008ba44 - _ZN14esp_hal_common9interrupt8vectored16handle_interrupt17hd4ff79f68e7aaaf8E
        at ??:??
    0x4008b9fd
    0x4008b9fd - _ZN14esp_hal_common9interrupt8vectored17handle_interrupts17h66a646a6760229b5E
        at ??:??
    0x4008af91
    0x4008af91 - __level_3_interrupt
        at ??:??
    0x4008bc92
    0x4008bc92 - .RestoreContext
        at ??:??
    
    
    
    opened by brandonros 4
  • WiFi for ESP32-C2

    WiFi for ESP32-C2

    This implements WiFi for ESP32-C2

    Please note that to run the examples you need to change Cargo.toml as explained in the README since we cannot have feature-dependent dev-dependencies

    opened by bjoernQ 0
  • Double Check Wrapping Behavior of Timers

    Double Check Wrapping Behavior of Timers

    Several functions include blocking behavior or generally deal with timers - double check them for the wrapping behavior of the timers Also note that the timers on different targets have different bit-widths

    opened by bjoernQ 0
  • Support async

    Support async

    Would be very nice. I haven't actually read a lot on how it should work. We would first need embedded-svc to implement an async trait which is nightly. But I see a lot of calls like scanning that could be async and it would be pretty nice to have that, I also see that smoltcp implements Wakers for their socket stuff, could we also have async sends and receives :astonished:?

    opened by ImUrX 3
  • Support `direct-boot` mode

    Support `direct-boot` mode

    So far I've been really appreciating tools like defmt-rtt, cargo embed, probe-rs etc. I believe these tools are only possible with the direct-boot mode of esp-hal. Therefore it would be awesome to add support for using esp-wifi in direct-boot mode.

    Does anyone have any guidance for someone looking to implement this? I assume its all to do with how the linker script works.

    opened by TheButlah 6
Owner
Björn Quentin
💖 Rust everywhere 💖
Björn Quentin
Allocation-free UnionFind library for bare metal environments

Allocation-free UnionFind library for bare metal environments The library provides the following algorithms that is used with UnionFind. QuickFind Qui

Budi Syahiddin 7 Dec 10, 2022
[WIP] wadachi scrapes your GitHub Activities.

wadachi wadachi scrapes your GitHub Activities. Usage | Examples | Docs This library is currently under development. Dependencies [dependencies] wadac

Takayuki Maeda 2 Mar 18, 2022
WireGuard front for mitmproxy (WIP)

mitmguard work-in-progress WireGuard front for mitmproxy Architecture DONE multi-threaded / asynchronous WireGuard server using tokio: one worker thre

Fabio Valentini 23 Jan 5, 2023
WireGuard frontend for mitmproxy (WIP)

mitmproxy_wireguard Transparently proxy any device that can be configured as a WireGuard client! Work-In-Progress. Architecture DONE multi-threaded /

Fabio Valentini 20 Dec 29, 2022
Cross-platform, low level networking using the Rust programming language.

libpnet Linux ∪ OS X Build Status: Windows Build Status: Discussion and support: #libpnet on freenode / #rust-networking on irc.mozilla.org / #rust on

null 1.8k Jan 6, 2023
Simple VPN implemented using rust

fubuki Simple VPN implemented using rust fubuki是类似与tincVPN的简单组网工具 不支持对等NAT 支持的平台: Windows Linux 工作机制 它由一台拥有公网IP的服务器来维持各个内网客户端的实际地址映射,在客户端和客户端之间实现P2P通信

XTY 84 Dec 31, 2022
Implementing Bendersnatch curve using Arkwork's framework in Rust.

This is a reference implementation of Bendersnatch curve using Arkwork's framework in Rust. The spec of the curve is available here. There was also a Python reference implementation here.

zhenfei 8 Jun 18, 2022
Examples of interacting with a Polkadot node using Rust

Examples of interacting with a Polkadot node Some examples of using JSON RPC to interact with a Polkadot node, working up to manually building and sub

Parity Technologies 15 Dec 21, 2022
Modrinth API is a simple library for using Modrinth's API in Rust projects

Ferinth is a simple library for using the Modrinth API in Rust projects. It uses reqwest as its HTTP(S) client and deserialises responses to typed structs using serde.

null 20 Dec 8, 2022
RusTCP is an attempt to rewrite some of the PyTCP stack functionality using Rust language.

RusTCP is an attempt to rewrite some of the PyTCP stack functionality using Rust language. Currently, the main goal of this project is to create a stable IPv6 platform that could be used to facilitate the process of labing the SRv6 technology.

Sebastian Majewski 3 Dec 5, 2022
A generic Rust based Bigtable connection library implemented using gRPC

A generic Rust based Bigtable connection library refactored out the solana mono-repo so that can be shared for different applications.

Lijun Wang 3 Sep 25, 2022
An example of a common Wi-Fi set up scenario on ESP32 using Rust

UTC IoT fetcher This repo is an example of how to configure a Wi-Fi client on an ESP32-based IoT device using an external device connection to the int

Max Wase 4 Jan 19, 2023
A simple API gateway written in Rust, using the Hyper and Reqwest libraries.

API Gateway A simple API gateway written in Rust, using the Hyper and Reqwest libraries. This gateway can be used to forward requests to different bac

Adão Raul 3 Apr 24, 2023
Download a file using multiple threads in parallel for faster download speeds.

multidl Download a file using multiple threads in parallel for faster download speeds. Uses 0 external dependencies. Usage Usage: multidl [--help] ADD

Divyanshu Agrawal 2 Sep 12, 2021
Tunnel TCP traffic through SOCKS5 or HTTP using a TUN interface.

tun2proxy Tunnel TCP traffic through SOCKS5 or HTTP on Linux. Authentication not yet supported. Error handling incomplete and too restrictive. Build C

B. Blechschmidt 34 Nov 29, 2022
The Graph is a protocol for building decentralized applications (dApps) quickly on Ethereum and IPFS using GraphQL.

Graph Node The Graph is a protocol for building decentralized applications (dApps) quickly on Ethereum and IPFS using GraphQL. Graph Node is an open s

Mindy.wang 2 Jun 18, 2022
Private swaps for Secret Network using a private entropy pool & differential privacy.

WIP SecretSwap: Anon Edition Private swaps for Secret Network! Uses private entropy pool for differential privacy when reporting pools sizes. Swap amo

SCRT Labs 5 Apr 5, 2022
Proxy sentry request to a sentry server using a tunnel/proxy endpoint

Sentry Tunnel This is a proxy that forwards tunneled sentry requests to the real sentry server. The implementation is based on the explanation provide

Paul FLORENCE 14 Dec 20, 2022
YAC (Yac is Another Chat) is an example of Chat using WebSocket.

YAC (Yac is Another Chat) is an example of Chat using WebSocket. Because often the example you find in internet are "not so production ready", I would like to try to implement something more robust.

Tommaso Allevi 8 May 24, 2022