他的回复:
就是根据咱们上一版开发板提供的例程改的:int NB_IoT_Reset(void){int ret=0;uint8_t *cmd="AT+NRB\r\n";HAL_Delay(5000);memset(LPUART1_RX_BUF,0,strlen((const char *)LPUART1_RX_BUF));//清除缓存printf("MCU-->>NB: %s\r\n",cmd);HAL_UART_Transmit(&hlpuart1, cmd, strlen((const char *)cmd), 1000);HAL_Delay(8000);while(1){if(strstr((const char *)LPUART1_RX_BUF,"OK")){ret = 0;break;}else{memset(LPUART1_RX_BUF,0,strlen((const char *)LPUART1_RX_BUF));//清除缓存LPUART1_RX_LEN = 0;printf("MCU-->>NB: %s\r\n",cmd); HAL_UART_Transmit(&hlpuart1, cmd, strlen((const char *)cmd), 1000);HAL_Delay(8000);}}printf("NB-->>MCU: %s\r\n",LPUART1_RX_BUF);HAL_Delay(1000);LPUART1_RX_LEN = 0;return ret;}