Skip to content

Add Mbed trace support #31

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add Mbed trace support #31

wants to merge 3 commits into from

Conversation

pan-
Copy link
Member

@pan- pan- commented Jan 7, 2021

This PR adds support for mbed trace in ble-cliapp and the appropriate filters in the test runtime.
Please review, we can merge when the trace branch on Mbed OS has been merged.

@pan- pan- requested review from paul-szczepanek-arm and a user January 7, 2021 12:27
@pan-
Copy link
Member Author

pan- commented Jan 15, 2021

@paul-szczepanek-arm Please review

@@ -95,8 +95,9 @@ def _input_thread(self):
log.warning('{}: Invalid bytes read: {}'.format(self.name, line))
continue
plain_line.rstrip()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, that looks like a nop

@@ -25,7 +25,8 @@
"target.printf_lib": "std",
"platform.stdio-flush-at-exit": false,
"platform.stdio-baud-rate": 115200,
"cordio.desired-att-mtu": 80
"cordio.desired-att-mtu": 80,
"mbed-trace.enable": null

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why null?

Comment on lines +189 to +205
mbed_trace_init();
mbed_trace_prefix_function_set([](size_t) {
// This is the prefix added before any trace, the new line is used to
// ensure the trace is not rendered inside a line containing a json
// payload. The test tool filter out traces based on this pattern.
static char prefix[] = "\n~~~";
return prefix;
});
mbed_trace_print_function_set([](const char* str) {
get_serial().write(str, strlen(str));
// Note: line return in mbed_trace somehow doesn't work if color support
// is deactivated.
get_serial().write("\n", 1);
});
// Disable color support and carriage return support
mbed_trace_config_set(TRACE_ACTIVE_LEVEL_ALL);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be in #if MBED_CONF_MBED_TRACE_ENABLE

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

Successfully merging this pull request may close these issues.

2 participants