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

esp32c6 temperature_sensor: Exceeding temperature measure range after adc_oneshot_del_unit (IDFGH-11828) #12921

Closed
3 tasks done
AxelLin opened this issue Jan 3, 2024 · 2 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@AxelLin
Copy link
Contributor

AxelLin commented Jan 3, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.1.2-534-gbbd8d13f93

Espressif SoC revision.

ESP32C6

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

Custom Board

Power Supply used.

USB

What is the expected behavior?

temperature_sensor should still work after adc_oneshot_del_unit.

What is the actual behavior?

Always got "temperature_sensor: Exceeding temperature measure range" after adc_oneshot_del_unit

Steps to reproduce.

Test using ADC1 ADC_CHANNEL_4.
(Note: it works if using ADC_CHANNEL_2 or ADC_CHANNEL_3, only ADC_CHANNEL_4 has this issue)

Attached the modified code to reproduce the issue , copy it to replace examples/peripherals/adc/oneshot_read/main/oneshot_read_main.c
oneshot_read_main.c.txt

Debug Logs.

I (248) cpu_start: Min chip rev:     v0.0
I (253) cpu_start: Max chip rev:     v0.99
I (257) cpu_start: Chip rev:         v0.0
I (262) heap_init: Initializing. RAM available for dynamic allocation:
I (269) heap_init: At 4080AF90 len 00071680 (453 KiB): D/IRAM
I (276) heap_init: At 4087C610 len 00002F54 (11 KiB): STACK/DIRAM
I (282) heap_init: At 50000004 len 00003FE4 (15 KiB): RTCRAM
I (290) spi_flash: detected chip: generic
I (293) spi_flash: flash io: dio
I (298) sleep: Configure to isolate all GPIO pins in sleep state
I (304) sleep: Enable automatic switching of GPIO sleep configuration
I (311) coexist: coex firmware version: c02915e
I (317) coexist: coexist rom version 5b8dcfa
I (322) app_start: Starting scheduler on CPU0
I (326) main_task: Started on CPU0
I (326) main_task: Calling app_main()
I (326) EXAMPLE: Install temperature sensor, expected temp ranger range: 10~50 ℃
I (336) temperature_sensor: Range [-10°C ~ 80°C], error < 1°C
I (346) EXAMPLE: Enable temperature sensor
I (346) EXAMPLE: Read temperature
I (356) EXAMPLE: Temperature value 7.00 ℃
I (1356) EXAMPLE: Temperature value 7.00 ℃
I (2356) EXAMPLE: Temperature value 8.00 ℃
I (3356) EXAMPLE: Temperature value 8.00 ℃
I (4356) EXAMPLE: Temperature value 8.00 ℃
I (5356) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (5356) gpio: GPIO[4]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (5356) EXAMPLE: calibration scheme version is Curve Fitting
I (5366) EXAMPLE: Calibration Success
I (5366) EXAMPLE: calibration scheme version is Curve Fitting
I (5376) EXAMPLE: Calibration Success
I (5376) EXAMPLE: Temperature value 8.00 ℃
I (6386) EXAMPLE: Temperature value 8.00 ℃
I (7386) EXAMPLE: Temperature value 8.00 ℃
I (8386) EXAMPLE: Temperature value 8.00 ℃
I (9386) EXAMPLE: Temperature value 8.00 ℃
I (10386) EXAMPLE: ADC1 Channel[2] Raw Data: 1089
I (10386) EXAMPLE: ADC1 Channel[2] Cali Voltage: 1095 mV
I (11386) EXAMPLE: ADC1 Channel[4] Raw Data: 1
I (11386) EXAMPLE: ADC1 Channel[4] Cali Voltage: 1 mV
I (12386) EXAMPLE: ADC1 Channel[2] Raw Data: 1073
I (12386) EXAMPLE: ADC1 Channel[2] Cali Voltage: 1079 mV
I (13386) EXAMPLE: ADC1 Channel[4] Raw Data: 1
I (13386) EXAMPLE: ADC1 Channel[4] Cali Voltage: 1 mV
I (14386) EXAMPLE: ADC1 Channel[2] Raw Data: 1105
I (14386) EXAMPLE: ADC1 Channel[2] Cali Voltage: 1111 mV
I (15386) EXAMPLE: ADC1 Channel[4] Raw Data: 0
I (15386) EXAMPLE: ADC1 Channel[4] Cali Voltage: 0 mV
I (16386) EXAMPLE: ADC1 Channel[2] Raw Data: 1104
I (16386) EXAMPLE: ADC1 Channel[2] Cali Voltage: 1110 mV
I (17386) EXAMPLE: ADC1 Channel[4] Raw Data: 0
I (17386) EXAMPLE: ADC1 Channel[4] Cali Voltage: 0 mV
I (18386) EXAMPLE: ADC1 Channel[2] Raw Data: 1088
I (18386) EXAMPLE: ADC1 Channel[2] Cali Voltage: 1094 mV
I (19386) EXAMPLE: ADC1 Channel[4] Raw Data: 1
I (19386) EXAMPLE: ADC1 Channel[4] Cali Voltage: 1 mV
I (20386) EXAMPLE: deregister Curve Fitting calibration scheme
I (20386) EXAMPLE: deregister Curve Fitting calibration scheme
E (20386) temperature_sensor: Exceeding temperature measure range.
ESP_ERROR_CHECK failed: esp_err_t 0x103 (ESP_ERR_INVALID_STATE) at 0x42005926
0x42005926: app_main at /home/axel/esp/esp-idf/examples/peripherals/adc/oneshot_read/main/oneshot_read_main.c:72 (discriminator 1)

file: "/IDF/examples/peripherals/adc/oneshot_read/main/oneshot_read_main.c" line 176
func: app_main
expression: temperature_sensor_get_celsius(temp_sensor, &tsens_value)

abort() was called at PC 0x40804011 on core 0
0x40804011: _esp_error_check_failed at /home/axel/esp/esp-idf/components/esp_system/esp_err.c:50

Stack dump detected
Core  0 register dump:
MEPC    : 0x408004de  RA      : 0x4080401c  SP      : 0x4080de80  GP      : 0x408096b0
0x408004de: panic_abort at /home/axel/esp/esp-idf/components/esp_system/panic.c:472

0x4080401c: __ubsan_include at /home/axel/esp/esp-idf/components/esp_system/ubsan.c:313

TP      : 0x40804bac  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130
0x40804bac: prvInitialiseTaskLists at /home/axel/esp/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4661
 (inlined by) prvAddNewTaskToReadyList at /home/axel/esp/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:1280

S0/FP   : 0x4080debc  S1      : 0x4080dea0  A0      : 0x4080debc  A1      : 0x4080de9e
A2      : 0x00000000  A3      : 0x4080dee9  A4      : 0x00000001  A5      : 0x4080b000
A6      : 0x00000000  A7      : 0x76757473  S2      : 0x00000001  S3      : 0x42013000
S4      : 0x00000000  S5      : 0x4080b000  S6      : 0x4080b000  S7      : 0x42013000
S8      : 0x42013000  S9      : 0x4080ab40  S10     : 0x4080b000  S11     : 0x4080b000
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000
0x40800001: _vector_table at ??:?

MHARTID : 0x00000000


Backtrace:


panic_abort (details=details@entry=0x4080debc "abort() was called at PC 0x40804011 on core 0") at /home/axel/esp/esp-idf/components/esp_system/panic.c:472

More Information.

Note, I already manually applied the fix from #12864

@AxelLin AxelLin added the Type: Bug bugs in IDF label Jan 3, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 3, 2024
@github-actions github-actions bot changed the title esp32c6 temperature_sensor: Exceeding temperature measure range after adc_oneshot_del_unit esp32c6 temperature_sensor: Exceeding temperature measure range after adc_oneshot_del_unit (IDFGH-11828) Jan 3, 2024
@espressif-bot espressif-bot assigned igrr and mythbuster5 and unassigned igrr Jan 3, 2024
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels Jan 8, 2024
@AxelLin
Copy link
Contributor Author

AxelLin commented Jan 27, 2024

Just remind v5.1 and v5.2 need this fix.

@AxelLin
Copy link
Contributor Author

AxelLin commented Feb 27, 2024

@mythbuster5 v5.1.3 does not include this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants