seemoo-lab / openhaystack

Build your own 'AirTags' 🏷 today! Framework for tracking personal Bluetooth devices via Apple's massive Find My network.
https://owlink.org
GNU Affero General Public License v3.0
8.36k stars 450 forks source link

ESP32 C3 Not booting #138

Closed bruvv closed 2 years ago

bruvv commented 2 years ago

Describe the bug When I succesfully flash an ESP32 -c3-mini-1 or the ESP32-C3-DevKitC-02 both fail to boot:

rst:0x10 (RTCWDT_RTC_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x17a8
load:0x73252029,len:0x2323203a
Invalid image block, can't boot.
ets_main.c 333
SP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021

To Reproduce Steps to reproduce the behavior:

  1. Install IDF using ./install.sh esp32c3
  2. Build the bootloader with idf.py build
  3. Flash the ESP32: ./flash_esp32.sh -p /dev/tty.usbserial-14120 "KEY"
  4. Successful flash
  5. Use screen to monitor the device: screen /dev/tty.usbserial-14120 115200
  6. See the error

Expected behavior Not bootloop

Screenshots see error log

OpenHaystack version: 0.5.2

macOS version: 12.4

olivluca commented 2 years ago

Same problem here but using the precompiled image

barrenechea commented 2 years ago

I've ported OpenHaystack as an ESPHome component and got it to work on both ESP32 & ESP32-C3. If you're into ESPHome, you can check it here! 😄 Hope it helps!

olivluca commented 2 years ago

Well, it'd help if I wanted to install ESPHome :wink: (maybe one day but not right now). However I'm interested in how you're powering the esp32 in your scooter.

bruvv commented 2 years ago

@SebastianBar you are a hero! Thanks I got it working on a ESP32-C3.

olivluca commented 2 years ago

I finally flashed my esp32-c3 with esphome, easier than I thought. Thank you @SebastianBar

olivluca commented 2 years ago

BTW @SebastianBar the question about how you power the esp32 was a serious one: from the scooter battery with a 5V converter, with a power bank, or...?

barrenechea commented 2 years ago

BTW @SebastianBar the question about how you power the esp32 was a serious one: from the scooter battery with a 5V converter, with a power bank, or...?

Sorry @olivluca, I didn't answer as the question was a little bit out of topic to this post and Alexander & Milan's work over this repo.

Electrical stuff details

My scooter is 60v for dual motors, but they have a 12v line that turns on and off according to the scooter's status. Originally that line powers the screen and other scooters' accessories, and I've hooked up a step-down to it into 5v. On the ESP side, I'm using a Huzzah32 as you can quickly hook up a li-ion battery and keep it alive for "a little bit longer after the scooter is powered down". My pending work with it is to get used to ESP's deep sleep modes, so I could make the Huzzah's battery last a little bit longer, but as it is, it works great (for me). Note that on any electrical modification, you need to ensure you're not pushing your voltage lines too far. Make sure the supply line CAN provide the amperage your project requires (you may require to explore how the power supply works beforehand). ESP's are pretty low power by themselves tho. As I'm charging a small battery AND powering the ESP, it starts to add up. Also: I'm not an electrical engineer. Take this with a grain of salt.

smierd commented 8 months ago

@barrenechea I'm getting this error using ESPHome, any ideas? I am not super familiar with platformio and cmake and some of these other tools.

cc1.exe: error: -march=rv32imc_zicsr_zifencei: unsupported ISA substring '_zicsr_zifencei'

sdrev commented 6 months ago

@barrenechea I'm getting this error using ESPHome, any ideas? I am not super familiar with platformio and cmake and some of these other tools.

cc1.exe: error: -march=rv32imc_zicsr_zifencei: unsupported ISA substring '_zicsr_zifencei'

HI, Did you find any solution? I am having the same error on my ESPHome installed in HA O.S.