Skip to content

boards/nrf52840-mdk-dongle: add nRF52840 MDK USB Dongle#14647

Merged
benpicco merged 3 commits into
RIOT-OS:masterfrom
benpicco:boards/nrf52840-mdk-dongle
Dec 2, 2020
Merged

boards/nrf52840-mdk-dongle: add nRF52840 MDK USB Dongle#14647
benpicco merged 3 commits into
RIOT-OS:masterfrom
benpicco:boards/nrf52840-mdk-dongle

Conversation

@benpicco

@benpicco benpicco commented Jul 28, 2020

Copy link
Copy Markdown
Contributor

Contribution description

The nRF52840 MDK USB Dongle is another widely available nRF52840 Dongle.
It is ostensibly similar to the reference design (nrf52840dongle) but differs in several aspects.
(fewer GPIOs, one less LED, different bootloader and an external voltage regulator that provides up to 1A @ 3.3V)

pinout
It comes with the UF2 bootloader and is flashed using uf2conv.py.
The utility will convert the .hex file into a .uf2 file and copy it to the mass storage device that the bootloader creates for this purpose.

This works well with auto-mount, if you are mounting manually, additional steps are needed.

Testing procedure

The usual nRF52 things should work.

For the first flashing, you have to enter the bootloader manually by pressing the Reset button while plugging the device in.
Subsequent flashes should perform the bootloader reset automatically.

The uf2conv.py utility will be fetched automatically.

Issues/PRs references

@benpicco benpicco added Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: boards Area: Board ports labels Jul 28, 2020
@benpicco benpicco requested a review from chrysn July 28, 2020 20:08
@benpicco benpicco force-pushed the boards/nrf52840-mdk-dongle branch from 11d6f98 to 8ede818 Compare July 28, 2020 20:10
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 2, 2020
@benpicco benpicco force-pushed the boards/nrf52840-mdk-dongle branch from 8ede818 to 185c4bd Compare August 3, 2020 09:51
@maribu

maribu commented Aug 11, 2020

Copy link
Copy Markdown
Member

I assume I could just test this on an nRF52840 Dongle, provided that the U2F bootloader (that I have installed anyway) is on it?

@benpicco

benpicco commented Aug 11, 2020

Copy link
Copy Markdown
Contributor Author

The pins will be different.
But there is not much more than the nRF52840 on it besides that.

There are several config options to the UF2-bootloader.
Check out mdk_nrf52840_dongle.

@benpicco benpicco requested a review from kaspar030 August 11, 2020 11:51
@kaspar030

Copy link
Copy Markdown
Contributor

I don't have hardware to test, but otherwise, LGTM.

@kaspar030

Copy link
Copy Markdown
Contributor

I tested the uf2 flashing procedure (with a different board, but same includes).
I don't have the mentioned auto-mounter, but "reset into bootloader, mount manually, then make flash-only" works fine. On arch, I need a symlink, ln -s /run/media /media.

@fjmolinas

Copy link
Copy Markdown
Contributor

@benpicco do you mind adding some tests results? Otherwise if @kaspar030 thinks his testing is enough he can ACK.

@benpicco benpicco added State: waiting for other PR State: The PR requires another PR to be merged first CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 30, 2020
@benpicco

Copy link
Copy Markdown
Contributor Author

What tests world you like to see?
@man0lis has the board 🙂

@fjmolinas

Copy link
Copy Markdown
Contributor

What tests world you like to see?

Ideally compile_and_test_for_board

@benpicco

benpicco commented Sep 9, 2020

Copy link
Copy Markdown
Contributor Author

A problem I'm getting a lot with the automated tests is

[31247.269093] blk_update_request: I/O error, dev sde, sector 1 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[31247.269101] Buffer I/O error on dev sde, logical block 1, lost async page write
[31247.269126] blk_update_request: I/O error, dev sde, sector 33 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[31247.269128] Buffer I/O error on dev sde, logical block 33, lost async page write
[31247.269178] blk_update_request: I/O error, dev sde, sector 70 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
[31247.269204] blk_update_request: I/O error, dev sde, sector 65 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[31247.269207] Buffer I/O error on dev sde, logical block 65, lost async page write
[31247.269226] blk_update_request: I/O error, dev sde, sector 70 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[31247.269253] blk_update_request: I/O error, dev sde, sector 65 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[31247.269263] FAT-fs (sde): unable to read inode block for updating (i_pos 1041)
[31247.269379] blk_update_request: I/O error, dev sde, sector 65 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[31247.269451] FAT-fs (sde): Directory bread(block 65) failed
[31247.269465] blk_update_request: I/O error, dev sde, sector 66 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[31247.269470] FAT-fs (sde): Directory bread(block 66) failed
[31247.269479] blk_update_request: I/O error, dev sde, sector 67 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[31247.269484] FAT-fs (sde): Directory bread(block 67) failed
[31247.269492] blk_update_request: I/O error, dev sde, sector 68 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[31247.269497] FAT-fs (sde): Directory bread(block 68) failed
[31247.269590] FAT-fs (sde): Directory bread(block 65) failed
[31247.269600] FAT-fs (sde): Directory bread(block 66) failed
[31247.269612] FAT-fs (sde): Directory bread(block 67) failed
[31247.269621] FAT-fs (sde): Directory bread(block 68) failed

when the board resets itself after flashing (writing the firmware to the mounted 'drive')
It seems like it prematurely restarts itself and then boots into the old firmware.

For a reason yet unknown, this does not happen when I manually run make BOARD=nrf52840-mdk-dongle flash test.

The bootloader gets auto-mounted as

/dev/sde on /media/benpicco/MDK-DONGLE type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

Maybe I have to re-mount it with the sync option?

@benpicco benpicco removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 9, 2020
@benpicco benpicco force-pushed the boards/nrf52840-mdk-dongle branch from e5529b0 to a76b60d Compare October 29, 2020 16:49
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Oct 29, 2020
@benpicco

Copy link
Copy Markdown
Contributor Author

I still get some

[30320.056563] blk_update_request: I/O error, dev sdd, sector 65 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 0
[30320.056567] Buffer I/O error on dev sdd, logical block 65, lost sync page write

with

sudo mount -o remount,rw,sync,noatime /dev/sdd /media/benpicco/MDK-DONGLE

but the firmware gets written correctly. Same without the remount though.

@benpicco benpicco requested a review from bergzand November 5, 2020 16:34
@benpicco benpicco force-pushed the boards/nrf52840-mdk-dongle branch 2 times, most recently from 3eddc40 to 78bf22d Compare November 13, 2020 17:48
Comment thread boards/nrf52840-mdk-dongle/Makefile.include Outdated
Comment thread makefiles/tools/targets.inc.mk Outdated
Comment thread dist/tools/uf2/Makefile Outdated
@aabadie aabadie self-assigned this Dec 1, 2020
@aabadie

aabadie commented Dec 2, 2020

Copy link
Copy Markdown
Contributor

Please rebase and squash!

@benpicco benpicco force-pushed the boards/nrf52840-mdk-dongle branch from 9d55adc to 081c600 Compare December 2, 2020 09:20
@benpicco

benpicco commented Dec 2, 2020

Copy link
Copy Markdown
Contributor Author

squashed.

still flashes and no more duplicate pings thanks to #15132

2020-12-02 10:30:15,560 #  version
2020-12-02 10:30:15,562 # 2021.01-devel-1298-g081c6-boards/nrf52840-mdk-dongle
2020-12-02 10:39:37,121 #  ping fe80::fec2:3d00:0:bb1
2020-12-02 10:39:37,133 # 12 bytes from fe80::fec2:3d00:0:bb1%7: icmp_seq=0 ttl=64 rssi=174 dBm time=9.253 ms
2020-12-02 10:39:38,133 # 12 bytes from fe80::fec2:3d00:0:bb1%7: icmp_seq=1 ttl=64 rssi=178 dBm time=9.893 ms
2020-12-02 10:39:39,134 # 12 bytes from fe80::fec2:3d00:0:bb1%7: icmp_seq=2 ttl=64 rssi=178 dBm time=10.211 ms
2020-12-02 10:39:39,134 # 
2020-12-02 10:39:39,135 # --- fe80::fec2:3d00:0:bb1 PING statistics ---
2020-12-02 10:39:39,136 # 3 packets transmitted, 3 packets received, 0% packet loss
2020-12-02 10:39:39,138 # round-trip min/avg/max = 9.253/9.785/10.211 ms

@aabadie aabadie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK

@benpicco benpicco merged commit c03e3ad into RIOT-OS:master Dec 2, 2020
@benpicco benpicco deleted the boards/nrf52840-mdk-dongle branch December 2, 2020 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: boards Area: Board ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants