2017-09-14 11:53 AM
I am working on a project where I have to send characters such as 0x00, 0x01, 0x09, 0x13 and such to a display device. It wasn't doing what I expect, so I connected the UART output to a terminal to suss out why.
I can send a string (thousands of times it now seems) of 'This is UART 1\n\r' through this UART with no problem. When I try to send a string consisting of non-readable characters: 01 09 00 00 64 6C ix converted to 0964 6c 0d 0a. First of all, what happened to the 01? That's the command code. The two zeros are dropped as well, and those are parameters. And where did the 0a 0d come from? I thought HAL_UART_Transmit took a UART handle, a string pointer, a count, and a timeout. No mention of filtering and adding characters.
Is there another function I should be using? A different mode?2017-09-14 11:57 AM
Likely your terminal, use something like RealTerm in HEX mode. HAL_UART_Transmit() doesn't molest the data, but things like strlen()/strcpy()/printf() are clearly inadvisable.
2017-09-14 02:20 PM
Good on you for teaching me a new tool. Thanks. RealTerm indeed shows that I am send 00 and 01 OK. At least I can get beyond THIS WTF moment.
2018-03-07 08:35 PM
You question is done? Why don't you close your question?
2018-03-07 10:31 PM
See it is not entirely necessary to do so, as the two participants understood that the interaction was sufficiently complete.