cancel
Showing results for 
Search instead for 
Did you mean: 

Why uint8_t uint16_t shows negative when value more than 127 or 32767.

watchaphong
Associate

Hi Everyone
          I confuse about uint8_t or uint16_t on stm32cubeide. When going to debug mode the Live Expressions (tab bar) when I change format to decimal value it shows negative value if the value more than 127 for uint8_t and 32767 for uint16_t. It should be store value 0 to 255 or 0 to 65535 without sign. Is it correct?

Hex format

Hex Format.png

 

 

 

 

 

Dec format

Dec Format.png

Best regard
watchaphong

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The Live Expressions tab is buggy at best. Be happy that it's working at all.

It is interpreting the value as an integer instead of an unsigned integer. This is strictly an IDE display bug.

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

View solution in original post

2 REPLIES 2
TDK
Guru

The Live Expressions tab is buggy at best. Be happy that it's working at all.

It is interpreting the value as an integer instead of an unsigned integer. This is strictly an IDE display bug.

If you feel a post has answered your question, please click "Accept as Solution".
STTwo-32
ST Employee

Hello @watchaphong and welcome to the ST Community 😊.

Thank you so much for reporting this. I've been able to reproduce the issue and I will report it to the concerned team for correction.

An internal Ticket 175153 is created for the tracking of this bug.

(PS: Ticket 175153 is an internal tracking number, not accessible by customers and usable for internal tracking).

Thank you again for reporting.

Best Regards.

STTwo-32 

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.