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

esp32-hal-misc.c infinite loop. #6632

Open
1 task done
dynamic21xx opened this issue Apr 26, 2022 · 7 comments
Open
1 task done

esp32-hal-misc.c infinite loop. #6632

dynamic21xx opened this issue Apr 26, 2022 · 7 comments
Labels
Area: Libraries Issue is related to Library support. Status: Needs investigation We need to do some research before taking next steps on this issue

Comments

@dynamic21xx
Copy link

Board

nodemcu-32s

Device Description

nodemcu-32s plain.

Hardware Configuration

No.

Version

latest master (checkout manually)

IDE Name

PlatformIO

Operating System

UbuntuLinux 20

Flash frequency

40Mhz

PSRAM enabled

no

Upload speed

115200,9600

Description

In my program used DallasTemperature, and onewire. espressif32 3.5 working fine.
When I update espressif32 4.1, my program cannot run, and the program always reset.
In first run 0 sensor attached, but espressif32 3.5 working fine.
I found in esp32-hal-misc.c infinite loop.
If I commented out these lines , espressif32 4.1 working.
https://community.platformio.org/t/update-espressif32-4-1-dallastemperature-senzor-begin-freeze/27399
problem

Sketch

DallasTemperature
senzor.begin()

Debug Message

always reset

Other Steps to Reproduce

espressif32 3.5 working fine.

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@dynamic21xx dynamic21xx added the Status: Awaiting triage Issue is waiting for triage label Apr 26, 2022
@lbernstone
Copy link
Contributor

That's a finite loop. esp_timer_get_time() is a volatile function that (surprise) gives you the current number of microseconds since boot. You don't say what you are using for DallasTemperature, but wherever it is using delayMicroseconds seems more likely the source of your problem.

@dynamic21xx
Copy link
Author

dynamic21xx commented Apr 27, 2022

Thanks, but the dallastemperature call this timer in begin() method. I just call _senzor.begin().
In my debugger 'e' value is 2, and never going out that while-do cycle. This error only came, when I update espressif32 4.1. If I use espressif32 3.5 , no error.
SilentTemperatureSensor::SilentTemperatureSensor(uint8_t pin): _oneWire( pin ), _sensors( &_oneWire ) {
_pin = pin;
_sensors.begin(); //freeze if I not commented in esp32-hal-misc.c that lines.

@VojtechBartoska VojtechBartoska added Type: Question Only question Area: Libraries Issue is related to Library support. and removed Status: Awaiting triage Issue is waiting for triage labels Apr 27, 2022
@mrengineer7777
Copy link
Collaborator

Looks like you are using PIO. PIO targets arduino-esp32 version 1.0.4, based on espressif32 3.3.x. Most of us are manually targeting a newer version of Arduino core. I'm using 2.0.2.3, custom TASMOTA build:

framework = arduino
platform = https:/tasmota/platform-espressif32/releases/download/v2.0.2.3/platform-espressif32-2.0.2.3.zip

Your Dallas library may not be compatible with the newer Arduino framework.

We'll need more info about your platform targets, or even better a sample program that duplicates the issue if you want help. I recommend creating a Github repository with the sample to make it easy for others to download the project and test.

@mrengineer7777
Copy link
Collaborator

Here's how delayMicroseconds has changed between Oct 2019 and now:
image
Note the datatype change from uint32_t to uint64_t to prevent an overflow.

@dynamic21xx
Copy link
Author

dynamic21xx commented Apr 27, 2022

I'm so sorry for the "infinite loop" opinion, it's too early, in my debugging. I will try your suggestion.
Thank you!

@VojtechBartoska
Copy link
Collaborator

any updates on this @dynamic21xx? Thanks!

@VojtechBartoska
Copy link
Collaborator

@dynamic21xx Any news?

@VojtechBartoska VojtechBartoska added Status: Needs investigation We need to do some research before taking next steps on this issue and removed Type: Question Only question labels Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Libraries Issue is related to Library support. Status: Needs investigation We need to do some research before taking next steps on this issue
Projects
Development

No branches or pull requests

4 participants