This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Programmer App on nRF Connect fails to select a device for programming unless it has a serial port

Hi,

This is a problem report for the Programmer App v1.0.1 on nRF Connect v2.6.1 on MacOS 10.14.2.  I have been attempting to use the programmer app with the nRF52 Dongle (PCA10059).  The documentation suggests that if an application running on this development board includes an instance of the app_usbd_nrf_dfu_trigger class, the programmer app will use this class instance to trigger a reset into the USB DFU boot loader whenever the device is selected in the programming app.

However, when I try and select a PCA10059 device running an application that only includes app_usbd_nrf_dfu_trigger from within the programmer app, I get this error message in the programmer app log:

Error while setting up device D2B4A60DDA22: Cannot read property 'comName' of undefined

If I add an instance of app_usbd_cdc_acm to the application to provide a virtual serial port, the programmer app works and uses the app_usbd_nrf_dfu_trigger instance to switch to the USB DFU boot loader when the device is selected from within the programmer app.

This would seem to be a bug in the programmer app or one of the libraries it depends upon.  The programmer reports using nrfjprog library 9.8.1, pc-nrfjprog-js 1.4.1.  The applications running on the dongle were built with SDK 15.2.

Interestingly if I manually enable the dongle USB DFU boot loader and then use the programmer app to load an application that only includes app_usbd_nrf_dfu_trigger (without app_usbd_nrf_cdc_acm), the programmer app is able to successfully switch back to the USB DFU boot loader immediately after programming completes i.e. I see the message "DFU trigger interface found, changing to bootloader..." in the programmer app log.  However, if I then disconnect the dongle and reattach, the programmer app fails to invoke the DFU trigger with the error message described above.

It seems as if the programmer app (or one of the libraries it uses) expects a serial port to always be associated with any device when performing initial device selection even though it shouldn't need a serial port to use app_usbd_nrf_dfu_trigger to switch to the USB DFU boot loader.  It also shouldn't need a serial port when using a JLink. For the other nRF Connect apps it makes sense that a serial port is needed since those apps communicate with the dongle via a serial port.  But this makes no sense for the programmer app.

To confirm this theory I connected a JLink to my Mac with the virtual com port disabled so that the JLink doesn't create a virtual serial port when attached.  The programming app fails to connect to the JLink with the same error message i.e. it expects the JLink to have a serial port even though it doesn't need a serial port to interact with the JLink via the JLink DLL.  If I enable the virtual com port on the JLink, the programmer app is able to use the JLink.

Note also the existence of the define NRF_DFU_TRIGGER_USB_USB_SHARED in the SDK would suggest that the use case of an application that only includes app_usbd_nrf_dfu_trigger with no other USB classes is a use case that the developers of this feature intended to support.

Hopefully you find this problem report useful.

James

Parents Reply Children
No Data
Related