Skip to content

Migrate nRF52840-DK to Arduino Uno pin names #14960

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
wants to merge 2 commits into from

Conversation

boraozgen
Copy link
Contributor

Summary of changes

Updates the pin names and removes the migration warning.

Impact of changes

Migration actions required

Documentation

None.


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

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

Reviewers


Patater
Patater previously approved these changes Jul 27, 2021
Copy link
Contributor

@Patater Patater left a comment

Choose a reason for hiding this comment

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

Could do with a long description in the commit message. Otherwise, LGTM

@mergify mergify bot added the needs: work label Jul 27, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 28, 2021

Please review travis failing pin validation

@boraozgen
Copy link
Contributor Author

Well it fails with the old version too :) I think it has to do with how Nordic defines the pins, is gives errors like:

LED1 = p13 <-- legacy assignment; LEDs and BUTTONs must be #define'd
or
ARDUINO_UNO_A0 <-- ARDUINO_UNO_A0 not defined

when the script is run with -vvv.

What is the Nordic maintainer situation?

@boraozgen
Copy link
Contributor Author

Fixed it. Moved some pins to #define from enum as required. Had to remove some whitespaces since the regex in the validation tool is pretty strict about it :)

@mergify mergify bot dismissed Patater’s stale review July 28, 2021 15:03

Pull request has been modified.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

second commit - can you add nRF52840-DK: prefix there.

Test passed so this hsould be ready for CI

@boraozgen boraozgen force-pushed the nrf52840-dk-pin-names branch from 5c6894b to 665d4e7 Compare July 29, 2021 14:29
@boraozgen
Copy link
Contributor Author

Done

0xc0170
0xc0170 previously approved these changes Jul 30, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 30, 2021

CI started

@mbed-ci
Copy link

mbed-ci commented Jul 30, 2021

Jenkins CI Test : ❌ FAILED

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

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-GCC_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-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-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test

@mbed-ci
Copy link

mbed-ci commented Jul 30, 2021

Jenkins CI Test : ❌ FAILED

Build Number: 1 | 🔒 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-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-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-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test

@mergify mergify bot added needs: work and removed needs: CI labels Jul 30, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 30, 2021

Pinmap test case failed, please review

@boraozgen
Copy link
Contributor Author

boraozgen commented Jul 30, 2021

For convenience, this is the failing test case:

int console_uart = pinmap_peripheral(CONSOLE_TX, serial_tx_pinmap());
TEST_ASSERT_NOT_EQUAL(console_uart, pinmap_peripheral(TX_pin, serial_tx_pinmap()));

This case is bound to fail on Nordic boards as the peripherals can be muxed arbitrarily and serial_tx_pinmap of Nordic returns a dummy pinmap:

const PinMap *serial_tx_pinmap()
{
return PinMap_UART_testing;
}

How should we proceed?

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 2, 2021

@gpsimenos can you review please?

gpsimenos
gpsimenos previously approved these changes Aug 2, 2021
Copy link
Contributor

@gpsimenos gpsimenos left a comment

Choose a reason for hiding this comment

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

LGTM, I believe it's OK to ignore the failing test case.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 2, 2021

LGTM, I believe it's OK to ignore the failing test case.

This would start failing in our CI. Nordic pinmaping is valid so our test case should either consider this or we shall update testing pinmap set for Nordic to not be the same - I've noticed their uart pinmap is basically pXX, 0, 0 - if we set console uart to be non zero, would that fix the error ?

@ciarmcom
Copy link
Member

This pull request has automatically been marked as stale because it has had no recent activity. @boraozgen, please carry out any necessary work to get the changes merged. Thank you for your contributions.

@ciarmcom ciarmcom added the stale Stale Pull Request label Aug 11, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 12, 2021

@gpsimenos What else can we do with the test, nordic pinmap features seems to break the test (this is valid use case), so we should review the tests.

@ciarmcom ciarmcom added stale Stale Pull Request and removed stale Stale Pull Request labels Aug 13, 2021
@ciarmcom ciarmcom added stale Stale Pull Request and removed stale Stale Pull Request labels Aug 20, 2021
@mergify mergify bot added needs: work and removed needs: work labels Oct 4, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Oct 4, 2021

I can see, checking what is causing this labeling :(

Adapted the file to the latest pin naming guidelines.
pinvalidate.py passes.
@boraozgen boraozgen force-pushed the nrf52840-dk-pin-names branch from 665d4e7 to c77c85c Compare October 5, 2021 06:58
@mergify mergify bot dismissed stale reviews from 0xc0170 and gpsimenos October 5, 2021 06:59

Pull request has been modified.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 5, 2021

CI started

@mergify mergify bot added needs: CI and removed needs: review labels Oct 5, 2021
@mbed-ci
Copy link

mbed-ci commented Oct 5, 2021

Jenkins CI Test : ❌ FAILED

Build Number: 3 | 🔒 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-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_cmake-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test

@mergify mergify bot added needs: work and removed needs: CI labels Oct 5, 2021
@boraozgen
Copy link
Contributor Author

boraozgen commented Oct 5, 2021

A similar issue seems to apply to the I2C test too :/

Failing test for convenience:

Edit: logs extract

[1633426311.97][CONN][RXD] >>> Running case #36: 'I2C'...
[1633426311.97][CONN][RXD] I2C SDA Pin 0x1a SCL Pin 0x1b
[1633426311.97][CONN][INF] found KV pair in stream: {{__testcase_start;I2C}}, queued...
mbedgt: :184::FAIL: Expected Not-Equal
[1633426312.03][CONN][RXD] :184::FAIL: Expected Not-Equal
[1633426312.03][CONN][INF] found KV pair in stream: {{__testcase_finish;I2C;0;1}}, queued...
[1633426312.20][CONN][RXD] >>> 'I2C': 0 passed, 1 failed with reason 'Assertion Failed'

Failing line:

TEST_ASSERT_NOT_EQUAL(NC, maps->pin);

@jeromecoutant
Copy link
Collaborator

A similar issue seems to apply to the I2C test too :/

Test is checking if the default I2C pins are in the I2C pin tables

@boraozgen
Copy link
Contributor Author

boraozgen commented Oct 5, 2021

Again, dummy pinmap is returned, which causes the fail:

const PinMap *i2c_master_sda_pinmap()
{
return PinMap_I2C_testing;
}
const PinMap *i2c_master_scl_pinmap()
{
return PinMap_I2C_testing;
}

@jeromecoutant
Copy link
Collaborator

ARDUINO_UNO_D14 = p26,
ARDUINO_UNO_D15 = p27,

But why these pins are not part of PinMap_I2C_testing ???

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 9, 2022

If we add these two to the testing pinmaps?

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 8, 2022

I'll close this pull request. Please reopen with an update or add an issue to keep track of this.

@0xc0170 0xc0170 closed this Mar 8, 2022
@mergify mergify bot removed the needs: work label Mar 8, 2022
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.

7 participants