nRF5340 memory transaction completion state for clock frequency transition

We want to be able to toggle between 128 MHz and 64 MHz on our nRF5340 based custom board depending on whether our audio pipeline is in process or not. However, a note in the Errata states that we need to ensure all memory transactions are completed before switching the frequency. Is there a straightforward to check all transactions are complete instead of keeping track of everything?

Ref: https://docs.nordicsemi.com/bundle/errata_nRF5340_EngA/page/ERR/nRF5340/EngineeringA/latest/anomaly_340_4.html

Also the instructions state to run these commands:

*(volatile uint32_t *)0x5084450C= 0x4040;
*(volatile uint32_t *)0x50026548 = 0x40;
*(volatile uint32_t *)0x50081EE4 = 0x4D;
NRF_CLOCK_S.HFCLKCTRL = 0;

But it looks like 

nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1);
does the job?
Thanks
Parents Reply Children
Related