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

tests/drivers/dac loopback failed due to un-initialised dac_channel_cfg structure #58931

Closed
FRASTM opened this issue Jun 7, 2023 · 3 comments · Fixed by #58932
Closed

tests/drivers/dac loopback failed due to un-initialised dac_channel_cfg structure #58931

FRASTM opened this issue Jun 7, 2023 · 3 comments · Fixed by #58932
Assignees
Labels
area: DAC Digital-to-Analog Converter bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@FRASTM
Copy link
Collaborator

FRASTM commented Jun 7, 2023

Describe the bug
Testing the tests/drivers/dac/dac_loopback/ fails on several stm32 boards

START - test_dac_loopback                                                       
                                                                                
    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/dac/dac_loopback/src/t)
Value 2091 read from ADC does not match expected range.                         
 FAIL - test_dac_loopback in 0.031 seconds       

Please also mention any information which could help others to understand
the problem you're facing:
The PR #57730 is checking the channel_cfg->buffered
This value must be initialised.

To Reproduce
Steps to reproduce the behavior:
1.west build -p auto -b nucleo_wl55jc tests/drivers/dac/dac_loopback/
2. west flash
3. See error

Expected behavior

TESTSUITE dac succeeded
------ TESTSUITE SUMMARY START ------
SUITE PASS - 100.00% [dac]: pass = 1, fail = 0, skip = 0, total = 1 duration = s
 - PASS - [dac.test_task_write_value] duration = 0.001 seconds

------ TESTSUITE SUMMARY END ------

Impact
test and CI failure

Environment (please complete the following information):

  • OS: ubuntu
  • Toolchain Zephyr SDK 0.16.1
  • Commit SHA 7b2034a
@FRASTM FRASTM added the bug The issue is a bug, or the PR is fixing a bug label Jun 7, 2023
@FRASTM FRASTM added the area: DAC Digital-to-Analog Converter label Jun 7, 2023
@FRASTM FRASTM self-assigned this Jun 7, 2023
@martinjaeger
Copy link
Member

@FRASTM Thanks for finding and fixing this issue.

Do you have an explanation why buffering is required? I would have guessed that the ADC input impedance is high enough such that buffering the DAC output is not necessary.

@FRASTM
Copy link
Collaborator Author

FRASTM commented Jun 7, 2023

@FRASTM Thanks for finding and fixing this issue.

Do you have an explanation why buffering is required? I would have guessed that the ADC input impedance is high enough such that buffering the DAC output is not necessary.

I just see considered the outpin "Connected to external pin and to on chip-peripherals (such as comparators)"
Capture buffered

@martinjaeger
Copy link
Member

Ok, so it looks like we should instead use LL_DAC_SetOutputConnection to make sure the DAC is connected to an external pin. Also with buffer disabled we should be able to get an output on the external pin.

The root cause of the failing test is not the buffer, but the output connection. We just didn't realize before when the output buffer was always enabled.

@jgl-meta jgl-meta added the priority: low Low impact/importance bug label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DAC Digital-to-Analog Converter bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants