john-kearney opened a new pull request, #21539: URL: https://github.com/apache/nuttx/pull/21539
## Summary `nrf91_errata_secure()` guards the errata 15 and 31 workarounds with `#ifdef NRF91_DCDC_ERRATA15_WORKAROUND` and `#ifdef NRF91_LFXO_ERRATA31_WORKAROUND`. Kconfig defines these options as `CONFIG_NRF91_DCDC_ERRATA15_WORKAROUND` and `CONFIG_NRF91_LFXO_ERRATA31_WORKAROUND`, so the macros being tested are never defined. As a result, neither workaround is ever compiled in, even though both options default to `y`: - Errata 15: supply regulators default to LDO mode after reset. The workaround enables the DC/DC regulator. - Errata 31: LFXO startup fails. The workaround is the same two register writes Nordic's `SystemInit` makes (nrfx `mdk/nrf91/system_nrf91.c`). This PR changes the two `#ifdef` lines to test the `CONFIG_` names. ## Impact Secure-side nRF91 builds with the default configuration will now enable the DC/DC regulator at boot and apply the LFXO startup fix. This is the behaviour the Kconfig options already describe. Nordic's SystemInit in nrfx also enables DC/DC on every nRF9160 revision (through errata 14 on Engineering A and errata 15 on later revisions). A board that needs to stay in LDO mode can turn off `CONFIG_NRF91_DCDC_ERRATA15_WORKAROUND`. Non-secure builds are not affected, because the function and both options sit under `!CONFIG_ARCH_TRUSTZONE_NONSECURE`. ## Testing I checked that the macros and register definitions the now-enabled code uses (`REGULATORS_DCDCEN_ENABLE`, `NRF91_REGULATORS_DCDCEN`) exist in `hardware/nrf91_regulators.h`, which the file already includes. I have not built it locally or run it on nRF9160 hardware. I'm relying on CI for the build check, and I'd welcome a test from someone with an nRF9160-DK. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
