iT邦幫忙

0

有關STM32 L053R8 UART無法傳輸問題

//以下是程式碼
#include "main.h"

UART_HandleTypeDef huart2;
DMA_HandleTypeDef hdma_usart2_rx;

void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_DMA_Init(void);
static void MX_USART2_UART_Init(void);

uint8_t rx_data[10];

int main(void)
{
HAL_Init();

SystemClock_Config();

MX_GPIO_Init();
MX_DMA_Init();
MX_USART2_UART_Init();

while (1)

{

	HAL_UART_Receive(&huart2,rx_data,4,100);
	
	HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_5);
	HAL_Delay(250);

}

}
https://ithelp.ithome.com.tw/upload/images/20210914/20139946v2rl6AKozQ.jpg

https://ithelp.ithome.com.tw/upload/images/20210914/20139946mdNb9BEmo1.jpg

https://ithelp.ithome.com.tw/upload/images/20210914/20139946nbpiGZ7fqG.jpg

尚未有邦友回答

立即登入回答