Skip to content

Update UART pin names & add MBED_CONF_TARGET_STDIO_UART overrides #14457

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

Merged
merged 6 commits into from
Mar 26, 2021

Conversation

gpsimenos
Copy link
Contributor

@gpsimenos gpsimenos commented Mar 23, 2021

Summary of changes

This PR updates instances of USBTX and USBRX to CONSOLE_TX and CONSOLE_RX respectively, as the names of the UART pins used for console in Mbed boards.

All targets are also updated to support overriding the default CONSOLE_TX and CONSOLE_RX pin using the MBED_CONF_TARGET_STDIO_UART_TX and MBED_CONF_TARGET_STDIO_UART_RX options in mbed_app.json.

Impact of changes

No impact expected from application point of view. Legacy aliases are in place for now.

Migration actions required

Documentation


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Verified compliance with pinvalidate tool. Some targets did not have USBTX/RX defined and consequently also do not have CONSOLE_TX/RX: S5JS100, S1SBP6A, ARM_MUSCA_B1, ARM_MUSCA_S1.

Travis is expected to fail the pinvalidate test because this PR modifies a lot of PinNames.h files which have not been migrated to the new standard yet.


Reviewers


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Mar 23, 2021
@ciarmcom ciarmcom requested a review from a team March 23, 2021 11:30
@ciarmcom
Copy link
Member

@gpsimenos, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@jeromecoutant
Copy link
Collaborator

jeromecoutant commented Mar 23, 2021

Note that pinvalidate script has not been executed...

@MarceloSalazar

edit: I see there are 2 Travis CI now:

  • on Travis CI Branch: pinvalidate script has not been executed
  • on Travis CI Pull Request: pinvalidate script has been executed and failed...

Copy link
Collaborator

@jeromecoutant jeromecoutant left a comment

Choose a reason for hiding this comment

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

This doesn't compile:

$ mbed test --compile -m NUCLEO_L552ZE_Q -t ARM -n drivers-tests-tests-mbed_drivers-echo
[Error] mbed_pinmap_default.cpp@73,9: use of undeclared identifier 'USBTX'
[Error] mbed_pinmap_default.cpp@73,21: use of undeclared identifier 'USBRX'

@jeromecoutant
Copy link
Collaborator

Suggestion::

$ git diff hal/include/hal/PinNameAliases.h

/* Aliases for legacy reasons. To be removed in the next Mbed OS version */
-#if defined (CONSOLE_TX) && (CONSOLE_RX)
#define USBTX CONSOLE_TX
#define USBRX CONSOLE_RX
-#else
-#define CONSOLE_TX USBTX
-#define CONSOLE_RX USBRX
-#endif

@jeromecoutant
Copy link
Collaborator

Another comment: "git grep USBTX" still has some results...

Suggestion: update pinvalidate.py script, and set test as failed if USBTX is used

@gpsimenos
Copy link
Contributor Author

The pinvalidate tool is already updated to fail targets that don't use CONSOLE_TX/CONSOLE_RX.

Travis is expected to fail the pinvalidate test because this PR modifies a lot of PinNames.h files which are not yet compliant.

@gpsimenos
Copy link
Contributor Author

Suggestion::

$ git diff hal/include/hal/PinNameAliases.h

/* Aliases for legacy reasons. To be removed in the next Mbed OS version */
-#if defined (CONSOLE_TX) && (CONSOLE_RX)
#define USBTX CONSOLE_TX
#define USBRX CONSOLE_RX
-#else
-#define CONSOLE_TX USBTX
-#define CONSOLE_RX USBRX
-#endif

Applied!

@jeromecoutant
Copy link
Collaborator

Another comment: "git grep USBTX" still has some results...

Did you check this ?

@gpsimenos
Copy link
Contributor Author

Another comment: "git grep USBTX" still has some results...

Did you check this ?

Done!

Copy link
Collaborator

@jeromecoutant jeromecoutant left a comment

Choose a reason for hiding this comment

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

Let's start CI in order to check build ?

@gpsimenos
Copy link
Contributor Author

@adbridge Let's start CI

@gpsimenos
Copy link
Contributor Author

This doesn't compile:

$ mbed test --compile -m NUCLEO_L552ZE_Q -t ARM -n drivers-tests-tests-mbed_drivers-echo
[Error] mbed_pinmap_default.cpp@73,9: use of undeclared identifier 'USBTX'
[Error] mbed_pinmap_default.cpp@73,21: use of undeclared identifier 'USBRX'

Now compiles after suggestion above applied.

@adbridge
Copy link
Contributor

CI started

@adbridge
Copy link
Contributor

@gpsimenos looks like lots of failures...

@mbed-ci
Copy link

mbed-ci commented Mar 25, 2021

Jenkins CI Test : ❌ FAILED

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_build-greentea-ARM
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM
jenkins-ci/mbed-os-ci_cmake-example-ARM
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM
jenkins-ci/mbed-os-ci_build-example-ARM

@gpsimenos
Copy link
Contributor Author

Let's retry, all targets should now build!

@mbed-ci
Copy link

mbed-ci commented Mar 25, 2021

Jenkins CI Test : ✔️ SUCCESS

Build Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_tfm-integration ✔️

@gpsimenos
Copy link
Contributor Author

gpsimenos commented Mar 26, 2021

@adbridge Let's merge!

Copy link
Contributor

@adbridge adbridge left a comment

Choose a reason for hiding this comment

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

Subject to fixing the travis failures

@gpsimenos
Copy link
Contributor Author

Travis is expected to fail the pinvalidate test because this PR modifies a lot of PinNames.h files which are not yet compliant :)

@adbridge adbridge merged commit 0742135 into master Mar 26, 2021
facchinm added a commit to arduino/ArduinoCore-mbed that referenced this pull request Apr 6, 2021
There's no easy way to understand if ARMmbed/mbed-os#14457 has been applied or not in the tree we are compiling
@mbedmain mbedmain removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Apr 26, 2021
@0xc0170 0xc0170 deleted the uart-stdio-alias branch October 7, 2021 13:52
sebromero pushed a commit to sebromero/ArduinoCore-mbed that referenced this pull request Feb 2, 2022
There's no easy way to understand if ARMmbed/mbed-os#14457 has been applied or not in the tree we are compiling
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.

7 participants