-
Notifications
You must be signed in to change notification settings - Fork 2.1k
boards/ACD52832: add new NRF52 based development board #8035
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
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.
looks good to me, untested ACK!
You can test (if you want). I can give you the such a board tomorrow. Otherwise I've tested UART, LED, GPIO, SAUL and gave it a quick shot to communicate over NRFMIN with a nrf52dk board. |
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.
Some duplication must go...
boards/acd52832/Makefile.features
Outdated
@@ -0,0 +1,18 @@ | |||
# Put defined MCU peripherals here (in alphabetical order) | |||
FEATURES_PROVIDED += periph_cpuid |
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.
drop cpuid, flashpage, hwrng as they're provided by the cpu
boards/acd52832/Makefile.features
Outdated
FEATURES_PROVIDED += periph_uart | ||
|
||
# Various other features (if any) | ||
FEATURES_PROVIDED += cpp |
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.
drop cpp too
boards/acd52832/Makefile.dep
Outdated
@@ -0,0 +1,13 @@ | |||
ifneq (,$(filter saul_default,$(USEMODULE))) |
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.
This file seems to be a copy of the one in boards/nrf52dk
. Please deduplicate.
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 assume it is. What kind of deduplication do you have in mind, something like a board_common folder?
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.
What kind of deduplication do you have in mind, something like a board_common folder?
Yes.
In this case, I'd suggest a folder called "nrf5x-common". The non-common nrf5x Makefile.dep would contain a line that just include the common one.
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.
Technically I understand your proposal to avoid duplication. On the other hand this is board specific and the board here is not an NRF Nordic board but the aconno. I fear this might get un-intuitive. For example: I find it quite un-intuitive that the waspmote-pro depends on arduino-atmega-common
. Did I change your mind :-)? If not, I still think we should introduce a common folder in a separate PR, right?
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.
So you think we should wait for something like #8044 right?
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.
Yes... Maybe #8102!
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.
@@ -0,0 +1,21 @@ | |||
# define the cpu used by the acd52832 |
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.
Also a copy of nrf52dk?
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.
Only the CPU_MODEL differs from common/nrf52xxxdk/Makefile.include
?
92205b1
to
600af68
Compare
@haukepetersen I've tried to re-use as as muchcode as possible from common/nrf52BLABLA. Unfortunately, I can not overwrite the |
Don't initialize the sensors at board level. This has to be solved higher up. |
Fine. The next question is how/if to generalize the common nrf52BLBLA board_init function. It currently initializes all four LEDs which is valid for addressed boards. We could -of course- adapt/dispatch somehow so the aconno is also covered, but I'm not sure whether this is a clean approach (because the aconno is actually a different board). What do you think @kaspar030? |
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.
Just some small changes that can improve the support for this board, I'd like to hear more about the motivations to include it as a nrf52 board.
boards/acd52832/Makefile
Outdated
@@ -0,0 +1,4 @@ | |||
MODULE = board | |||
DIRS = $(RIOTBOARD)/common/nrf52xxxdk |
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.
It's not better +=
? (in case of this actually belongs to nrf52 common boards)
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.
In the current state it doesn't matter but you might be right in general. I just copied from the other nrf52-based boards. Can we take it as for the others now and open another PR in case you want to see this addressed?
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.
Ok, let's see how the support for this, IMHO, very complete CPU, evolves.
/** | ||
* @name Clock configuration | ||
* | ||
* @note The radio will not work with the internal RC oscillator! |
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.
Hmmm... this sounds familiar from the EFM family CPUs, can you take a look on how it was solved?
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.
Will check. Can you reference a discussion?
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.
F438 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 don't see how this is related. I just checked the reference manual which states The HFXO must be running to use the RADIO
-> so this is a hardware 'limitation' and nothing to address here.
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 meant that the clock configuration for the whole family can be factorised and generalised, but well... it can come in a following up PR...
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.
Ahhh ok. Well that is an other feature which I don't want to address here. But yes, good idea in general
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.
meant that the clock configuration for the whole family can be factorised and generalised,
This is already done: the two values here are actually needed to be defined by each board, as only the boards knows about its used oscillators...
examples/default/Makefile
Outdated
microbit native nrf51dongle nrf52dk nrf6310 openmote-cc2538 pba-d-01-kw2x \ | ||
remote-pa remote-reva samr21-xpro \ | ||
spark-core telosb yunjia-nrf51822 z1 | ||
BOARD_PROVIDES_NETIF := acd52832 airfy-beacon cc2538dk fox iotlab-m3 iotlab-a8-m3 \ |
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.
Isn't possible for this board to also use the softdevice? I guess #8068 has good chances to be merged soon which brings back the softdevice compatibility.
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.
Generally it should be possible. But to be honest, currently the automatic inclusion of the softdevice is a pain in the neck. Let's include it once fixed.
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.
Ok, I might take care of that.
IMHO this board doesn't belong to nrf52BLABLA common boards. It shares only the CPU, which is already using nrf5x_common IIRC. Thus I think you should provide its own board.c along with its own board_init function. If code reutilisation is an issue, then the common board folder is not well decoupled, which is another issue. |
@kYc0o thanks for your review. I fully understand your argumentation about separate |
Well it appears that for this board the implementations are NOT the same, hence your trouble with the LEDs. I don't mind to have the "same" implementations, because they actually differ on this specific LED initialisation. Thus, IMHO, it's worth to have separated files. If we cannot take advantage of the code de-duplication in this situation, maybe we are not decoupling it in the right way, or simply it's not possible to reuse ALL the code which seems similar (OK, without |
3837f8f
to
0c88b81
Compare
@kaspar030 now that I thought about it again (@kYc0o as well) I still think we should go with a bit of separation (especially talking about Did I convince you? |
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.
OK for me in general. ACK.
Thanks @kYc0o. Lets wait for @kaspar030. He requested changes and started the discussion about code de-duplication |
@kaspar030 ping |
0c88b81
to
32066d1
Compare
Rebased |
@@ -0,0 +1,21 @@ | |||
# define the cpu used by the acd52832 |
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.
Only the CPU_MODEL differs from common/nrf52xxxdk/Makefile.include
?
@kaspar030 the |
CPU_MODEL and the ports can be set before inuding the common file. if the common file doesn't fit 100%, it can be changed. |
@kaspar030 please have a look at my latest commit. You prefer this way? IMO this line is not the nicest solution but IMO unavoidable if we want to use the shared Makefile. |
Yes! Thanks. |
1087655
to
201d532
Compare
Squashed |
All lights green |
&go! |
This PR takes over #7501. It adds a new development board by 'aconno' which is based on a NRF52X MCU and has a bunch of nice features on top (unfortunately not all supported yet). Further information can be found here.
Until know I used an external USB/UART converter for testing but we should consider the Segger RTT Client tool as default behind the make command in future.