cancel
Showing results for 
Search instead for 
Did you mean: 

Variables are showing nothing in Live expression window

mahmanish
Associate II

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.

 

 

1 REPLY 1
Andrew Neil
Evangelist III

Please see the posting tips for how to properly post source code:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 


@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 ?