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
I'm using revision 9545471 and targeting a STM32G070RBT6, which has a USART4.
When I call usart_set_baudrate(USART4, 100000) the device crashes due to an assertion failure at:
(gdb) bt
#0 cm3_assert_failed () at ../../cm3/assert.c:24
#1 0x08001964 in rcc_get_usart_clk_freq (usart=usart@entry=1073761280) at rcc.c:583
#2 0x08001be6 in usart_set_baudrate (usart=1073761280, baud=100000) at ../common/usart_common_all.c:55
That function doesn't know about USART4, because it's also missing from RCC_CCIPR (RM0454 p163):
I think what's going on there, based on this bit of the clock tree (RM0454 p124):
and this table in the USART docs (RM0454 p777):
is that this only works on "full" USARTs and not "basic" ones. It's unclear to me where the basic USARTs get their clock from.
(This also suggests it shouldn't even work on USART3 on the G070, but the previous revision of the board I'm working on used USART3 and it seemed to work fine, possibly by accident.)
The text was updated successfully, but these errors were encountered:
I think this means that adding "else just return the APB frequency" as a fallback case to rcc_get_usart_clk_freq() in place of the cm3_assert_not_reached() call that's there now would fix this, but I'm not certain enough that that's always correct to submit it as a pull request.
I'm using revision 9545471 and targeting a STM32G070RBT6, which has a USART4.
When I call
usart_set_baudrate(USART4, 100000)
the device crashes due to an assertion failure at:That function doesn't know about
USART4
, because it's also missing fromRCC_CCIPR
(RM0454 p163):I think what's going on there, based on this bit of the clock tree (RM0454 p124):
and this table in the USART docs (RM0454 p777):
is that this only works on "full" USARTs and not "basic" ones. It's unclear to me where the basic USARTs get their clock from.
(This also suggests it shouldn't even work on USART3 on the G070, but the previous revision of the board I'm working on used USART3 and it seemed to work fine, possibly by accident.)
The text was updated successfully, but these errors were encountered: