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

Wrong behavior on STM32_ADC_Common when using FeedVoltageSampleToChannel #570

Open
nandojve opened this issue Dec 30, 2023 · 0 comments
Open

Comments

@nandojve
Copy link

Description

After apply the fixes of renode/renode-infrastructure#94 I tried to use the simulation to run robot to perform the ADC tests. I noted that when using FeedVoltageSampleToChannel the first read is always zero on all channels. It seems that after the second read the simulation consumes the loaded data.

Expected behavior

It is expected that when load a machine and then load data to ADCs when the simulation starts the first read consume the data loaded.

How to reproduce?

1- Apply the fixes of renode/renode-infrastructure#94
2- Build https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/adc from https://github.com/nandojve/zephyr/tree/renode/fix_stm32_c0g0l0_adc branch
west build -b nucleo_g071rb deps/zephyr/samples/drivers/adc -t run
3- Stop simulation
4- Use the command logged without the "--disable-xwt" and "s" option (note: some zephyr path could be different due to project configurations)
<path>/renode --port -2 --pid-file renode.pid -e '$bin=@<path>/build/zephyr/zephyr.elf; include @<path>/deps/zephyr/boards/arm/nucleo_g071rb/support/nucleo_g071rb.resc;'

5- Feed ADC channels with 1 sample each, start and stop simulation

image

6- Repeat the process and confirm (second time) that simulation always read the first sample as 0 for each channel

image

7- Load more samples and test

image

Environment

Please, provide the following information:

  • Linux debian12 6.1.0-16-amd64
  • Renode, version 1.14.0.26928 (7be2240-202311191610)

Do you plan to address this issue and file a PR?

It is not clear to me why the first sample is not valid. I can send a patch with some help once we figure out the root of cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant