fix UICR check; do not use NULL for no MISO #2571
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.
UICR fix
At least some CLUE's have
NRF_UICR->REGOUT0
set to all 1's, which when the chip is in "high voltage mode" will make the outputs be 1.8V instead of 3.3V. However the nRF module on the CLUE is not in high voltage mode, so this register is ignored.Nevertheless, we had code to fix this to rewrite
REGOUT0
, but it wasn't working because the update to nrfx v2.0.0 forced us to use a new nvm writing API, which doesn't let you write to UICR because it out of bounds of regular flash memory. I opened a ticket with Nordic about this: https://devzone.nordicsemi.com/f/nordic-q-a/57243/nrfx_nvmc-h-api-cannot-write-to-uicr.I fixed the writing code (but it's not tested), and more importantly, didn't bother to do the UICR write if the module is not in high voltage mode. The voltage is fine as is.
board.c
display initializationThe
common_hal_busio_spi_construct()
calls in all theboard.c
files with on-board displays were usingNULL
for the unused MISO pin. This worked for atmel-samd because it accepted bothNULL
andmp_const_none
, but it didn't work on nrf, which only expectedmp_const_none
. (And other ports don't acceptNULL
either). If it worked it was by accident (some builds worked), probably assigning a random pin to MISO. I fixed all the those calls on all boards to passmp_const_none
instead ofNULL
.