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/adc/adc_api failed on mec15xxevb_assy6853 board. #21755

Closed
chen-png opened this issue Jan 8, 2020 · 10 comments
Closed

tests/drivers/adc/adc_api failed on mec15xxevb_assy6853 board. #21755

chen-png opened this issue Jan 8, 2020 · 10 comments
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@chen-png
Copy link
Collaborator

chen-png commented Jan 8, 2020

To Reproduce
Steps to reproduce the behavior:

  1. programming the tests/drivers/adc/adc_api to mec15xxevb_assy6853 board, according to
    https://docs.zephyrproject.org/latest/boards/arm/mec1501modular_assy6885/doc/index.html to set up.
  2. See error

Screenshots or console output

*** Booting Zephyr OS build zephyr-v2.1.0-744-g7ee5cf6a0bd1 ***

Running test suite adc_basic_test
starting test - test_adc_sample_one_channel
Samples read: 0x0000
**Assertion failed at ZEPHYR_BASE/tests/drivers/adc/adc_api/src/test_adc.c:243: check_samples: (0 equal to sample_value)
[0] should be non-zero**

FAIL - test_adc_sample_one_channel
starting test - test_adc_sample_two_channels
Samples read: 0x0000
Assertion failed at ZEPHYR_BASE/tests/drivers/adc/adc_api/src/test_adc.c:243: check_samples: (0 equal to sample_value)
[0] should be non-zero

FAIL - test_adc_sample_two_channels
starting test - test_adc_asynchronous_call
Samples read: 0x0000
Assertion failed at ZEPHYR_BASE/tests/drivers/adc/adc_api/src/test_adc.c:243: check_samples: (0 equal to sample_value)
[0] should be non-zero

FAIL - test_adc_asynchronous_call
starting test - test_adc_sample_with_interval
sample_with_interval_callback: sampling 0
sample_with_interval_callback: sampling 1
sample_with_interval_callback: sampling 2
sample_with_interval_callback: sampling 3
sample_with_interval_callback: sampling 4
Samples read: 0x0000
Assertion failed at ZEPHYR_BASE/tests/drivers/adc/adc_api/src/test_adc.c:243: check_samples: (0 equal to sample_value)
[0] should be non-zero

FAIL - test_adc_sample_with_interval
starting test - test_adc_repeated_samplings
repeated_samplings_callback: done 1
Samples read: 0x0000
Assertion failed at ZEPHYR_BASE/tests/drivers/adc/adc_api/src/test_adc.c:243: check_samples: (0 equal to sample_value)
[0] should be non-zero
0x0000
Assertion failed at ZEPHYR_BASE/tests/drivers/adc/adc_api/src/test_adc.c:243: check_samples: (0 equal to sample_value)
[1] should be non-zero
0x0000 0x0000 0x0000 0x0000
repeated_samplings_callback: done 2
Samples read: 0x0000
Assertion failed at ZEPHYR_BASE/tests/drivers/adc/adc_api/src/test_adc.c:243: check_samples: (0 equal to sample_value)
[0] should be non-zero
ASSERTION FAIL [!(thread->base.user_options & ((1UL << (0))))] @ ZEPHYR_BASE/arch/arm/core/aarch32/cortex_m/thread_abort.c:36
essential thread aborted
E: r0/a1: 0x00000004 r1/a2: 0x00000024 r2/a3: 0x84000000
E: r3/a4: 0x000e807c r12/ip: 0x00000000 r14/lr: 0x000e1b9d
E: xpsr: 0x6100005e
E: Faulting instruction address (r15/pc): 0x000e606e
E: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
E: Fault during interrupt handling

E: Current thread: 0x00118790 (main)
E: Halting system

Environment (please complete the following information):

  • OS: fedora28
  • Toolchain: zephyr-sdk-0.10.3
  • Commit ID: g7ee5cf6a0b
@chen-png chen-png added the bug The issue is a bug, or the PR is fixing a bug label Jan 8, 2020
@jhedberg jhedberg added the priority: low Low impact/importance bug label Jan 14, 2020
@jocelyn-li jocelyn-li assigned dcpleung and unassigned wentongwu Feb 12, 2020
@ashaannajoy
Copy link

Comment from dcpleung: requires specific hardware setup for ADC to work (jumpers and a reasonable voltage source). It possibly needs pinmux changes in code. IIRC, the ADC pins are being used for other purposes in the EC code where this test would not work as-is

@dcpleung
Copy link
Member

On header J35, instead of connecting pins 1-2 and 4-5, try pin 1-2 and 3-4. This provides the ADC pins with ~2.048V with Vref at 3.0V. With 12-bit ADC, this should give you values around 0xAF0.

@225296
Copy link

225296 commented Feb 27, 2020

After changing the jumper on header J35 to pin 1-2 and 3-4 , Sanity check is PASSED

Environment (please complete the following information):
OS : Ubuntu LTS 18.04
Toolchain: Zephyr SDK : 0.11.2
Commit ID: g7b4861114372

@dcpleung dcpleung closed this as completed Mar 2, 2020
@chen-png
Copy link
Collaborator Author

After changing the jumper on header J35 to pin 1-2 and 3-4 , Sanity check is PASSED

@225296 could you show me how to connect pins on JP35?
I don't have the board manual for mec15xxevb_assy6853, and i found that there are totally 3 pins in JP35.

@225296
Copy link

225296 commented Mar 20, 2020

@chen-png JP35 is not the header we use for ADC ,
On header J35, has totally 5 pins instead of connecting pins 1-2 and 4-5, try pin 1-2 and 3-4 on mec15xxevb_assy6853 . It should PASS

Environment (please complete the following information):
OS : Ubuntu LTS 18.04
Toolchain: Zephyr SDK : 0.11.2
Commit ID: g7b4861114372

@chen-png
Copy link
Collaborator Author

@225296 thanks, i will have a try.

@chen-png
Copy link
Collaborator Author

chen-png commented Apr 3, 2020

@225296 i shorted pin 1-2 and pin 3-4 and ran this test, it wouldn't report any error, but it would stop at "test_adc_repeated_samplings", do you know how to fix this?

*** Booting Zephyr OS build zephyr-v2.2.0-1091-gc98652b42f12 ***
Running test suite adc_basic_test

starting test - test_adc_sample_one_channel
Samples read: 0x0af1 0x0000 0x0000 0x0000 0x0000 0x0000
PASS - test_adc_sample_one_channel

starting test - test_adc_sample_two_channels
Samples read: 0x0af2 0x0af5 0x0000 0x0000 0x0000 0x0000
PASS - test_adc_sample_two_channels

starting test - test_adc_asynchronous_call
Samples read: 0x0af2 0x0af8 0x0af8 0x0af8 0x0af8 0x0000
PASS - test_adc_asynchronous_call

starting test - test_adc_sample_with_interval
sample_with_interval_callback: sampling 0
sample_with_interval_callback: sampling 1
sample_with_interval_callback: sampling 2
sample_with_interval_callback: sampling 3
sample_with_interval_callback: sampling 4
Samples read: 0x0af8 0x0af9 0x0af2 0x0af0 0x0af0 0x0000
PASS - test_adc_sample_with_interval

starting test - test_adc_repeated_samplings
repeated_samplings_callback: done 1
Samples read: 0x0af2 0x0af6 0x0000 0x0000 0x0000 0x0000
repeated_samplings_callback: done 2
Samples read: 0x0af2 0x0af6 0x0af8 0x0af6 0x0000 0x0000
repeated_samplings_callback: done 3
Samples read: 0x0af2 0x0af6 0x0af2 0x0af5 0x0000 0x0000
repeated_samplings_callback: done 4
Samples read: 0x0af2 0x0af6 0x0af9 0x0af6 0x0000 0x0000

@dcpleung
Copy link
Member

dcpleung commented Apr 3, 2020

This is due to the board going into deep sleep and not waking up.

@chen-png
Copy link
Collaborator Author

chen-png commented Apr 7, 2020

how to fix this? otherwise, it will always be judged as failed test cases by sanity check script.

@dcpleung
Copy link
Member

dcpleung commented Apr 7, 2020

In current power management scheme, it is possible to turn on DEVICE_POWER_MANAGEMENT and modify the device driver to take advantage of this. It is also possible to modify the residency so the test would not fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

6 participants