-
Notifications
You must be signed in to change notification settings - Fork 33
Add nrf52840dk #32
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
Add nrf52840dk #32
Conversation
d0697ca
to
e1a4b24
Compare
I think you need to merge the dev branch onto this branch rather than rebase... |
e1a4b24
to
f8e21be
Compare
@DhruvaG2000 Sorry about that, I've cleaned up the PR. |
I don't really have the hardware to test this PR, but if it builds and works on your end I don't see any issues. |
f8e21be
to
b3a7ada
Compare
@DhruvaG2000 will you please review and approve this PR? Notes below, thanks! Add nrf52840dk (this PR)I have added i2c support and tested the nrf52840dk_nrf52840 and found it is working. This PR now represents all changes necessary to add that board as a variant. New branch: Add mimxrt1060_evkb (not in this PR)The mimxrt1060_evkb is not working in tests (scanning for i2c address returns a device on every address). The changes to add that board have been moved to a different branch so that this PR can be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
running checkpatch.pl
produces many warnings and errors, kindly fix them if possible:
└─❯ ./scripts/checkpatch.pl patches/0001-variants-add-nrf52840dk.patch
patches/0001-variants-add-nrf52840dk.patch:75: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#75: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:20:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d4_gpios);$
patches/0001-variants-add-nrf52840dk.patch:77: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#77: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:22:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d5_gpios);$
patches/0001-variants-add-nrf52840dk.patch:79: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#79: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:24:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d6_gpios);$
patches/0001-variants-add-nrf52840dk.patch:81: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#81: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:26:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d7_gpios);$
patches/0001-variants-add-nrf52840dk.patch:83: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#83: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:28:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d8_gpios);$
patches/0001-variants-add-nrf52840dk.patch:85: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#85: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:30:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d9_gpios);$
patches/0001-variants-add-nrf52840dk.patch:87: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#87: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:32:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d10_gpios);$
patches/0001-variants-add-nrf52840dk.patch:89: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#89: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:34:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d11_gpios);$
patches/0001-variants-add-nrf52840dk.patch:91: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#91: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:36:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d12_gpios);$
patches/0001-variants-add-nrf52840dk.patch:93: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#93: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:38:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d13_gpios);$
patches/0001-variants-add-nrf52840dk.patch:95: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#95: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:40:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d13_gpios);$
patches/0001-variants-add-nrf52840dk.patch:97: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#97: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:42:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d15_gpios);$
patches/0001-variants-add-nrf52840dk.patch:99: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#99: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:44:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d16_gpios);$
patches/0001-variants-add-nrf52840dk.patch:101: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#101: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:46:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d17_gpios);$
patches/0001-variants-add-nrf52840dk.patch:103: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#103: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:48:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d18_gpios);$
patches/0001-variants-add-nrf52840dk.patch:105: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#105: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:50:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d19_gpios);$
patches/0001-variants-add-nrf52840dk.patch:107: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#107: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:52:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d20_gpios);$
patches/0001-variants-add-nrf52840dk.patch:109: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#109: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:54:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d21_gpios);$
patches/0001-variants-add-nrf52840dk.patch:111: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#111: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:56:
+ GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d22_gpios); /* LED0 */$
patches/0001-variants-add-nrf52840dk.patch:114: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#114: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:59:
+ &d0, &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10,$
patches/0001-variants-add-nrf52840dk.patch:115: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#115: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:60:
+ &d11, &d12, &d13, &d14, &d15, &d16, &d17, &d18, &d19, &d20, &d21,$
patches/0001-variants-add-nrf52840dk.patch:116: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#116: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:61:
+ &d22};$
patches/0001-variants-add-nrf52840dk.patch:119: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#119: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:64:
+ D0,$
patches/0001-variants-add-nrf52840dk.patch:120: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#120: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:65:
+ D1,$
patches/0001-variants-add-nrf52840dk.patch:121: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#121: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:66:
+ D2,$
patches/0001-variants-add-nrf52840dk.patch:122: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#122: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:67:
+ D3,$
patches/0001-variants-add-nrf52840dk.patch:123: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#123: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:68:
+ D4,$
patches/0001-variants-add-nrf52840dk.patch:124: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#124: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:69:
+ D5,$
patches/0001-variants-add-nrf52840dk.patch:125: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#125: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:70:
+ D6,$
patches/0001-variants-add-nrf52840dk.patch:126: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#126: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:71:
+ D7,$
patches/0001-variants-add-nrf52840dk.patch:127: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#127: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:72:
+ D8,$
patches/0001-variants-add-nrf52840dk.patch:128: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#128: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:73:
+ D9,$
patches/0001-variants-add-nrf52840dk.patch:129: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#129: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:74:
+ D10,$
patches/0001-variants-add-nrf52840dk.patch:130: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#130: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:75:
+ D11,$
patches/0001-variants-add-nrf52840dk.patch:131: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#131: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:76:
+ D12,$
patches/0001-variants-add-nrf52840dk.patch:132: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#132: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:77:
+ D13,$
patches/0001-variants-add-nrf52840dk.patch:133: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#133: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:78:
+ D14,$
patches/0001-variants-add-nrf52840dk.patch:134: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#134: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:79:
+ D15,$
patches/0001-variants-add-nrf52840dk.patch:135: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#135: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:80:
+ D16,$
patches/0001-variants-add-nrf52840dk.patch:136: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#136: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:81:
+ D17,$
patches/0001-variants-add-nrf52840dk.patch:137: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#137: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:82:
+ D18,$
patches/0001-variants-add-nrf52840dk.patch:138: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#138: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:83:
+ D19,$
patches/0001-variants-add-nrf52840dk.patch:139: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#139: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:84:
+ D20,$
patches/0001-variants-add-nrf52840dk.patch:140: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#140: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:85:
+ D21,$
patches/0001-variants-add-nrf52840dk.patch:141: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#141: FILE: variants/nrf52840dk_nrf52840/nrf52840dk_nrf52840_pinmap.h:86:
+ D22 /* LED0 */$
patches/0001-variants-add-nrf52840dk.patch:155: ERROR:C99_COMMENTS: do not use C99 // comments
#155: FILE: variants/variants.h:9:
+#endif // CONFIG_BOARD_ARDUINO_NANO_33_IOT
patches/0001-variants-add-nrf52840dk.patch:158: ERROR:C99_COMMENTS: do not use C99 // comments
#158: FILE: variants/variants.h:12:
+#endif // CONFIG_BOARD_NRF52840DK_NRF52840
patches/0001-variants-add-nrf52840dk.patch total: 2 errors, 45 warnings, 125 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
patches/0001-variants-add-nrf52840dk.patch has style problems, please review.
NOTE: Ignored message types: AVOID_EXTERNS BRACES C99_COMMENT_TOLERANCE COMPLEX_MACRO CONFIG_EXPERIMENTAL CONST_STRUCT DATE_TIME DT_SCHEMA_BINDING_PATCH DT_SPLIT_BINDING_PATCH ENOSYS FILE_PATH_CHANGES IS_ENABLED_CONFIG MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE PREFER_KERNEL_TYPES PREFER_SECTION PRINTK_WITHOUT_KERN_LEVEL REPEATED_WORD SPDX_LICENSE_TAG SPLIT_STRING TRAILING_SEMICOLON UNDOCUMENTED_DT_STRING VOLATILE
NOTE: If any of the errors are false positives, please report
them to the maintainers.
I know this project hasn't strictly followed coding guidelines so far, but I believe that it would be a good idea to start doing so from now.
@@ -0,0 +1,89 @@ | |||
/* | |||
* Copyright (c) 2022 Dhruva Gole |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the Copyright belongs to you @szczys ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-)
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* All the pins that are 100 + x are gpio1 pins and < 100 are in gpio0 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is a relevant comment anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed that. I also changed the pragma
to an #ifdef
which I think is the Zephry-preferred method for header includes.
bfa2e1d
to
92544ad
Compare
@DhruvaG2000 thanks for catching the checkpatch issues. I think I've fixed them, however I do still get 3 warnings. Do you know if these are problems that need fixing?
|
Imo we can safely ignore the SPDX warnings, because visually it LGTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built on my system locally, and also ran checkpatch again, ended up with fewer errors this time:
patches/0001-variants-add-nrf52840dk.patch:162: ERROR:C99_COMMENTS: do not use C99 // comments
#162: FILE: variants/variants.h:9:
+#endif // CONFIG_BOARD_ARDUINO_NANO_33_IOT
patches/0001-variants-add-nrf52840dk.patch:165: ERROR:C99_COMMENTS: do not use C99 // comments
#165: FILE: variants/variants.h:12:
+#endif // CONFIG_BOARD_NRF52840DK_NRF52840
patches/0001-variants-add-nrf52840dk.patch total: 2 errors, 0 warnings, 132 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
patches/0001-variants-add-nrf52840dk.patch has style problems, please review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replacing just the //
comments with /*
comments gets rid of any checkpatch errors.
We can create a separate PR to fix the rest of the comments in this file, but for now my suggestion is we follow /*
.
However if in your opinion this will look inconsistent then I am okay with //
as well.
Ah yes, I know that Zephyr doesn't allow |
@szczys Thank you so much for this contribution! |
Add varints folder and pinmapping for nRF52840dk Signed-off-by: Mike Szczys <mike@golioth.io>
ba216a7
to
950573d
Compare
Okay, I have squashed and also re-targeted this PR for main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your invaluable time, effort and also for bearing with the multiple rounds of reviews @szczys !
PR LGTM :D
This PR adds overlay and pinmap for Nordic and NXP boards that have Arduino headers.
I used the following technique for mapping these headers:
This is based on #31 which hasn't yet been merged. There is actually only one new commit in this PR: d0697ca