See bytes 13 and 14.
Appears to be wrong if byte 13 or 14 values exceed 15 (0xF).
I am actually using this in uart.write(bytearray(message)) where the output on uart port is OK as expected , irrispective of byte 13 or 14 value..
But a print(bytearray(message)) produces the strange output for bytes 13 and 14.
Same strange behavior is observed in immediate REPL mode.
Have not looked at other bytes.
Development is on STM32F407 Discovery, fairly recent firmware.
>>> message
[1, 16, 0, 0, 0, 3, 6, 0, 6, 0, 2, 0, 3, 143, 65]
>>> bytearray(message)
bytearray(b'\x01\x10\x00\x00\x00\x03\x06\x00\x06\x00\x02\x00\x03\x8fA')
>>> message[13]=5
>>> bytearray(message)
bytearray(b'\x01\x10\x00\x00\x00\x03\x06\x00\x06\x00\x02\x00\x03\x05A')
>>> message[14]=6
>>> bytearray(message)
bytearray(b'\x01\x10\x00\x00\x00\x03\x06\x00\x06\x00\x02\x00\x03\x05\x06')
>>> message[13]=96
>>> bytearray(message)
bytearray(b'\x01\x10\x00\x00\x00\x03\x06\x00\x06\x00\x02\x00\x03`\x06')
>>> message
[1, 16, 0, 0, 0, 3, 6, 0, 6, 0, 2, 0, 3, 96, 6]
>>> bytearray(message)
bytearray(b'\x01\x10\x00\x00\x00\x03\x06\x00\x06\x00\x02\x00\x03`\x06')
>>>