I am having some issues with a newly purchased SparkFun Pro nRF52840 Mini, specifically around getting adafruit-nrfutil working to program an application and getting the bootloader to work properly. I’ve attempted to document all the issues I’m having with this newly purchased chip.
The issues I’m having:
-
Unable to flash chip
-
RST/PIN 13 not working as expected.
-
USB mass-storage not working
More details for each issue are listed as follows. I’ve attempted to be as thorough as possible with descriptions.
- The first issue I’m having is that adafruit-nrfutil can’t flash an application.
I’ve tried flashing a custom program on both a Windows 10 (1809) and Linux (Ubuntu 18.04) machine and see the same issue on both platforms. On both platforms I’m using adafruit-nrfutil dfu serial to flash the application. Both platforms output the following error:
No data received on serial port. Not able to proceed.
The device immediately goes into DFU mode when I plug it in (blue pin 7 immediately starts blinking). The double reset method doesn’t seem to change anything (however RST+PIN13 puts the device in some mode other than DFU, see issue #2).
I’ve provided output from both systems as reference:
Linux
The command on Linux is as follows:
$ adafruit-nrfutil --verbose dfu serial --package _build/dfu-package.zip -p /dev/ttyACM0 -b 115200 --singlebank --touch 1200
And the output:
adafruit-nrfutil --verbose dfu serial --package _build/dfu-package.zip -p /dev/ttyACM0 -b 115200 --singlebank --touch 1200
Upgrading target on /dev/ttyACM0 with DFU package /home/<user>/Projects/nrf52/pbrick/boards/sparkfun-pro-mini/s140/armgcc/_build/dfu-package.zip. Flow control is disabled, Single bank, Touch 1200
Touched serial port /dev/ttyACM0
Opened serial port /dev/ttyACM0
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 68200
Sending DFU start packet
Timed out waiting for acknowledgement from device.
Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.
Traceback (most recent call last):
File "/home/<user>/.local/lib/python3.6/site-packages/nordicsemi/__main__.py", line 294, in serial
dfu.dfu_send_images()
File "/home/<user>/.local/lib/python3.6/site-packages/nordicsemi/dfu/dfu.py", line 235, in dfu_send_images
self._dfu_send_image(HexType.APPLICATION, self.manifest.application)
File "/home/<user>/.local/lib/python3.6/site-packages/nordicsemi/dfu/dfu.py", line 200, in _dfu_send_image
application_size)
File "/home/<user>/.local/lib/python3.6/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 179, in send_start_dfu
self.send_packet(packet)
File "/home/<user>/.local/lib/python3.6/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 243, in send_packet
ack = self.get_ack_nr()
File "/home/<user>/.local/lib/python3.6/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 282, in get_ack_nr
raise NordicSemiException("No data received on serial port. Not able to proceed.")
nordicsemi.exceptions.NordicSemiException: No data received on serial port. Not able to proceed.
Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.
Windows 10
The command on Windows is identical to the Linux command.
adafruit-nrfutil.exe --verbose dfu serial -pkg dfu-package.zip -p COM3 -b 115200 --singlebank --touch 1200
The output is as follows:
Upgrading target on COM3 with DFU package D:\Downloads\dfu-package.zip. Flow control is disabled, Single bank, Touch 1200
Touched serial port COM3
Opened serial port COM3
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 68200
Sending DFU start packet
Timed out waiting for acknowledgement from device.
Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.
Traceback (most recent call last):
File "nordicsemi\__main__.py", line 294, in serial
File "nordicsemi\dfu\dfu.py", line 235, in dfu_send_images
File "nordicsemi\dfu\dfu.py", line 200, in _dfu_send_image
File "nordicsemi\dfu\dfu_transport_serial.py", line 179, in send_start_dfu
File "nordicsemi\dfu\dfu_transport_serial.py", line 243, in send_packet
File "nordicsemi\dfu\dfu_transport_serial.py", line 282, in get_ack_nr
nordicsemi.exceptions.NordicSemiException: No data received on serial port. Not able to proceed.
Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.
- Reset behavior not working as expected.
The instructions at https://learn.sparkfun.com/tutorials/sp … bootloader outline the two reset methods to enter the bootloader for this device which I am following.
When I initially plug in the device, it appears to be in DFU mode (LED PIN7 is blinking blue). Both reset methods don’t appear to be working as expected, but this may be because I’m already in DFU mode. If this behavior is expected please let me know.
-
The double reset method (double tapping RST twice) doesn’t seem to do anything. On other nRF52 chips I own, doing a reset (even when the board is in bootloader mode), causing the device to power off then go back into bootloader mode. Double pressing the RST twice doesn’t appear to do anything. Again, this may be expected, it’s just different than every other nRF52 chip I’ve seen.
-
The PIN 13 + RST method takes the device out of DFU mode, and I can’t get it back into DFU mode without a power cycle. Specifically, pressing PIN 13 by itself while in DFU mode causes PIN 7 to stop blinking. PIN 7 flashes once briefly then the chip goes dead with the exception of the red power LED on the USB mini port. Once I’m in this state, the only way to get back to DFU mode is to do a full power cycle of the device. PIN13 + RST or the double RST tap don’t return the device to DFU mode.
- USB device mass-storage issues.
On the stock bootloader, I’m supposedly able to upload uf2 files directly to the chip, however on both Windows 10 and Linux the USB mass-storage device doesn’t appear to initialize properly.
On Windows 10, the device shows up but immediately prompts to be formatted. I can see the disk, however it shows up as an unformatted volume. Nothing I’ve read about the Adafruit nRF52 bootloader indicates I should need to manually format the device. My understanding from the documentation is that the device should be pre-formatted and have a NRF52BOOT label.
On Linux, the device gets detected but the disk never shows up as a removable USB drive. dmesg output seems to indicator there’s something wrong with the filesystem. dmesg output is as follows:
[33638.086551] usb 5-4: new full-speed USB device number 84 using xhci_hcd
[33638.236406] usb 5-4: New USB device found, idVendor=239a, idProduct=8029, bcdDevice= 1.00
[33638.236409] usb 5-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[33638.236411] usb 5-4: Product: Bluefruit nRF52840
[33638.236412] usb 5-4: Manufacturer: Adafruit Industries
[33638.236414] usb 5-4: SerialNumber: 52D9527575029108
[33638.247890] cdc_acm 5-4:1.0: ttyACM0: USB ACM device
[33638.248967] usb-storage 5-4:1.2: USB Mass Storage device detected
[33638.249185] scsi host9: usb-storage 5-4:1.2
[33639.255202] scsi host9: scsi scan: INQUIRY result too short (5), using 36
[33639.255208] scsi 9:0:0:0: Direct-Access Adafruit Bluefruit nRF52 1.0 PQ: 0 ANSI: 2
[33639.255667] sd 9:0:0:0: Attached scsi generic sg3 type 0
[33639.256211] sd 9:0:0:0: [sdd] Very big device. Trying to use READ CAPACITY(16).
[33639.256500] sd 9:0:0:0: [sdd] physical block alignment offset: 3038083128
[33639.256503] sd 9:0:0:0: [sdd] Unsupported sector size 1097097574.
[33639.256509] sd 9:0:0:0: [sdd] 0 512-byte logical blocks: (0 B/0 B)
[33639.256521] sd 9:0:0:0: [sdd] 747384000-byte physical blocks
[33639.257269] sd 9:0:0:0: [sdd] Write Protect is off
[33639.257273] sd 9:0:0:0: [sdd] Mode Sense: 03 00 00 00
[33639.257545] sd 9:0:0:0: [sdd] No Caching mode page found
[33639.257554] sd 9:0:0:0: [sdd] Assuming drive cache: write through
[33639.257566] sd 9:0:0:0: [sdd] Optimal transfer size 0 bytes < PAGE_SIZE (4096 bytes)
[33639.258874] sd 9:0:0:0: [sdd] Very big device. Trying to use READ CAPACITY(16).
[33639.259484] sd 9:0:0:0: [sdd] Unsupported sector size 1097097574.
[33639.260134] sd 9:0:0:0: [sdd] Attached SCSI removable disk
For thoroughness, if I attempt to mount the disk I get the following error:
$ sudo mount /dev/sdd /mnt/sparkfun-pro-mini/
mount: /mnt/sparkfun-pro-mini: can't read superblock on /dev/sdd.
The chip definitely does not appear to be working as expected. My speculative guess is that either the bootloader is corrupt or there’s some issue with the internal circuitry. The lack of volume label on Windows and PIN13/RST issue have me leaning towards a problem with the bootloader.
I would appreciate any help with trying to get this chip working or to do an RMA to see if maybe I just got a bad chip. I currently don’t have access to a J-Link I can use to try to program the chip with nrfjprog.
Please let me know if you require any further information from me.
Thanks for your help!