cancel
Showing results for 
Search instead for 
Did you mean: 

int Array not diplayed in expression viewer while debugging

vs_rzb
Associate

Hey there,

im currently trying to debug a small project, where I use a Timer to Read 5 ADC values every second and store them to an array via DMA.

While debugging, I couldn't figure out how to display an array in the expression viewer. I saw some videos which suggest, that the IDE automatically detects an array when entered in the expression, but that isn't the case with me.

As the flash memory of my mcu is rather small, I have to build the project with optimization to build without errors. I tried -Og, -O1 and -Os, which doesn't affect my problem.

If anyone has an idea how I could fix this, I would be very happy. I'm attaching my code from the variable declaration and a screenshot from the expression viewer.

If i missed to provide any important information, please let me know.

 

 

/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
#define ADC_BUFFER 5
#define REFVOLTAGE 3000
/* USER CODE END PD */

/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */

/* USER CODE END PM */

/* Private variables ---------------------------------------------------------*/
ADC_HandleTypeDef hadc1;
DMA_HandleTypeDef hdma_adc1;

SPI_HandleTypeDef hspi1;

TIM_HandleTypeDef htim3;

UART_HandleTypeDef huart1;

/* USER CODE BEGIN PV */
uint16_t PT_raw[ADC_BUFFER];
/* USER CODE END PV */

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
vs_rzb
Associate

Thanks for your replies, until now I couldn't find the problem but I fixed in nevertheless.

After starting a blank new project and rewriting the code the issue was gone. It might have been a bug or I accidentally messed up something in the configuration.

View solution in original post

2 REPLIES 2
Rim LANDOLSI
ST Employee

Hello @vs_rzb and welcome to the community,

 

In this example, the array variable PT_raw is declared as a global variable, so its value isn't evaluated in the expression view. To see the value, you could declare it as a local variable in the main function.

Thanks,

Rim.

vs_rzb
Associate

Thanks for your replies, until now I couldn't find the problem but I fixed in nevertheless.

After starting a blank new project and rewriting the code the issue was gone. It might have been a bug or I accidentally messed up something in the configuration.