Hello,
I am having the same issue with Adafruit programming with this statement put into the makefile as suggested.
bootload: $(OUTPUT_DIRECTORY)/nrf52840_xxaa.hex dfu-package
@echo Flashing: $<
adafruit-nrfutil --verbose dfu serial --package .\dfu-package.zip -p $(SERIAL_PORT) -b 115200 --singlebank --touch 1200
The error I am getting is:
C:\nRF5\nRF5_SDK_15.3.0_59ac345\examples\peripheral\blinky\sparkfun_nrf52840_mini\blank\armgcc>make bootload SERIAL_PORT=4
Packaging _build/nrf52840_xxaa.hex
adafruit-nrfutil dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application _build/nrf52840_xxaa.hex _build/dfu-package.zip
Zip created at _build/dfu-package.zip
Flashing: _build/nrf52840_xxaa.hex
adafruit-nrfutil --verbose dfu serial --package .\dfu-package.zip -p 4 -b 115200 --singlebank --touch 1200
Upgrading target on 4 with DFU package C:\nRF5\nRF5_SDK_15.3.0_59ac345\examples\peripheral\blinky\sparkfun_nrf52840_mini\blank\armgcc\dfu-package.zip. Flow control is disabled, Single bank, Touch 1200
Failed to upgrade target. Error is: Serial port could not be opened on 4. Reason: could not open port ‘4’: FileNotFoundError(2, ‘The system cannot find the file specified.’, None, 2)
Traceback (most recent call last):
File “c:\python37\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py”, line 99, in open
touch_port = Serial(port=self.com_port, baudrate=self.touch, rtscts=self.flow_control, timeout=self.timeout)
File “c:\python37\lib\site-packages\serial\serialwin32.py”, line 31, in init
super(Serial, self).init(*args, **kwargs)
File “c:\python37\lib\site-packages\serial\serialutil.py”, line 240, in init
self.open()
File “c:\python37\lib\site-packages\serial\serialwin32.py”, line 62, in open
raise SerialException(“could not open port {!r}: {!r}”.format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port ‘4’: FileNotFoundError(2, ‘The system cannot find the file specified.’, None, 2)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “c:\python37\lib\site-packages\nordicsemi_main_.py”, line 294, in serial
dfu.dfu_send_images()
File “c:\python37\lib\site-packages\nordicsemi\dfu\dfu.py”, line 235, in dfu_send_images
self._dfu_send_image(HexType.APPLICATION, self.manifest.application)
File “c:\python37\lib\site-packages\nordicsemi\dfu\dfu.py”, line 157, in _dfu_send_image
self.dfu_transport.open()
File “c:\python37\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py”, line 101, in open
raise NordicSemiException(“Serial port could not be opened on {0}. Reason: {1}”.format(self.com_port, e))
nordicsemi.exceptions.NordicSemiException: Serial port could not be opened on 4. Reason: could not open port ‘4’: FileNotFoundError(2, ‘The system cannot find the file specified.’, None, 2)
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.
I am able to re-program the nRF52840 using the nRF Connect desktop at this point I would just like to start over but I cannot find the original Bluefruit bootloader .hex file so that I can re-flash the nRF52840 Mini. I have looked on Github without success, I have looked at Adafruit without success, they have the Feather bootloader available for the nRF52840 and I have tried that but as you can see above the message is “Bootloader version does not match the one on Bluefruit device”.
A link to where I can find the original bootloader on the Sparkfun nRF52840 Mini would be appreciated.
Thanks.