UART 0xC3 or 0xC2 byte concatenated to byte greater than 0x80
CompletedI have a test setup with the PLT breakout board connected to the PLT. I created a test plan to send 8-bit numbers via UART1 and currently flywired UART1 TX to RX on the breakout board to echo the message. However, I found the PLT generates this 0xC2 or 0xC3 byte and concatenates it to before the byte that I wanted to send. The byte that is sent is also incorrect. This only occurs when trying to send a byte >= 0x80. See the test plan below and capture of a signal analyzer that I am using. Any bytes <= 0x7F are correct but >= 0x80, they are incorrect (0xF0 becomes 0xC3 0xB0, 0x80 becomes 0xC2 0x80).
---
title: UART_TEST
suite:
- title: UART 1 Interaction
steps:
- command: define STRING "test"
- command: uartCfg UART1 115200
- uartcmd: uart UART1
extract: "(.*)"
extractKey: STRING
send: "\xf0\xe0\x90\x80\x7f\x60\x40\x01"
retry: 3
timeout: 2000
- command: operator "Confirm result %STRING%"
-
Derek Cao We've looked into this issue. There is a text encoding issue that limits what values can be used directly in commands like this. We're incorporating a fix in our next release of PLT-OS, which we expect to ship this week.
-
Derek Cao We've just released PLT-OS v1.9.10. It includes a new feature to address this issue.
The new feature is a new `eval "bytes()"` command that allows for the creation of strings from arbitrary bytes. These strings can be used anywhere in the test plan.
Here's how to use the new command to send the bytes that were previously impossible:
- command: eval "bytes(0xf0, 0xe0, 0x90, 0x80, 0x7f, 0x60, 0x40, 0x01)"
extractKey: BYTES
- uartcmd: uart UART1
extract: "(.*)"
extractKey: STRING
send: "%BYTES%"In order to update to PLT-OS 1.9.10:
- On PLTCloud, navigate to your Project settings.
- Change the PLT-OS version to "v1.9.x (Experimental)"
- Click the "Change" button and save changes.
- On your PLT, press the "Menu" button, then scroll to "Check for Updates" in order to update to 1.9.10.
-
Jeremy Wood I have updated my PLT to PLT-OS v1.9.10 however I am unable to try the new command. When using any UART interaction command, the PLT outputs an "unknown port UART1" error. Reverting to PLT-OS v1.8.16 solves this issue but does not allow the use of the `eval "bytes()"` command.
- command: eval "bytes(0x80)"
extractKey: BYTES
- command: uartCfg UART1 115200
- uartcmd: uart UART1
extract: "(.*)"
extractKey: STRING
send: "%BYTES%"
retry: 3 -
Derek Cao Thank you for reporting this issue, we'll investigate!
-
Derek Cao I was able to reproduce this and find the issue. We've just released PLT-OS v1.9.11, which fixes it.
Thanks again for reporting this!
Please sign in to leave a comment.
Comments
8 comments