STM32U5 series
Hi, I am tring to read analog voltage from ADC on this board: STM32 U575ZIT. Using this code:
......
char msg2[15];
......
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_ADC_Start(&hadc1);
HAL_ADC_PollForConversion(&hadc1, 300);
raw = HAL_ADC_GetValue(&hadc1);
float vin = raw*(5/16384);
sprintf(msg2," vol = %.2f\r\n",vin);
HAL_UART_Transmit(&huart1, (uint8_t*)msg2, strlen(msg2), 300);
HAL_Delay(1000);
//sprintf(msg2," vol = %2.f\r\n",vin);
}
but any time the follow error happend, and on one selected com, i see any time 0.000000
1) Failed to execute MI command: -var-create - * step Error message from debugger back end: -var-create: unable to create variable object
2) Failed to execute MI command: -var-create - * step Error message from debugger back end: -var-create: unable to create variable object
3) Failed to execute MI command: -data-evaluate-expression step Error message from debugger back end: No symbol "step" in current context.
4) Failed to execute MI command: -var-create - * step Error message from debugger back end: -var-create: unable to create variable object
5) Unable to create variable object
how is possible.
If i try to send only charatters on the com without using ADC, on the selected com i am able to see the data.
Any help please