stm32h747-Disco uart8 sending trouble
I'm use uart8 to send data to arduino, but arduino no receive nothing, all the program is right complier,and the D1/D0 should be right(only have uart8).https://community.st.com/t5/stm32-mcu-products/stm32h747i-disco-virtual-com-via-usart-to-arduino/m-p/578727#M219845. which parte of code should be wrong?
uart part:
static void MX_UART8_Init(void)
{
__HAL_RCC_UART8_CLK_ENABLE();
//__HAL_UART_CLEAR_IDLEFLAG(&huart8);
/* USER CODE BEGIN USART1_Init 0 */
/* USER CODE END USART1_Init 0 */
/* USER CODE BEGIN USART1_Init 1 */
/* USER CODE END USART1_Init 1 */
huart8.Instance = UART8;
//huart8.Init.BaudRate = 115200;
huart8.Init.BaudRate = 115200;
huart8.Init.WordLength = UART_WORDLENGTH_8B;
huart8.Init.StopBits = UART_STOPBITS_1;
huart8.Init.Parity = UART_PARITY_NONE;
huart8.Init.Mode = UART_MODE_TX_RX;
huart8.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart8.Init.OverSampling = UART_OVERSAMPLING_16;
huart8.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart8.Init.ClockPrescaler = UART_PRESCALER_DIV1;
huart8.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if(contadoruart=0){
HAL_UART_Init(&huart8);
if (HAL_UART_Init(&huart8) != HAL_OK)
{
Error_Handler();
}
contadoruart=contadoruart+1;
}
rcc setting:
System Clock Configuration
* The system Clock is configured as follow :
* System Clock source = PLL (HSE)
* SYSCLK(Hz) = 400000000 (Cortex-M7 CPU Clock)
* HCLK(Hz) = 200000000 (Cortex-M4 CPU, Bus matrix Clocks)
* AHB Prescaler = 2
* D1 APB3 Prescaler = 2 (APB3 Clock 100MHz)
* D2 APB1 Prescaler = 2 (APB1 Clock 100MHz)
* D2 APB2 Prescaler = 2 (APB2 Clock 100MHz)
* D3 APB4 Prescaler = 2 (APB4 Clock 100MHz)
* HSE Frequency(Hz) = 25000000
* PLL_M = 5
* PLL_N = 160
* PLL_P = 2
* PLL_Q = 4
* PLL_R = 2
* VDD(V) = 3.3
* Flash Latency(WS) = 4
gpio part:
static void MX_GPIO_Init(void)
{
GPIO_InitTypeDef GPIO_InitStruct;
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOJ_CLK_ENABLE();
__HAL_RCC_UART8_CLK_ENABLE();
/*Configure GPIO pin: PJ8 For D1 pin for TX */
// GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_9;
//GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
//GPIO_InitStruct.Pull = GPIO_NOPULL; //pullup
GPIO_InitStruct.Pull = GPIO_PULLUP; //pullup
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF8_UART8;
if(contadorgpio=0){
HAL_GPIO_Init(GPIOJ, &GPIO_InitStruct);
contadorgpio=contadorgpio+1;
}
sending parte: both not work:
//HAL_UART_Transmit(&huart8,(uint8_t*)msg,strlen(msg),100);
HAL_UART_Transmit(&huart8,"mesaage",10,1000);
scope parte:

hardware parte:

