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

Panic when trying to read temperature #213

Closed
GamerBene19 opened this issue Nov 8, 2023 · 5 comments
Closed

Panic when trying to read temperature #213

GamerBene19 opened this issue Nov 8, 2023 · 5 comments

Comments

@GamerBene19
Copy link

Environment:

  • ESP32-C3-DevKitM-1
  • connected via USB cable to an USB3 port on my computer

Every time I try to read a value from the internal temperature sensor (e.g. with the http-server example) the ESP panics with

Guru Meditation Error: Core  0 panic'ed (Illegal instruction). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x4200083c  RA      : 0x420006f0  SP      : 0x3fc9ab80  GP      : 0x3fc90c00  
0x4200083c - http_server::main
    at ??:??
0x420006f0 - http_server::main
    at /path/to/std-training/intro/http-server/examples/http_server.rs:55
0x3fc9ab80 - _heap_start
    at ??:??
...

From my debugging it seems to occur when start_measurement is executed.

I tried googling for the issue and found this issue which suggests it might be power related. I have plugged in the ESP into ports that are able to supply higher current (powerbank and phone charger), but it seems to experience the same error.
Note: Since I don't have a serial interface on those ports I used the LED to indicate statuses and the color I programmed after the measurement never showed.

I've also tried the code from here to read the temperature in the Arduino IDE, which works.

Any advice would be greatly appreciated, thanks in advance!

@SergioGasquez
Copy link
Member

The training is intended for ESP32-C3-DevKit-RUST-1 which has an SHTC3 sensor, the ESP32-C3-DevKitM-1 does not contain such sensor, hence the error.

@SergioGasquez
Copy link
Member

I am working on adding support for Wokwi simulation to the exercises (#168 #154) so soon, you should be able to follow most of the training even without the hardware

@GamerBene19
Copy link
Author

The training is intended for ESP32-C3-DevKit-RUST-1 which has an SHTC3 sensor, the ESP32-C3-DevKitM-1 does not contain such sensor, hence the error.

That explains a lot. Thanks for pointing out - somehow I seem to have overlooked that. I just assumed this training would use the ESP32C3's internal temperature sensor which it seems it does not.

You might be the wrong person, but do you know if there is a way to access the internal sensor (linked above) via Rust? It seems to be possible in C as linked in the example above.
I've looked in https://github.com/esp-rs/esp-idf-hal and it does not seem like it contains a driver for the temperature sensor. But I'm not sure if it would be in that repository or if I would have to look somewhere else.

Perhaps you (or someone else) can answer some of my questions.

@SergioGasquez
Copy link
Member

Just saw that you opened esp-rs/esp-idf-hal#333, I will be closing this issue in favor of that one.

@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Nov 9, 2023
@GamerBene19
Copy link
Author

Just saw that you opened esp-rs/esp-idf-hal#333, I will be closing this issue in favor of that one.

Thanks, I forgot to close it yesterday evening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants