Skip to main content
A.D.
Associate III
Solved

How to interpret the "Expressions" of Arrays in Debug mode of CubeIDE?

I can't really see how the "Expression" window in the STM32CubeIDE in Debug mode is interpreting arrays.

I have an array "receiveData" with 7 uint8_t elements that I receive via UART.

When I check out this array under "Expressions" I see that the array has 7 elements, just as expected. But while the value is != 0, all array elements are shown with value 0! I would have expected the first to Hex-digits from "value" belonging to element 0, the next two digits to element 1 and so on.

And in the detailed window at the bottom of the screenshot it only shows 6 times "\0" under details, not 7 times.

So my two questions are:

  • Why are all elements 0, while the value of the array in general is != 0?
  • Why is the "Details" parameter showing less elements than the array actually has?

 0693W000000VJ28QAG.png

This topic has been closed for replies.
TDK
TDKBest answer

The Value for receiveData is the address of the array, not the values within the array.

It has 7 elements, which matches the definition. The first element is index 0.

"If you feel a post has answered your question, please click ""Accept as Solution""."

6 replies

TDK
TDKBest answer

The Value for receiveData is the address of the array, not the values within the array.

It has 7 elements, which matches the definition. The first element is index 0.

"If you feel a post has answered your question, please click ""Accept as Solution""."
A.D.
A.D.Author
Associate III

Oh right, it is the address, that makes sense.

But still, under "details" it does show only 6 elements, not 7.

TDK

Looks like it's interpreting it as a string and leaving off the terminating null character, but including null characters "within" the string. Who knows.

"If you feel a post has answered your question, please click ""Accept as Solution""."
A.D.
A.D.Author
Associate III

I guess that makes sense. OK, thanks for the quick answers!

Breno Nascimento Santos
Associate II

help some project on git u-blox NUCLEO-64 STM32L476RG

Breno Nascimento Santos
Associate II

some project on git u-blox NUCLEO-64 STM32L476RG