Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firmware builds for ESP32-C3 #98

Open
yanxke opened this issue May 25, 2024 · 7 comments
Open

Firmware builds for ESP32-C3 #98

yanxke opened this issue May 25, 2024 · 7 comments

Comments

@yanxke
Copy link

yanxke commented May 25, 2024

For some reason I can't get the build environment set up. Is it using PlatformIO or the native ESP IDF extension? Is it possible to provide the prebuilt firmware for the ESP32-C3?

@dchristl
Copy link
Owner

It is using PlatfomIO with ESP IDF. You only need to open the platfomio.ini-file with PaltformIO and you should be fine. The firmware is the same for all ESP32 flavors, so can download the binary in the releases of this project.

@yanxke
Copy link
Author

yanxke commented May 26, 2024

The C3s are on the RISC-V architecture, as opposed to Xtensa for the original ESP32s, and so the firmware needs to be recompiled in order to work.

@yanxke
Copy link
Author

yanxke commented May 26, 2024

Even running the build on the default configuration fails. I suspect it's a mismatch in the espressif32 platform version.


 *  Executing task: platformio run 

Processing esp32dev (platform: espressif32; board: esp32dev; framework: espidf)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.7.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-espidf @ 3.50201.240515 (5.2.1) 
 - tool-cmake @ 3.16.4 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - tool-ninja @ 1.7.1 
 - tool-riscv32-esp-elf-gdb @ 12.1.0+20221002 
 - tool-xtensa-esp-elf-gdb @ 12.1.0+20221002 
 - toolchain-esp32ulp @ 1.23500.220830 (2.35.0) 
 - toolchain-xtensa-esp-elf @ 13.2.0+20230928
Reading CMake configuration...
Warning! Flash memory size mismatch detected. Expected 4MB, found 2MB!
Please select a proper value in your `sdkconfig.defaults` or via the `menuconfig` target!
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/esp32dev/src/openhaystack_main.c.o
Compiling .pio/build/esp32dev/bootloader_support/src/bootloader_mem.c.o
Compiling .pio/build/esp32dev/bootloader_support/src/bootloader_random.c.o
Compiling .pio/build/esp32dev/bootloader_support/src/bootloader_efuse.c.o
src/openhaystack_main.c:148:1: error: unknown type name 'uint'; did you mean 'int'?
  148 | uint get_key_count()
      | ^~~~
      | int
src/openhaystack_main.c: In function 'app_main':
src/openhaystack_main.c:175:5: error: unknown type name 'uint'; did you mean 'int'?
  175 |     uint key_count = get_key_count();
      |     ^~~~
      |     int
src/openhaystack_main.c:176:5: error: unknown type name 'uint'; did you mean 'int'?
  176 |     uint key_index = (esp_random() % key_count);
      |     ^~~~
      |     int
Compiling .pio/build/esp32dev/bootloader_support/src/flash_encrypt.c.o
Compiling .pio/build/esp32dev/bootloader_support/src/secure_boot.c.o
Compiling .pio/build/esp32dev/bootloader_support/src/bootloader_random_esp32.c.o
*** [.pio/build/esp32dev/src/openhaystack_main.c.o] Error 1
=========================================================================== [FAILED] Took 1.95 seconds ===========================================================================

 *  The terminal process "platformio 'run'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

@yanxke
Copy link
Author

yanxke commented May 27, 2024

Eventually got it to compile and broadcast beacons. See #99

@thirstyone
Copy link

so, finally, it works with c3! nice!
have you assessed the real power consumption on those newish chips (compared to the classical nrf51822?)

@yanxke
Copy link
Author

yanxke commented Jun 12, 2024

The ESPs are orders of magnitude higher in power consumption than the NRFs. Wouldn't want to battery power these.

@solarkraft
Copy link

solarkraft commented Aug 28, 2024

Is this a natural law or maybe just due to a lack of optimization?
Anecdotally: I heard that the new ESPs are quite power efficient (compared to the older ones) and I may a while ago even have seen figures that put them in a similar ball park as the most power efficient SoCs (when fully optimized).

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

No branches or pull requests

4 participants