Skip to content

Conversation

@AnthonyGrondin
Copy link

This makes the experiment run on esp32s3.
esp-hal is currently patched until a new version is released that contains the fix in: esp-rs/esp-hal#616
esp-wifi uses commit from esp-rs/esp-wifi-sys#205 to test on the latest revision

TODO

This currently gives me a borrow error in esp-wifi, which still needs to be figured out.

!! A panic occured in '~/.cargo/git/checkouts/esp-wifi-836f3b2af57fa847/f80df63/esp-wifi/src/timer_esp32s3.rs', at line 189, column 32
 
PanicInfo {
    payload: Any { .. },
    message: Some(
        already borrowed: BorrowMutError,
    ),
    location: Location {
        file: "~/.cargo/git/checkouts/esp-wifi-836f3b2af57fa847/f80df63/esp-wifi/src/timer_esp32s3.rs",
        line: 189,
        col: 32,
    },
    can_unwind: true,
}

@bjoernQ
Copy link
Owner

bjoernQ commented Jul 4, 2023

I tried your code and it worked fine for me

❯ cargo +esp-1.68 run --release
    Finished release [optimized + debuginfo] target(s) in 0.27s
     Running `espflash flash --monitor target\xtensa-esp32s3-none-elf\release\dhcp_experiment`
[2023-07-04T07:59:39Z INFO ] Serial port: 'COM7'
[2023-07-04T07:59:39Z INFO ] Connecting...
[2023-07-04T07:59:39Z INFO ] Using flash stub
[2023-07-04T07:59:40Z WARN ] Setting baud rate higher than 115,200 can cause issues
Chip type:         esp32s3 (revision v0.1)
Crystal frequency: 40MHz
Flash size:        8MB
Features:          WiFi, BLE
MAC address:       7c:df:a1:e2:1d:14
App/part. size:    493,376/8,323,072 bytes, 5.93%
[00:00:00] [========================================]      14/14      0x0
[00:00:00] [========================================]       1/1       0x8000
[00:00:07] [========================================]     304/304     0x10000
[2023-07-04T07:59:48Z INFO ] Flashing has completed!
Commands:
    CTRL+R    Reset chip
    CTRL+C    Exit

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fce3818,len:0x16f8
0x3fce3818 - _stack_end_cpu0
    at ??:??
load:0x403c9700,len:0x4
0x403c9700 - hal_pwr_interrupt_clr_event
    at ??:??
load:0x403c9704,len:0xc00
0x403c9704 - hal_pwr_interrupt_clr_event
    at ??:??
load:0x403cc700,len:0x2eb0
0x403cc700 - hal_pwr_interrupt_clr_event
    at ??:??
SHA-256 comparison failed:
Calculated: b8f485cf73c8ad59b009a332167b4a854ec774585c7fa428926acc30cc0c964b
Expected: 3499e4149a363c2b1ee4ee9709ca5031f50ee6b595a532f697c8659516763ae3
Attempting to boot anyway...
entry 0x403c9908
0x403c9908 - hal_pwr_interrupt_clr_event
    at ??:??
I (48) boot: ESP-IDF v5.1-beta1-378-gea5e0ff298-dirt 2nd stage bootloader
I (48) boot: compile time Jun  7 2023 08:07:32
I (49) boot: Multicore bootloader
I (54) boot: chip revision: v0.1
I (57) boot.esp32s3: Boot SPI Speed : 40MHz
I (62) boot.esp32s3: SPI Mode       : DIO
I (67) boot.esp32s3: SPI Flash Size : 8MB
I (72) boot: Enabling RNG early entropy source...
I (77) boot: Partition Table:
I (81) boot: ## Label            Usage          Type ST Offset   Length
I (88) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (95) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (103) boot:  2 factory          factory app      00 00 00010000 007f0000
I (110) boot: End of partition table
I (115) esp_image: segment 0: paddr=00010020 vaddr=3c060020 size=17604h ( 95748) map
I (147) esp_image: segment 1: paddr=0002762c vaddr=3fc8da40 size=01204h (  4612) load
I (149) esp_image: segment 2: paddr=00028838 vaddr=3fca9884 size=00168h (   360) load
I (153) esp_image: segment 3: paddr=000289a8 vaddr=40378000 size=05a40h ( 23104) load
I (168) esp_image: segment 4: paddr=0002e3f0 vaddr=00000000 size=01c28h (  7208)
I (171) esp_image: segment 5: paddr=00030020 vaddr=42000020 size=586f8h (362232) map
I (270) boot: Loaded app from partition at offset 0x10000
I (270) boot: Disabling RNG early entropy source...
wifi_set_configuration returned Ok(())
is wifi started: Ok(true)
Ok(EnumSet(Client | AccessPoint))
Start busy loop on main. Connect to the AP `esp-wifi`
Got Discover
Got Request
Client got it's IP hopefully! Open http://192.168.2.1/
Connected
GET /gen_204 HTTP/1.1
Connection: close
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36
Host: www.google.com
Accept-Encoding: gzip


Done


Connected
GET /gen_204 HTTP/1.1
Host: www.google.com
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Linux; Android 10; Nokia 7 plus Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/114.0.5735.131 Mobile Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
X-Requested-With: com.android.captiveportallogin
Accept-Encoding: gzip, deflate
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7


Done



esp32c3-dhcp-experiment/dhcp-experiment-esp32s3 on  esp32s3-experiment [!] is 📦 v0.1.0 via 🦀 v1.70.0-nightly
❯

Tested with an Android phone as the client

@AnthonyGrondin
Copy link
Author

I've done a bit more testing, and it seems to work well when compiling in release mode. The error seems to happen only when compiling in debug mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants