diff --git a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/peripheral_main.c b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/peripheral_main.c index ceecfa1..1d8858c 100644 --- a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/peripheral_main.c +++ b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/peripheral_main.c @@ -331,6 +331,23 @@ int main(void) HAL_Init(); uart_init(); + + /* ===== 实验: 禁用 UART2 (Loop 口) 隔离测试 (2026-08-12) ===== + 目的: 验证 Loop MCU 数据/干扰是否导致复位循环 (RST_REASON 全 0 瞬态复位) + 做法: USART2 关断 + PA3 脱离 UART 功能(上拉输入) — 等效软件断开 Loop + 通过后删除此块; 另: 禁用后快照无帧入队, 同步验证快照 SPI 活动非诱因 */ + { + GPIO_InitTypeDef gpio; + USART_ITConfig(USART2, USART_IT_RXNE, DISABLE); + USART_Cmd(USART2, DISABLE); + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); + gpio.GPIO_Pin = GPIO_Pin_3; + gpio.GPIO_Mode = GPIO_Mode_IPU; /* PA3 脱离 UART2, 上拉输入 */ + gpio.GPIO_Speed = GPIO_Speed_50MHz; + GPIO_Init(GPIOA, &gpio); + PRINT("ISOLATE: UART2 disabled (Loop isolation test)\n"); + } + TIM3_Init(); TIM2_Init();