You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A very easy thing to miss is that clock is the wrong type - I used sercom3_core but should have used sercom0_core. The result was that within the call stack enable->self.registers.enable->usart.ctrlb.modify, the processor entered a trap since sercom0 wasn't configured.
It seems like it would be possible to provide a separate method to new that would take a reference to a sercom clock, to configure it properly. Or, maybe it would be good to add a debug_assert within enable to check that the appropriate clock is enabled.
The text was updated successfully, but these errors were encountered:
@tgross35, yes, clock safety is coming soon with the merge of #450. I'm currently working to port that code to D21 and D11 chips. Once that is done, we can start using it elsewhere in the HAL, including the sercom module.
I had a config like the following:
A very easy thing to miss is that
clock
is the wrong type - I usedsercom3_core
but should have usedsercom0_core
. The result was that within the call stack enable->self.registers.enable->usart.ctrlb.modify, the processor entered a trap since sercom0 wasn't configured.It seems like it would be possible to provide a separate method to
new
that would take a reference to a sercom clock, to configure it properly. Or, maybe it would be good to add a debug_assert withinenable
to check that the appropriate clock is enabled.The text was updated successfully, but these errors were encountered: