Skip to main content
Graduate
August 26, 2024
Solved

Variables are showing nothing in Live expression window

  • August 26, 2024
  • 3 replies
  • 2328 views

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.

 

 

    This topic has been closed for replies.
    Best answer by mƎALLEm

    And try to declare raw variable as global.

    3 replies

    Super User
    August 26, 2024

    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 ?

    mahmanishAuthor
    Graduate
    August 27, 2024

    Sorry for my ignorance. I am new to this community site.

    My board is Nucleo H7A3ZI 144 pin.

    Regarding UART, output is appearing jumbled on Terminal (screen shot attached) .

    I am not able to evaluate any live expressions. While with same code i am able to see live expressions in my STM F4 black pill board. (screen shot attached).

     

    So i belive, i am missing some setting of Nucleo H7A3ZI board and that is creating problem. 

    What is your opinion?

    Technical Moderator
    August 27, 2024

    Hello @mahmanish and welcome to the community.

    You need to use </> button to paste your code.

    I'm editing your post then ..

    mƎALLEmAnswer
    Technical Moderator
    August 27, 2024

    And try to declare raw variable as global.

    mahmanishAuthor
    Graduate
    August 27, 2024

    This was too bad for me to see this mistake. I wasted so much time on this. Fianlly everything is in order. 

     

    Thank you so much SofLit.