-
Notifications
You must be signed in to change notification settings - Fork 3k
Add config option for stdio baud rate #1988
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
Conversation
The same conversation that you mention explains why the default baud rate is a better fit for a target configuration parameter. |
Oh, I think I follow. So would the appropriate default mirror |
|
I added support for a device provided |
|
This seems over complicated. There should be a single stdio_uart_baudrate which is default to 9600 and the application can override this or be old skool and just initialize an object in the application and use the baudrate member. It should not be defined or overridable by a target rather the application. This is a platform (ie: mbed) configuration, not a target configuration. We can then clean this all up too :) https://github.com/mbedmicro/mbed/search?utf8=%E2%9C%93&q=serial_baud%28obj%2C+9600&type=Code We dont need STDIO_UART_BAUD_RATE and MBED_CONF_CORE_STDIO_BAUD_RATE |
Agreed. Let me repeat what I already said in #1969 here: sometimes, the default baud rate depends a lot on the target board, since it might not be able to support high baud rates due to a number of hardware limitations (either in the MCU UART implementation, the clock used for the UART or both). I actually hit this issue once, although not with a mbed board (but still with a board that used an ARM MCU). So, if you want your |
|
If the default is 9600 across boards, the expected immediate use here is that the applications that currently set baud to 115200 in their main.cpp (every mbed app I've ever worked on) will set it to 115200 in their JSON. (If the default was faster, the apps would just leave it alone.) At the minute the apps make the setting with an assumption that they're running on K64F (because they pass K64F pin assignments). But the point of the JSON is to make it generic - the apps would want to have it an all-target setting. If the baud rate is not supported, the board should ignore the setting and continue to use the default. |
|
-1 |
|
I'm going to go ahead and close this since it doesn't look like there's a clear way forward. This conversation can continue over here: #1969 |
@kjbracey-arm has a good write up for the motivation behind this addition: #1969
Adds
core.stdio-baud-rateconfiguration option. Defaults to 9600 for backwards compatibility.