2024-08-26 02:10 PM
Hi Guys,
This is my simple ADC program and i was expecting to see some data output on Live expression window. Instead it is showing "Failed to evaluate"
//initialization:
/* USER CODE BEGIN 1 */
uint16_t raw;
char msg[10];
/* USER CODE END 1 */
//while loop
{
//set GPIO Pin high PA8
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET);
// GEt ADC Value
HAL_ADC_Start(&hadc1);
HAL_ADC_PollForConversion(&hadc1, HAL_MAX_DELAY);
raw= HAL_ADC_GetValue(&hadc1);
//convert the string and print
sprintf(msg, "%h\r\n", raw);
HAL_UART_Transmit(&huart3, (uint8_t*)msg, strlen(msg), HAL_MAX_DELAY);
HAL_Delay(1);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
The same issue is not happening when i am using Black pill board and all live expressions are visible.
2024-08-26 03:11 PM
Please see the posting tips for how to properly post source code:
@mahmanish wrote:The same issue is not happening when i am using Black pill board
So what board are you using when the issue does happen ?
Does the correct output appear from your UART ?