nrf52: dont write to read only register #1874
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Overview
While trying to debug what is wrong with the nrf52 15.4 driver, I realized that the nrf52 clock code attempts to write to a register that both the nrf52840 and nrf52832 datasheets define as a read only register (page 107: https://infocenter.nordicsemi.com/pdf/nRF52832_PS_v1.4.pdf , https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fclock.html&cp=4_0_0_4_3_2_16&anchor=register.HFCLKSTAT) .
This PR removes this incorrect code. Despite this function call not working, the code was actually functionally correct, because the subsequent line that starts the high speed clock has a side effect of setting the HighClockSource to XTAL anyway (per https://infocenter.nordicsemi.com/topic/ps_nrf52840/clock.html?cp=4_0_0_4_3_2_0#register.TASKS_HFCLKSTART).
Testing Strategy
Flashing the 15.4 radio_tx app on an nrf52840. It works the same as before this change.
TODO or Help Wanted
N/A.
Documentation Updated
Formatting
make format
.make clippy
.