boards/adafruit-clue: add initial support#13276
Conversation
Are you aware of #13146? |
1c173a8 to
3d31c77
Compare
|
Ad 1200 baud for nrf52840-dongle: I'd prefer to not introduce the 1200 baud rate hack to devices where it's not the manufacturer (or otherwise brand conventional, as in Arduino) endorsed way to enter the bootloader -- at least not unless it's advertised in some way (something like the CDC-ACM subprotocol, maybe, but those can only be allocated with USB-IF registration IIUC). When we have the choice of picking what to do, I'd rather implement a specified DFU reset rather than doing the only thing the particular hardware that happened to be used first with Arduino could do. But thanks for alerting me to this, I'm still looking through the PR, but it's a tad hard to tell for me what is actually part of the PR itself (it says it's based on #12304 and thus aabadie/pr/boards/arduino-mkr_stdio, but from that I get an even larger delta as from master). Anyway, I'm probably gonna "steal back" the |
|
I hope #12304 will be merged soon, so the diff related to this PR will be more readable. Otherwise, you can just use |
|
I've tried to incorporate your nrfutil.inc.mk into #13146, but there are a few nontrivial differences both in the fflags. Are we even running the same nrfutil here? (Mine doesn't recognize --baudrate, touch or singlebank, even though I just updated it from With that, it might be more prudent to not make this a common nrfutil.inc yet but to have it per board, and later compare them to the point where we can unify. |
As I said, I started from your nrfutil configuration in #13146 and was surprised some options are so different. |
|
@aabadie I also got hold of one of these boards fyi. Could test stuff! |
3d31c77 to
00ff7a1
Compare
9771a07 to
8a192a5
Compare
8a192a5 to
e63adf9
Compare
99e71ee to
b0e2ceb
Compare
b0e2ceb to
bc1f787
Compare
boards/adafruit-clue/Makefile.dep
Outdated
| ifneq (,$(filter auto_init_usbus,$(USEMODULE))) | ||
| # Use stdio over USB | ||
| USEMODULE += stdio_cdc_acm | ||
|
|
||
| # This boards requires support for nrfutil bootloader. | ||
| FEATURES_REQUIRED += bootloader_nrfutil | ||
|
|
||
| # and for the board reset via USB mechanism | ||
| USEMODULE += usb_board_reset | ||
| endif |
There was a problem hiding this comment.
auto_init modules can not trigger dependency
There was a problem hiding this comment.
Maybe its better to say they shouldn't, #13651.
1b9c394 to
b8d4c55
Compare
fjmolinas
left a comment
There was a problem hiding this comment.
I think this one looks good, one comemnt and some nit-picks.
Can you provide some test output? I can ACK it after that.
output of examples/defaultYou couldn't see it but the LED0 switch worked, the button A and B read were correct (right button + right state). |
b8d4c55 to
35833a5
Compare
|
@fjmolinas I also applied your suggestions. Let's see what Murdock has to say. |
35833a5 to
b4e6bcd
Compare
|
I pushed a fix similar to the one in #13664. Hope this will make Murdock happy this time. |
b4e6bcd to
81eaeb9
Compare
|
No more build issues on Murdock! @fjmolinas, are you ok to squash ? |
Yes go ahead. |
81eaeb9 to
c7b365c
Compare
Done! |
|
@aabadie is this targeted at the release? |
I hope it will be merged tomorrow. So yes :) |
boards/adafruit-clue/doc.txt
Outdated
|
|
||
| The board is flashed using the `nrfutil` Python package. | ||
|
|
||
| Once `nrfutil` is installed, ase `BOARD=adafruit-clue` with the `make` command.<br/> |
There was a problem hiding this comment.
| Once `nrfutil` is installed, ase `BOARD=adafruit-clue` with the `make` command.<br/> | |
| Once `nrfutil` is installed, use `BOARD=adafruit-clue` with the `make` command.<br/> |
There was a problem hiding this comment.
TBH this phrase is weird, I would simply remove.
|
|
||
| #include "usb_board_reset.h" | ||
|
|
||
| #define NRF52_DOUBLE_TAP_MAGIC_NUMBER (0x4e) |
There was a problem hiding this comment.
What this for? Mind adding a comment?
| FLASHFILE = $(HEXFILE) | ||
| FLASHDEPS += $(HEXFILE).zip | ||
| FLASHER = adafruit-nrfutil | ||
| FFLAGS = dfu serial --port=${PORT} --baudrate=115200 --touch=1200 --package=$(HEXFILE).zip --singlebank |
There was a problem hiding this comment.
| FFLAGS = dfu serial --port=${PORT} --baudrate=115200 --touch=1200 --package=$(HEXFILE).zip --singlebank | |
| FFLAGS = dfu serial --port=${PORT} --baudrate=${BAUD}--touch=1200 --package=$(HEXFILE).zip --singlebank |
boards/adafruit-clue/doc.txt
Outdated
|
|
||
| ### Flash the board | ||
|
|
||
| The board is flashed using the `nrfutil` Python package. |
There was a problem hiding this comment.
| The board is flashed using the `nrfutil` Python package. | |
| The board is flashed using the `nrfutil` Python package: | |
| $ pip install nrfutil --user |
There was a problem hiding this comment.
Addressed, note that the doc was wrong, the package to install is adafruit-nrfutil.
c7b365c to
155d6ec
Compare
|
Also I tested Details |
|
@aabadie please squash! |
155d6ec to
04f890f
Compare
Contribution description
This PR adds an initial support for the Adafruit Clue board. This board has the same form factor as the micro:bit but is running on an nrf52840 MCU, which gives much more possibilities. There are also plenty of sensors and a TFT LCD screen.
Almost all sensors are already supported by RIOT: bmp280, sth31, lis3mdl. Support for the apds9960 is provided by #10420 (I tested it and the basic version works).
What was tested with success:
tests/driver_ili9341worksThe accelerometer, an LSM6DS33, is not tested/supported yet (maybe it's similar to the LSM6DSL) ?
The board is flashed using nrfutil as it is the tool used by the Arduino IDE: I added a new makefile for managing nrfutil.
The other thing is the management of the bootloader: I reuse the same approach used for the
arduino-nano-33-bleboard (see #13194) to trigger a reboot in bootloader mode. nrfutil is able to handle the serial "touch" at 1200bauds and to flash afterwards.Testing procedure
compile_and_test_for_board.pyand check the results (but will need Makefile.dep: auto_init_% as DEFAULT_MODULES #13089 to work well).Issues/PRs references
This PR is based on #12304 for the bootloader management.