-
Notifications
You must be signed in to change notification settings - Fork 7k
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
samples: nrfx_prs: Fix sample frequency and baudrate #71157
samples: nrfx_prs: Fix sample frequency and baudrate #71157
Conversation
5c6eeac
to
71b8ccb
Compare
@@ -221,7 +226,7 @@ static bool switch_to_uarte(void) | |||
nrfx_uarte_config_t uarte_config = NRFX_UARTE_DEFAULT_CONFIG( | |||
NRF_UARTE_PSEL_DISCONNECTED, | |||
NRF_UARTE_PSEL_DISCONNECTED); | |||
uarte_config.baudrate = NRF_UARTE_BAUDRATE_1000000; | |||
uarte_config.baudrate = MHZ(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect. The field here is still of the enumerated type, so this line should stay untouched.
The UARTE initialization fails due to a different reason - the RXSTARTED event appears to be set because its register is at the same location as the SPIM event STARTED. So we'll need something like:
/* Make sure all SPIM events are cleared. */
nrfy_spim_int_init(spim.p_reg, 0xFFFFFFFF, 0, false);
in the if (spim_initialized)
block right above and a similar clean-up in switch_to_spim()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. thanks.
I tested with your workarounds an it works.
However to me it seems like this should be part of nrfx uninit function.
Clearing the event registers seems like an important step. For example if these functions are used in this scenario, or between images in a bootchain, like mcuboot -> tf-m -> application.
It can be added here as a temporary workaround until a new release of NRFX of course.
@anangl Added workarounds. I think the proper fix is to make sure that events get cleared in the nrfx_<peripheral>_uninit functions. |
Did you forget to push the branch?
I completely agree, this should be ultimately addressed in nrfx. |
Fix setting of sample frequency. The nrfx drivers are now using raw integere values instead of nrf definitions. Fixes: zephyrproject-rtos#71154 Signed-off-by: Joakim Andersson <joakim.andersson@heimdallpower.com>
Add handling of SCK initial value based on the SPI mode used. If mode is using CPOL then SCK needs to be set. Fixes: zephyrproject-rtos#71154 Signed-off-by: Joakim Andersson <joakim.andersson@heimdallpower.com>
71b8ccb
to
9a68c15
Compare
Sorry, pushed now. |
Add workaround for uninit functions not clearing events for spim and uarte. Signed-off-by: Joakim Andersson <joerchan@gmail.com>
9a68c15
to
177329a
Compare
Fix sample frequency and baudrate.
The nrfx drivers are now using raw integere values instead of nrf definitions.
Add handling of SCK initial value based on the SPI mode used.
If mode is using CPOL then SCK needs to be set.
Fixes: #71154