Skip to main content
Associate
February 25, 2026
Solved

how to view debug variables in hex (VSCode with STM32CubeIDE extension)

  • February 25, 2026
  • 3 replies
  • 475 views

There does not seem to be any way of viewing a debug variable in hex.
The closest workaround is to prefix (void*) before the expression in the watch window. 
This is no good for viewing an array of hex digits like for example a CAN bus message.

Best answer by Florent V

Hi @Michael_John

You can add the following attribute to your debug configuration:

"preRunCommands": [
 "set output 16"
],

 

Best Regards,
/Flo

3 replies

Florent V
Florent VBest answer
ST Employee
February 25, 2026

Hi @Michael_John

You can add the following attribute to your debug configuration:

"preRunCommands": [
 "set output 16"
],

 

Best Regards,
/Flo

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Associate
February 26, 2026

Hi Forent
Thank you, that works nicely.
I see you have already marked your own answer as accepted.
Thank you for your response

Explorer
April 19, 2026

Worked! Thanks!!