How to interpret the "Expressions" of Arrays in Debug mode of CubeIDE?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-03 8:16 AM
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?
Solved! Go to Solution.
- Labels:
-
DEBUG
-
STM32CubeIDE
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-03 8:41 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-03 8:41 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-03 8:46 AM
Oh right, it is the address, that makes sense.
But still, under "details" it does show only 6 elements, not 7.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-03 8:48 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-03 9:46 AM
I guess that makes sense. OK, thanks for the quick answers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-03 1:01 PM
help some project on git u-blox NUCLEO-64 STM32L476RG
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-03 1:02 PM
some project on git u-blox NUCLEO-64 STM32L476RG
