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

ADC after TRNG: Cannot use ADC after disabling "TRNG" functionality (ESP32-C6) (IDFGH-13185) #14124

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

Comments

@playfulFence
Copy link

playfulFence commented Jul 2, 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.4-dev-1308-gb793ffe71d-dirty

Espressif SoC revision.

esp32c6 (revision v0.0)

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.

ESP32-C6 DevKitC-1 v1.1

Power Supply used.

USB

What is the expected behavior?

After disabling source of entropy with bootloader_random_disable function from this file ADC is expected to be usable.

Example (on esp32):
image

What is the actual behavior?

However, it shots the Guru Meditation Error
image

Steps to reproduce.

  1. Add bootloader_random_enable and then bootloader_random_disable at the start of oneshot_read ADC example
  2. Flash and execute example on ESP32-C6

image

Debug Logs.

No response

More Information.

Tested on my colleague's Linux machine. Same behaviour on my macOS one.

I was implementing the TRNG functionality in the esp-rs drivers when I noticed that the steps from esp-idf for this problem were causing the ADC peripheral to not work correctly. I decided to double check if the "original" works correctly in this edge case, when someone wants to drop ADC entropy source for RNG and normally use ADC afterwards.

Problematic file: https://github.com/espressif/esp-idf/blob/master/components/bootloader_support/src/bootloader_random_esp32c6.c

@playfulFence playfulFence added the Type: Bug bugs in IDF label Jul 2, 2024
@github-actions github-actions bot changed the title ADC after TRNG: Cannot use ADC after disabling "TRNG" functionality (ESP32-C6) ADC after TRNG: Cannot use ADC after disabling "TRNG" functionality (ESP32-C6) (IDFGH-13185) Jul 2, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jul 2, 2024
playfulFence added a commit to playfulFence/esp-hal that referenced this issue Jul 2, 2024
Downgrade for `esp32c6` is not implemented due to: espressif/esp-idf#14124
playfulFence added a commit to playfulFence/esp-hal that referenced this issue Jul 2, 2024
Downgrade for `esp32c6` is not implemented due to: espressif/esp-idf#14124

clippy
playfulFence added a commit to playfulFence/esp-hal that referenced this issue Jul 2, 2024
Downgrade for `esp32c6` is not implemented due to: espressif/esp-idf#14124

clippy

fmt
@0xjakob
Copy link
Contributor

0xjakob commented Jul 3, 2024

@playfulFence Thanks for letting us know. We could reproduce this and will check what the issue is here.

@0xjakob
Copy link
Contributor

0xjakob commented Aug 5, 2024

@playfulFence Just wanted to let you know we haven't forgot about this issue. We're still working on fixing it.

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Aug 6, 2024
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: In Progress Work is in progress labels Aug 12, 2024
espressif-bot pushed a commit that referenced this issue Aug 12, 2024
…or C6

This configuration bit is required for ADC operation as well and hence
should not be cleared in the RNG API sequence.

Ideally, the ADC driver should take care of initializing this bit but
still the RNG layer change is required because of interleaved API usage
scenario described in following linked issue.

Closes #14124
Closes #14280
@playfulFence
Copy link
Author

Thanks a lot!

espressif-bot pushed a commit that referenced this issue Aug 21, 2024
…or C6

This configuration bit is required for ADC operation as well and hence
should not be cleared in the RNG API sequence.

Ideally, the ADC driver should take care of initializing this bit but
still the RNG layer change is required because of interleaved API usage
scenario described in following linked issue.

Closes #14124
Closes #14280
espressif-bot pushed a commit that referenced this issue Aug 22, 2024
…or C6

This configuration bit is required for ADC operation as well and hence
should not be cleared in the RNG API sequence.

Ideally, the ADC driver should take care of initializing this bit but
still the RNG layer change is required because of interleaved API usage
scenario described in following linked issue.

Closes #14124
Closes #14280
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

3 participants