Skip to content

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

@PaulChristopher

Description

@PaulChristopher

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.

Activity

PaulChristopher

PaulChristopher commented on May 25, 2025

@PaulChristopher
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

lbernstone commented on May 25, 2025

@lbernstone
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

PaulChristopher commented on May 26, 2025

@PaulChristopher
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

PaulChristopher commented on May 26, 2025

@PaulChristopher
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

P-R-O-C-H-Y commented on May 27, 2025

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

@PaulChristopher Will test and reach back.

self-assigned this
on May 27, 2025
P-R-O-C-H-Y

P-R-O-C-H-Y commented on Jun 10, 2025

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

Hi @PaulChristopher I did test on 3.2.0 and also 3.3.0-alpha1 and both versions works for me. tested on ESP32-WROOM

PaulChristopher

PaulChristopher commented on Jun 10, 2025

@PaulChristopher
Author

Thanks your testing and having a look at it! If you cannot reproduce the issue, let's close it!? I does not work for me, but I have found a workaround as described above. It is now documented in the bug tracker and other people might reopen this issue in future.

Thanks and all the best!
Paul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @PaulChristopher@lbernstone@P-R-O-C-H-Y

      Issue actions

        Provided example code "AnalogReadContinuous.ino" gives errors · Issue #11402 · espressif/arduino-esp32