Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a prefix for returned messages from the micro? #4

Closed
amcewen opened this issue Jan 18, 2023 · 2 comments
Closed

Allow a prefix for returned messages from the micro? #4

amcewen opened this issue Jan 18, 2023 · 2 comments

Comments

@amcewen
Copy link

amcewen commented Jan 18, 2023

At present the serial comms protocol assumes that all incoming messages are responses to step requests.

That means that any boot messages or debug output gets interpreted as step responses. It seems the easiest approach would be to add a prefix to any genuine messages with a known value, so the wire-servercould ignore anything else.

Might be handy to have a command-line option to either discard, or print out, any "ignored" lines, so that debug info during the test runs could be optionally seen.

That would also let us get rid of the extra serial port requirement for the esp32-rpc-server example.

@amcewen
Copy link
Author

amcewen commented Jun 21, 2023

Rather than a prefix, we should allow the platform-native logging. That gets round any issues with multi-threaded environments, as the logging is (usually) done in a separate thread.

Having the Cucumber response messages come from a cucumber module would make it easiest to avoid clashes, and logging them as "errors" will allow the minimum of logging levels.

For Zephyr (nrf91, nrf52) that would mean a match like <err> cucumber: (\-?\d+).

For ESP32 it'd be a match like E \(\d+\) cucumber: (\-?\d+).

Maybe (at least until other platforms are supported) we just match on cucumber: (\-?\d+)?

amcewen pushed a commit that referenced this issue Jun 25, 2023
* ESP32 version now defaults to the built-in UART rather than a separate one
* Wire-server also handles weird characters generated by nrf91/Zephyr/MCUboot after the device is programmed
@amcewen
Copy link
Author

amcewen commented Jun 25, 2023

Done. Just matches on cucumber: (\-?\d+) which works for both Zephyr (nrf91) and ESP32. ESP32 code switched to use the default UART too, now that it handles log messages being interleaved.

The wire-server prints out any lines it doesn't recognise, so logging messages from the micro will show up in its output; and also filters out any "strange" characters—sometimes Zephyr/nrf91/MCUboot would output some non-UTF-8 characters which confused Ruby otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant