apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.91k stars 1.18k forks source link

[BUG] Capture driver started to show wrong values on Xtensa chips #14987

Open eren-terzioglu opened 12 hours ago

eren-terzioglu commented 12 hours ago

Description / Steps to reproduce the issue

After this PR capture driver started to get some wrong values.

Steps to build:

esp32s3-devkit:capture configuration used to build with these options enabled:

CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_ASSERTIONS=y
CONFIG_DEBUG_CAPTURE=y
CONFIG_DEBUG_CAPTURE_ERROR=y
CONFIG_DEBUG_CAPTURE_WARN=y
CONFIG_DEBUG_CAPTURE_INFO=y
CONFIG_ESP32S3_LEDC=y
CONFIG_ESP32S3_LEDC_TIM0=y
CONFIG_ESP32S3_LEDC_CHANNEL0_PIN=11
CONFIG_DEV_GPIO=y
CONFIG_ESP32S3_GPIO_IRQ=y
CONFIG_ESP_MCPWM_CAPTURE_CH1=y
CONFIG_ESP_MCPWM_CAPTURE_CH1_GPIO=13
CONFIG_ESP_MCPWM_CAPTURE_CH2=y
CONFIG_ESP_MCPWM_CAPTURE_CH2_GPIO=14

Sample application used to test it(I can share the code, if needed). Working code before than that PR started to show some unrelated values.

Here is some capture outputs, driver seems fine:

capture capture2

Note: If we close CONFIG_DEBUG_CAPTURE_INFO=y option, code seems working fine which closes to print information here and here

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Ubuntu 20.04

NuttX Version

master

Issue Architecture

[Arch: xtensa]

Issue Area

[Area: Drivers]

Verification

eren-terzioglu commented 12 hours ago

@yamt Please have a look