你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

Why does the UART initialization fail when the optimization is set to 0 or 1?

[复制链接]
Jerly.Lei 提问时间:2023-11-13 20:16 / 未解决

Hi:

Currently, I am using STM32C031. When debugging UART, it works normally when the optimization setting is set to 2 or 3, but fails to work when set to 0 or 1. Finally, it was found through checking the registers that the UART baud rate was not set effectively when optimization was set to 0 or 1, and the UART baud rate setting used an inline function. Can it be explained whether there is any correlation between optimization and inline, and why setting optimization would cause UART initialization to fail?

点评

__STATIC_INLINE void LL_USART_SetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t PrescalerValue, uint32_t OverSampling,   发表于 2023-11-14 09:18
收藏 评论1 发布时间:2023-11-13 20:16

举报

1个回答
关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
st-img 微信公众号
st-img 手机版