Skip to content

Instantly share code, notes, and snippets.

@jessebraham
Last active November 22, 2022 15:48
Show Gist options
  • Save jessebraham/d6ddcc462c546981ea4f25694cea11cc to your computer and use it in GitHub Desktop.
Save jessebraham/d6ddcc462c546981ea4f25694cea11cc to your computer and use it in GitHub Desktop.
jesse@mbp ~/W/esp-wifi git:main [ ✚ ✎ ⚑ ] +
🦀 nightly@1.67.0 λ SSID="******" PASSWORD="******" cargo "+nightly" build --example dhcp --release --target riscv32imc-unknown-none-elf --features "esp32c3,embedded-svc,wifi"
Updating git repository `https://github.com/esp-rs/esp-hal/`
Updating crates.io index
Compiling proc-macro2 v1.0.43
Compiling memchr v2.5.0
Compiling unicode-ident v1.0.3
Compiling quote v1.0.21
Compiling syn v1.0.99
Compiling regex-syntax v0.6.27
Compiling fnv v1.0.7
Compiling alloc v0.0.0 (/Users/jesse/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc)
Compiling ident_case v1.0.1
Compiling version_check v0.9.4
Compiling semver v1.0.13
Compiling strsim v0.10.0
Compiling proc-macro-error-attr v1.0.4
Compiling proc-macro-error v1.0.4
Compiling log v0.4.17
Compiling paste v1.0.8
Compiling serde_derive v1.0.144
Compiling esp-hal-common v0.2.0 (https://github.com/esp-rs/esp-hal/?rev=9b3e644e309e0ab3332fd007f4ac2fb4881abc4c#9b3e644e)
Compiling rustc_version v0.4.0
Compiling serde v1.0.144
Compiling esp-println v0.2.2
Compiling aho-corasick v0.7.18
Compiling heapless v0.7.16
Compiling atomic-polyfill v1.0.1
Compiling esp32c3-hal v0.2.0 (https://github.com/esp-rs/esp-hal/?rev=9b3e644e309e0ab3332fd007f4ac2fb4881abc4c#9b3e644e)
Compiling esp-backtrace v0.2.0
Compiling litrs v0.2.3
Compiling uuid v1.1.2
Compiling regex v1.6.0
Compiling bit_field v0.10.1
Compiling bare-metal v1.0.0
Compiling nb v1.0.0
Compiling void v1.0.2
Compiling cfg-if v1.0.0
Compiling r0 v1.0.0
Compiling stable_deref_trait v1.2.0
Compiling nb v0.1.3
Compiling critical-section v1.1.1
Compiling embedded-hal v0.2.7
Compiling byteorder v1.4.3
Compiling gcd v2.1.0
Compiling vcell v0.1.3
Compiling fugit v0.3.6
Compiling riscv v0.8.0
Compiling riscv v0.9.0
Compiling riscv v0.10.0
Compiling hash32 v0.2.1
Compiling embedded-dma v0.2.0
Compiling embedded-io v0.3.0
Compiling bitflags v1.3.2
Compiling managed v0.8.0
Compiling no-std-net v0.5.0
Compiling smoltcp v0.8.1
Compiling linked_list_allocator v0.10.4
Compiling bleps v0.1.0 (https://github.com/bjoernQ/bleps#06e1f7b3)
Compiling esp-println v0.3.1
Compiling riscv-target v0.1.2
Compiling riscv v0.7.0
Compiling riscv-rt v0.10.0
Compiling riscv-rt v0.9.0
Compiling riscv-atomic-emulation-trap v0.2.0
Compiling esp-wifi v0.1.0 (/Users/jesse/Work/esp-wifi)
Compiling critical-section v0.2.7
Compiling atomic-polyfill v0.1.10
Compiling darling_core v0.14.1
Compiling darling_core v0.13.4
Compiling riscv-rt-macros v0.2.0
Compiling bleps-macros v0.1.0 (https://github.com/bjoernQ/bleps#06e1f7b3)
Compiling esp32c3 v0.8.1
Compiling darling_macro v0.13.4
Compiling darling_macro v0.14.1
Compiling darling v0.13.4
Compiling darling v0.14.1
Compiling enumset_derive v0.6.0
Compiling esp-hal-procmacros v0.1.0 (https://github.com/esp-rs/esp-hal/?rev=9b3e644e309e0ab3332fd007f4ac2fb4881abc4c#9b3e644e)
Compiling enumset v1.0.11
Compiling embedded-svc v0.22.1
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:885:22
|
885 | event_data_size: size_t,
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1371:14
|
1371 | _length: size_t,
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1396:19
|
1396 | _length: *mut size_t,
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1436:58
|
1436 | pub unsafe extern "C" fn get_random(_buf: *mut u8, _len: size_t) -> crate::binary::c_types::c_int {
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1558:48
|
1558 | pub unsafe extern "C" fn malloc_internal(size: size_t) -> *mut crate::binary::c_types::c_void {
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1578:12
|
1578 | _size: size_t,
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1598:8
|
1598 | n: size_t,
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1599:11
|
1599 | size: size_t,
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1617:48
|
1617 | pub unsafe extern "C" fn zalloc_internal(size: size_t) -> *mut crate::binary::c_types::c_void {
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1634:44
|
1634 | pub unsafe extern "C" fn wifi_malloc(size: size_t) -> *mut crate::binary::c_types::c_void {
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1654:12
|
1654 | _size: size_t,
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1674:8
|
1674 | n: size_t,
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1675:11
|
1675 | size: size_t,
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0412]: cannot find type `size_t` in this scope
--> src/wifi/os_adapter.rs:1694:44
|
1694 | pub unsafe extern "C" fn wifi_zalloc(size: size_t) -> *mut crate::binary::c_types::c_void {
| ^^^^^^ help: a type alias with a similar name exists: `sig_t`
|
::: src/binary/include_esp32c3.rs:3549:1
|
3549 | pub type sig_t = ::core::option::Option<unsafe extern "C" fn(arg1: crate::binary::c_types::c_int)>;
| --------------------------------------------------------------------------------------------------- similarly named type alias `sig_t` defined here
error[E0308]: mismatched types
--> src/wifi/mod.rs:233:19
|
233 | _malloc: Some(malloc),
| ---- ^^^^^^ expected `usize`, found `u32`
| |
| arguments to this enum variant are incorrect
|
= note: expected fn pointer `unsafe extern "C" fn(usize) -> _`
found fn item `unsafe extern "C" fn(u32) -> _ {os_adapter::malloc}`
note: tuple variant defined here
--> /Users/jesse/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:526:5
|
526 | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
| ^^^^
error[E0308]: mismatched types
--> src/wifi/mod.rs:273:23
|
273 | _log_writev: Some(log_writev),
| ---- ^^^^^^^^^^ expected `*mut __va_list_tag`, found array of 1 element
| |
| arguments to this enum variant are incorrect
|
= note: expected fn pointer `unsafe extern "C" fn(_, _, _, *mut __va_list_tag)`
found fn item `unsafe extern "C" fn(_, _, _, [__va_list_tag; 1]) {os_adapter::log_writev}`
note: tuple variant defined here
--> /Users/jesse/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:526:5
|
526 | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
| ^^^^
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> src/wifi/os_adapter.rs:1523:21
|
1523 | let _args = core::mem::transmute(_args);
| ^^^^^^^^^^^^^^^^^^^^
|
= note: source type: `[__va_list_tag; 1]` (128 bits)
= note: target type: `VaListImpl<'_>` (32 bits)
Some errors have detailed explanations: E0308, E0412, E0512.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `esp-wifi` due to 17 previous errors
#!/usr/bin/env bash
INCL="$HOME/.espressif/tools/riscv32-esp-elf/esp-2021r2-8.4.0/riscv32-esp-elf/riscv32-esp-elf/include/"
OPTS=(--no-derive-debug --raw-line "#![allow(non_camel_case_types,non_snake_case,non_upper_case_globals,dead_code)]" --use-core --ctypes-prefix "crate::binary::c_types" --no-layout-tests)
bindgen "${OPTS[@]}" include/include.h > src/binary/include_esp32c3.rs -- -I./headers/ -I$INCL -I./include/ -DCONFIG_IDF_TARGET_ESP32C3 -I./headers/esp32c3/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment