Skip to content

Please update mbed-os to have stdio baud rate configurable #2396

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

Closed
markus-becker-tridonic-com opened this issue Aug 9, 2016 · 5 comments
Closed

Comments

@markus-becker-tridonic-com

Moved from ARMmbed/mbed-os-example-blinky#23

@markus-becker-tridonic-com
Copy link
Author

Small a example as requested:

main.cpp:

#include "mbed.h"

#define HAVE_DEBUG 1
#include "mbed-trace/mbed_trace.h"
//#include "mbed-client-libservice/ns_trace.h"
#define TRACE_GROUP "stdio"

Serial output(USBTX, USBRX);

int main() {
    //output.baud(115200); // with or without
    output.printf("output.printf()\n");
    printf("printf\n");

    mbed_trace_init();
    tr_debug("tr_debug\n");

    output.printf("output.printf()2\n");
    printf("printf2\n");
}

mbed_app.json

{
    "config": {
        "core": {
            "stdio-baud-rate": 115200 // with or without
        }
    },
    "target_overrides": {
        "*": {
            "target.features_add": ["COMMON_PAL"],
            "mbed-trace.enable": 1
        }
    }
}

@markus-becker-tridonic-com
Copy link
Author

markus-becker-tridonic-com commented Aug 9, 2016

Results in:

BAD:

  • Without output.baudrate(115200)
  • With config core stdio-baud-rate 115200
  • Terminal configured for 9600
output.printf()<\n>
printf<\n>
<\r><27>[2K<27>[90m[DBG ][stdio]: tr_debug<\n>
<27>[0m<\n>
output.printf()2<\n>
printf2<\n>

--> Should be terminal configured for 115200.

GOOD:

  • With output.baudrate(115200)
  • With config core stdio-baud-rate 115200
  • Terminal configured for 115200
output.printf()<\n>
printf<\n>
<\r><27>[2K<27>[90m[DBG ][stdio]: tr_debug<\n>
<27>[0m<\n>
output.printf()2<\n>
printf2<\n>

GOOD:

  • With output.baudrate(115200)
  • Without config core stdio-baud-rate 115200
  • Terminal configured for 115200
output.printf()<\n>
printf<\n>
<\r><27>[2K<27>[90m[DBG ][stdio]: tr_debug<\n>
<27>[0m<\n>
output.printf()2<\n>
printf2<\n>

GOOD:

  • Without output.baudrate(115200)
  • Without config core stdio-baud-rate 115200
  • Terminal configured for 9600
output.printf()<\n>
printf<\n>
<\r><27>[2K<27>[90m[DBG ][stdio]: tr_debug<\n>
<27>[0m<\n>
output.printf()2<\n>
printf2<\n>

@markus-becker-tridonic-com
Copy link
Author

Additionally when debugging mbed-mesh-api you get mixed 9600 and 115200 output.

bogdanm pushed a commit that referenced this issue Aug 9, 2016
This commit changes the default baud of a new `Serial` or `SerialBase`
instance to the one defined by the core configuration
(`MBED_CONF_CORE_STDIO_BAUD_RATE`). This should ensure a consistent
behaviour of newly created `Serial` objects across all platforms.

Related to #2396.
@markus-becker-tridonic-com
Copy link
Author

@MarceloSalazar

@sg-
Copy link
Contributor

sg- commented Aug 26, 2016

Should be resolved.

@sg- sg- closed this as completed Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants