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

Adding workaround for nrf52 anomaly 89 #180

Closed

Conversation

gumulka
Copy link

@gumulka gumulka commented May 11, 2024

@gumulka gumulka force-pushed the nrf52_anomaly_89_workaround branch from fac2a54 to 6b98dc6 Compare October 9, 2024 19:53
@anangl
Copy link
Member

anangl commented Nov 25, 2024

doing exactly what is written here: https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_89.html

At the end, the erratum says: "reconfiguration of TWIM/SPIM is required before next usage" (the above link no longer works, this one can be used instead). Your implementation does not seem to be addressing this.

Anyway, anomaly 89 is already handled in another way. See:

#if NRF52_ERRATA_89_ENABLE_WORKAROUND
if (nrf52_errata_89())
{
*(volatile uint32_t *)((uint8_t *)p_reg + 0x500UL) = 9;
}
#endif

hal_nordic/nrfx/hal/nrf_spim.h

Lines 1248 to 1264 in ce87268

#if NRF52_ERRATA_89_ENABLE_WORKAROUND
if (nrf52_errata_89())
{
uint32_t temp1 = *(volatile uint32_t *)((uint8_t *)p_reg + 0x508UL);
uint32_t temp2 = *(volatile uint32_t *)((uint8_t *)p_reg + 0x50CUL);
*(volatile uint32_t *)((uint8_t *)p_reg + 0x500) = 0;
*(volatile uint32_t *)((uint8_t *)p_reg + 0x508) = 0xFFFFFFFF;
*(volatile uint32_t *)((uint8_t *)p_reg + 0x50C) = 0xFFFFFFFF;
*(volatile uint32_t *)((uint8_t *)p_reg + 0x500) = 9;
p_reg->ENABLE = (SPIM_ENABLE_ENABLE_Disabled << SPIM_ENABLE_ENABLE_Pos);
*(volatile uint32_t *)((uint8_t *)p_reg + 0x508) = temp1;
*(volatile uint32_t *)((uint8_t *)p_reg + 0x50C) = temp2;
}
else
#endif

@gumulka gumulka closed this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants