Skip to content

Provided example code "AnalogReadContinuous.ino" gives errors #11402

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

Open
1 task done
PaulChristopher opened this issue May 25, 2025 · 5 comments
Open
1 task done

Provided example code "AnalogReadContinuous.ino" gives errors #11402

PaulChristopher opened this issue May 25, 2025 · 5 comments
Assignees
Labels
Status: Test needed Issue needs testing

Comments

@PaulChristopher
Copy link

Board

ESP32 Dev Module

Device Description

ESP32 Development board (ESP WROOM 32)
Installed board support Arduino IDE: esp32 by Espressif Systems version 3.3.0-alpha1

Hardware Configuration

Yes, a variable resistor to pin 34

Version

latest stable Release (if not listed below)

IDE Name

Arduino IDE

Operating System

Win10

Flash frequency

80

PSRAM enabled

no

Upload speed

921600

Description

Running the example https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/AnalogReadContinuous/AnalogReadContinuous.ino works, but gives the following errors:

E (12579) adc_cali: adc_cali_raw_to_voltage(41): invalid argument: null pointer
E (12579) adc_cali: adc_cali_raw_to_voltage(41): invalid argument: null pointer
E (12582) adc_cali: adc_cali_raw_to_voltage(41): invalid argument: null pointer
E (12589) adc_cali: adc_cali_raw_to_voltage(41): invalid argument: null pointer

The errors are a pain, since they mess up the serial monitor with tons of error messages when reading results in continous mode using analogContinuousRead. This basically renders the serial monitor useless for other debugging purposes.

Since the errors cannot be supressed by the chosen debug level in the IDE, it is a blocker for me.

Sketch

See your own code: https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/AnalogReadContinuous/AnalogReadContinuous.ino

Debug Message

E (12579) adc_cali: adc_cali_raw_to_voltage(41): invalid argument: null pointer
E (12579) adc_cali: adc_cali_raw_to_voltage(41): invalid argument: null pointer
E (12582) adc_cali: adc_cali_raw_to_voltage(41): invalid argument: null pointer
E (12589) adc_cali: adc_cali_raw_to_voltage(41): invalid argument: null pointer

Other Steps to Reproduce

Even commenting out "analogContinuousStop(); ... Serial.println ... analogContinousStart()" in loop() does not make a difference: The error seems to be caused by analogContinuousRead solely..

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

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@PaulChristopher PaulChristopher added the Status: Awaiting triage Issue is waiting for triage label May 25, 2025
@PaulChristopher
Copy link
Author

Workaround: In C:\Users\XXX\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0-alpha1\cores\esp32\esp32-hal-adc.c, function AnalogContinousRead comment out the call of adc_cali_raw_to_voltage (line 629) and work with raw values only.

@lbernstone
Copy link
Contributor

I'm not using the packaged 3.3.0, but current master is not giving me this error. Did you try changing the adc_pins[] line to just have pin 34 in the list?

@PaulChristopher
Copy link
Author

I'm not using the packaged 3.3.0, but current master is not giving me this error. Did you try changing the adc_pins[] line to just have pin 34 in the list?

Yes, I tried to use pin 34 only. It gives me the same error. The error occurs for each pin - it does not matter, whether something is connected to the pin or not. It is a software issue, since something in adc_cali_raw_to_voltage is considered as a null pointer...

@PaulChristopher
Copy link
Author

Steps to reproduce the issue:

  • Take a computer without Arduino IDE installed. If previously installed: Make sure, to remove all leftovers from previous installation in C:\Users\XXX\AppData and C:\User\XXX\Roaming and C:\Program Files (x86). The system should be clean.
    -Dowload Arduino legacy IDE https://downloads.arduino.cc/arduino-1.8.19-windows.exe and install it.
    -Run the IDE, choose "Tools > Board > Boards Manager…". Search for esp32 by Espressif Systems, choose 3.2.0, and install it.
    -Close and restart IDE
    -Choose "Tools > Board > ESP32 Arduino > ESP32 Dev Module. Connect the devboard and make sure the correct port is selected using "Tools > Port > COM??"
  • Choose "File > Examples > ESP32 > Analog Read Continuous"
  • Compile and upload the example
  • Open serial monitor and choose the correct baud rate of 115200.

In the output, you see the above mentioned errors:

...
adc_cali: adc_cali_raw_to_voltage(41): invalid argument: null pointer
...

@P-R-O-C-H-Y
Copy link
Member

@PaulChristopher Will test and reach back.

@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this May 27, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y added Status: Test needed Issue needs testing and removed Status: Awaiting triage Issue is waiting for triage labels May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Test needed Issue needs testing
Projects
None yet
Development

No branches or pull requests

3 participants