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

Added a baud argument for (Raw)Serial objects #2422

Merged
merged 1 commit into from
Oct 4, 2016
Merged

Conversation

bogdanm
Copy link
Contributor

@bogdanm bogdanm commented Aug 11, 2016

This commit adds a baud argument for Serial and RawSerial objects:

  • there is a new Serial constructor with a mandatory baud rate
    argument. The old constructor also got a baud argument with a
    default value (to keep backward compatibility).
  • the RawSerial constructor also got a baud argument with a default
    value.

There's also a new configuration parameter (default-serial-baud-rate)
that can be used to specify the default value of the above baud
arguments.

@bogdanm
Copy link
Contributor Author

bogdanm commented Aug 11, 2016

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=GCC_ARM
TARGETS=K64F,NRF51_DK,NRF51_MICROBIT,NUCLEO_F411RE

@bogdanm
Copy link
Contributor Author

bogdanm commented Aug 11, 2016

/morph test

@bogdanm
Copy link
Contributor Author

bogdanm commented Aug 11, 2016

@0xc0170 @sg-

@mbed-bot
Copy link

[Build ${MBED_BUILD_ID}]
FAILURE: Something went wrong when building and testing.

@bogdanm
Copy link
Contributor Author

bogdanm commented Aug 11, 2016

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=GCC_ARM
TARGETS=K64F,NRF51_DK,NRF51_MICROBIT,NUCLEO_F411RE

@mbed-bot
Copy link

[Build 798]
FAILURE: Something went wrong when building and testing.

@bogdanm
Copy link
Contributor Author

bogdanm commented Aug 11, 2016

This failed because of configuration data issues, again. PR coming up.

@bogdanm
Copy link
Contributor Author

bogdanm commented Aug 11, 2016

Will progress once #2423 is merged.

@bogdanm
Copy link
Contributor Author

bogdanm commented Aug 11, 2016

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=GCC_ARM
TARGETS=K64F,NRF51_DK,NRF51_MICROBIT,NUCLEO_F411RE

@bogdanm
Copy link
Contributor Author

bogdanm commented Aug 11, 2016

/morph test

@mbed-bot
Copy link

[Build 800]
FAILURE: Something went wrong when building and testing.

@bridadan
Copy link
Contributor

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM
TARGETS=K64F,NRF51_DK,NRF51_MICROBIT,NUCLEO_F411RE

@bridadan
Copy link
Contributor

You should be added now @bogdanm to the morph bot, sorry about that.

/morph test

@mbed-bot
Copy link

[Build 801]
FAILURE: Something went wrong when building and testing.

@bogdanm
Copy link
Contributor Author

bogdanm commented Aug 11, 2016

Thanks @bridadan.
The failures in this PR are actually config system failures. I'll open a separate issue to discuss this, since it's quite interesting. But anyway, please don't merge yet.

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 632

Build failed!

@sg-
Copy link
Contributor

sg- commented Sep 28, 2016

@bogdanm Are the issues with config resolved? If not can this be updated to just use 9600 as default?

@bogdanm
Copy link
Contributor Author

bogdanm commented Sep 28, 2016

@sg- I've rebased this PR and force-pushed the changes. Let's see if the CI still complains about it.

@bogdanm
Copy link
Contributor Author

bogdanm commented Sep 28, 2016

The failure from https://travis-ci.org/ARMmbed/mbed-os/builds/163444683 is very likely related to some limitations in make.py, not to the code in this PR. @bridadan, do you have any advice on how to fix this?

@bridadan
Copy link
Contributor

@bogdanm Can you be a little more specific on what you mean by "limitations"? It looks like the config parameter isn't being declared as a macro correctly.

@bogdanm
Copy link
Contributor Author

bogdanm commented Sep 28, 2016

@bridadan True, but only when invoking make.py. build.py seems to work without issues.

@bridadan
Copy link
Contributor

It's possible that the config isn't propagating correctly because that particular line travis is testing uses some of the old ways of compiling mbed 2 tests. You should be able to reproduce the failure fairly easily locally: python tools/make.py -m LPC1768 -t GCC_ARM -c --silent -n MBED_2,MBED_10,MBED_11,MBED_15,MBED_16,MBED_17

@bogdanm
Copy link
Contributor Author

bogdanm commented Sep 28, 2016

@bridadan That's the limitation that I'm talking about. The problem isn't reproducing the failure locally, but rather that I'm getting an error from the CI when the code is actually correct.

@bridadan
Copy link
Contributor

@bogdanm Gotcha, thanks for clarifying. I'd have to take a look at what exactly isn't being passed along. Not sure if I'll get to it today but I'll add it to my list. I have a feeling the culprit lies in the call to build_project.

@bridadan
Copy link
Contributor

@bogdanm I think I found the cause of the issue: #2868

Need to get some feedback first though before it gets merged!

@bogdanm
Copy link
Contributor Author

bogdanm commented Oct 3, 2016

Rebased again.

@bogdanm
Copy link
Contributor Author

bogdanm commented Oct 3, 2016

@bridadan, the CI shows the same error, although now I can see the configuration file in .build/mbed/TARGET_K64F/mbed_lib.json. Maybe it's copied too late?

@bridadan
Copy link
Contributor

bridadan commented Oct 3, 2016

@bogdanm I think the actual issue is that the mbed_lib.json that contains the RawSerial config is living in the platform "library" now instead of core. So the macro name is now MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE instead of MBED_CONF_CORE_DEFAULT_SERIAL_BAUD_RATE.

This commit adds a `baud` argument for Serial and RawSerial objects:

- there is a new `Serial` constructor with a mandatory baud rate
  argument. The old constructor also got a `baud` argument with a
  default value (to keep backward compatibility).
- the `RawSerial` constructor also got a `baud` argument with a default
  value.

There's also a new configuration parameter (`default-serial-baud-rate`)
that can be used to specify the default value of the above `baud`
arguments.
@bogdanm
Copy link
Contributor Author

bogdanm commented Oct 3, 2016

Ah thanks, I didn't realize that we changed the name of the library. Fixed.

@bridadan
Copy link
Contributor

bridadan commented Oct 3, 2016

/morph test

@mbed-bot
Copy link

mbed-bot commented Oct 3, 2016

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1039

All builds and test passed!

@sg- sg- merged commit 2e42d22 into master Oct 4, 2016
@bogdanm bogdanm deleted the new_serial_constructors branch October 18, 2016 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants