feat(canfd): 添加CANFD发送邮箱占用处理机制
当CAN控制器因总线无ACK导致邮箱卡死时,实现两段式恢复策略: 1) 短自旋轮询邮箱状态,大多数场景下可避免触发abort而不丢帧 2) 若仍全部PENDING则只中止第一个占用邮箱,限制最坏丢帧数量为1帧 添加了tx_abort_count诊断计数器用于监控该情况,并引入SysTick延时功能 refactor(spi-cmd): 优化SPI命令日志输出格式 将CAN发送相关日志改为统一的格式化函数输出,增加数据字段十六进制显示功能, 并扩大日志缓冲区大小从128到256字节以支持更详细的日志信息 chore(spi-command): 添加SPI帧类型分类和非刷写帧日志记录 新增isFlashRelatedFrame函数区分刷写相关帧类型,在处理命令时对非刷写帧进行日志记录 perf(diagnostic): 在诊断打印中添加发送中止计数统计 更新诊断信息打印格式,增加tx_abort计数项,便于监控CAN发送异常情况
This commit is contained in:
@@ -127,7 +127,7 @@
|
||||
/** @brief APP 补丁版本号。 */
|
||||
#define APP_FW_VERSION_PATCH 1U
|
||||
/** @brief APP 构建编号。 */
|
||||
#define APP_FW_VERSION_BUILD 0U
|
||||
#define APP_FW_VERSION_BUILD 2U
|
||||
|
||||
/* ============================================================
|
||||
* BOOT 版本在 OTA 配置页中的 Flash 存储地址
|
||||
|
||||
@@ -241,7 +241,7 @@ void TaskRunner::taskDiagnosticPrint()
|
||||
static_cast<unsigned long>(vin_adc_mV / 1000U),
|
||||
static_cast<unsigned long>(vin_adc_mV % 1000U));
|
||||
#else
|
||||
printf("[APP] uptime=%lus valid=%u, temp=%ld.%02ld C, vdda=%lu.%03lu V, vin_adc=%lu.%03lu V, rx_ch=%u, rx_id=0x%08lX, rx_len=%u, tx_ch=%u, can_tx=%lu, can_rx=%lu, sw_drop=%lu, hw_full=%lu, hw_over=%lu, tx_drop=%lu, can_err=%lu\r\n",
|
||||
printf("[APP] uptime=%lus valid=%u, temp=%ld.%02ld C, vdda=%lu.%03lu V, vin_adc=%lu.%03lu V, rx_ch=%u, rx_id=0x%08lX, rx_len=%u, tx_ch=%u, can_tx=%lu, can_rx=%lu, sw_drop=%lu, hw_full=%lu, hw_over=%lu, tx_drop=%lu, tx_abort=%lu, can_err=%lu\r\n",
|
||||
(unsigned long)g_app_uptime_sec,
|
||||
static_cast<unsigned int>(s.valid),
|
||||
static_cast<long>(temp_x100 / 100),
|
||||
@@ -260,6 +260,7 @@ void TaskRunner::taskDiagnosticPrint()
|
||||
static_cast<unsigned long>(diag->rx_fifo_full_count),
|
||||
static_cast<unsigned long>(diag->rx_fifo_overfull_count),
|
||||
static_cast<unsigned long>(diag->tx_drop_count),
|
||||
static_cast<unsigned long>(diag->tx_abort_count),
|
||||
static_cast<unsigned long>(diag->error_count));
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user