Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion firmware/c_board/bsp/cubemx/Core/Src/usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void MX_USART6_UART_Init(void)

/* USER CODE END USART6_Init 1 */
huart6.Instance = USART6;
huart6.Init.BaudRate = 115200;
huart6.Init.BaudRate = 921600;
huart6.Init.WordLength = UART_WORDLENGTH_8B;
huart6.Init.StopBits = UART_STOPBITS_1;
huart6.Init.Parity = UART_PARITY_NONE;
Expand Down
3 changes: 2 additions & 1 deletion firmware/c_board/bsp/cubemx/rmcs_slave.ioc
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ USART3.Parity=PARITY_EVEN
USART3.StopBits=STOPBITS_1
USART3.VirtualMode=VM_ASYNC
USART3.WordLength=WORDLENGTH_9B
USART6.IPParameters=VirtualMode
USART6.BaudRate=921600
USART6.IPParameters=VirtualMode,BaudRate
USART6.VirtualMode=VM_ASYNC
USB_OTG_FS.IPParameters=VirtualMode
USB_OTG_FS.VirtualMode=Device_Only
Expand Down
2 changes: 1 addition & 1 deletion firmware/rmcs_board/app/src/uart/uart.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ inline constinit Uart::Lazy uart_dbus{
data::DataId::kUartDbus, kDbusBoardConfig, 100000, parity_even};

inline constinit Uart::Lazy uart_array[]{
Uart::Lazy{data::DataId::kUart0, kBoardConfigs[0], 115200, parity_none},
Uart::Lazy{data::DataId::kUart0, kBoardConfigs[0], 921600, parity_none},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

避免把“临时调试”波特率直接固化为主线默认值

Line 143 将 UART0 默认波特率改为 921600,会直接改变既有串口工具/上位机(若仍按 115200)的连通性契约。既然这是临时调试用途,建议改为可切换配置(宏或集中常量),主线默认保持 115200。

💡 建议改法(示例)
+constexpr uint32_t kUart0Baudrate =
+#ifdef RMCS_UART0_DEBUG_BAUD_921600
+    921600;
+#else
+    115200;
+#endif
+
 inline constinit Uart::Lazy uart_array[]{
-    Uart::Lazy{data::DataId::kUart0, kBoardConfigs[0], 921600, parity_none},
+    Uart::Lazy{data::DataId::kUart0, kBoardConfigs[0], kUart0Baudrate, parity_none},
     Uart::Lazy{data::DataId::kUart1, kBoardConfigs[1], 115200, parity_none},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@firmware/rmcs_board/app/src/uart/uart.hpp` at line 143, Uart::Lazy is
currently hardcoded with 921600 for data::DataId::kUart0 (kBoardConfigs[0])
which is a temporary debug baud and breaks existing tools; change the default
back to 115200 and make the baud configurable via a centralized constant or
macro (e.g. UART_DEFAULT_BAUD or BOARD_UART_BAUD) so the Uart::Lazy initializer
uses that symbol instead of the magic literal 921600, and update any related
docs or config header where board serial defaults are defined.

Uart::Lazy{data::DataId::kUart1, kBoardConfigs[1], 115200, parity_none},
#ifdef BOARD_UART2
Uart::Lazy{data::DataId::kUart2, kBoardConfigs[2], 115200, parity_none},
Expand Down
Loading