测试软件及硬件平台
- CubeMX;
- Keil5;
- STM32F103C8T6;
代码记录
在程序一开始定义几个变量:
unsigned char uRx_Data[255] = {0}; //存储数组
unsigned char uLength = 0; //接收数据长度
unsigned char aRxBuffer; //接收临时数据
初始化代码
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init