-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[bsp][stm32][uart]:fix stm32 uart timout #10022
base: master
Are you sure you want to change the base?
Conversation
两个ci错误好像都是rom溢出 |
用浮点导致的( 这种库就最好避免浮点吧。。 |
那就10 * HAL_RCC_GetSysClockFreq() / cfg->baud_rate / 4 |
@
@wdfk-prog 大佬你觉得呢 |
|
这个算cpu要等几个clk用系统时钟倒也正常?具体的式子咋推导的啊 |
|
这边应该跟串口的时钟频率没有关系吧,--block_timeout,应该跟系统的频率有关吧 rt-thread/bsp/stm32/libraries/HAL_Drivers/drivers/drv_usart.c Lines 344 to 362 in aa3328f
|
|
但是现在的问题是block_timeout值设定的问题,那么block_timeout--,不就只是跟单片机频率有关而已吗,一开始的问题就是因为block_timeout值太小了,会导致发送没完成 |
每次执行 |
|
10 * HAL_RCC_GetSysClockFreq() / cfg->baud_rate / 4 ,如果是根据这个公式的话,以f1,9600波特率来计算,10*72000000/9600/4=18,750,这个值已经足够f1发送完成一个字节了。 |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
fixed: #9964
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up