2023-08-12 04:55 AM
If when i use hal_uart_init(&huart8) get result Details:HAL_ERROR Default:HAL_ERROR,Decimal:1,Hex:0x1,Binary:1,Octal:01.When i use step into ,reach at final while(sets-- !=0u)and no more what does this mean ? how could i solve this problem?
static void MX_USART8_UART_Init(void)
{
/* 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.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 (HAL_UART_Init(&huart8) != HAL_OK)
{
Error_Handler();
}
2023-08-12 06:48 AM
The GDB debugger is unable to step through SCB_EnableDCache and other SDB...Cache inline functions. This is a known issue, I don't know the exact reason. Just do not step into these functions, leave them alone.
This is not related to your UART problem. If in doubt, just do not enable the caches yet.
Are there other issues with your UART?
2023-08-12 07:11 AM
so what is the posible reason for hal_uart_init(&huart8) get HAL_ERROR?
2023-08-12 07:22 AM
All the source is available, review the exit paths.