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

JLink serial (ttyACM0 over usb) drops out, usb device re-enumerates but ttyACM isn't found

I'm using three nrf52840-dk's, from an ubuntu 16.04 x64 host. 

  • JLink v6.30b
  • nrfjprog v9.7.2

I can program and interact with two boards fine, with zero of the failures below.  However, the third board is having problems.  This may be the first time I've tried to use the board, and it's always possible there is a HW issue.  I'm hoping to understand what, if any, steps there may be to bring the board back (eg, is there FW on the Jlink or nrf52 side that could possibly be in a bad state that I could fix without scrapping the board).  I've tried different cables; also as mentioned my two other boards work fine.

The problems is that any attempt to write to the ttyACM cause the part to disconnect.

On the board I'm seeing issues:

  1. plug in via USB. 
    1. Enumerates fine as both Mass-storage (seems to work fine) and Abstract control module serial (/dev/ttyACM0).
  2. Run, for example:  
    1. `nrfjprog -f nrf52 -e --log`
  3. The next message on both `dmesg` and `/var/log/syslog` is: 
    1. "Usb disconnect"
  4. This is followed by the device re-enumerating ... BUT the ttyACM and filesystem do not come back
  5. I can unplug and re-plug the device, and my pc enumerates both the ttyACM and the mass-storage

nrfjprog log:

--------------------------------------------------------------------------------
nrfjprog -f nrf52 -e --log
nrfjprog verion 9.7.2
--------------------------------------------------------------------------------
FUNCTION: open_dll.
FUNCTION: open_dll.
FUNCTION: enum_emu_snr.
FUNCTION: enum_emu_snr.
FUNCTION: enum_emu_snr.
FUNCTION: enum_emu_snr.
FUNCTION: connect_to_emu_with_snr.
FUNCTION: connect_to_emu_with_snr.
FUNCTION: connect_to_emu_without_snr.
FUNCTION: enum_emu_snr.
Updating firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 12 2018 16:05:20
Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12
JLinkARM.dll OpenEx returned error 'Communication timed out - Can not execute firmware update'.
FUNCTION: close_dll.
FUNCTION: close_dll.
developer@7a2d4d5d225c:~/nRF5_tools/nrf5_sdk/examples/ble_peripheral/ble_app_hts/pca10056/s140/armgcc$ exit
exit

As above, immediately after executing the nrfjprog, the device disconnects, then re-enumerates (but, apparently in a problematic state as ttyACM0 doesn't return)

kernel: [1116808.385970] usb 1-5.1: USB disconnect, device number 64
udisksd[2229]: Cleaning up mount point /media/mike/JLINK1 (device 8:16 no longer exist)
kernel: [1116808.422544] FAT-fs (sdb): unable to read boot sector to mark fs as dirty
kernel: [1116808.654667] usb 1-5.1: new high-speed USB device number 65 using xhci_hcd
mtp-probe: checking bus 1, device 65: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.1"
mtp-probe: bus: 1, device: 65 was not an MTP device
kernel: [1116808.755452] usb 1-5.1: New USB device found, idVendor=1366, idProduct=0101
kernel: [1116808.755454] usb 1-5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: [1116808.755455] usb 1-5.1: Product: J-Link
kernel: [1116808.755455] usb 1-5.1: Manufacturer: SEGGER
kernel: [1116808.755456] usb 1-5.1: SerialNumber: 000683350409
wpa_supplicant[1618]: wlp2s0: CTRL-EVENT-SCAN-FAILED ret=-100

What can i do to triage / possibly fix this?

  • Hi,

    I suspect this might be the reason for the stability issues you're seeing:

    Updating firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 12 2018 16:05:20
    Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12
    JLinkARM.dll OpenEx returned error 'Communication timed out - Can not execute firmware update'.

    Have you tried upgrading the fw using segger's "JLinkExe" program? If you installed their .deb package, it should be in your $PATH.

     

    Best regards,

    Håkon

  • It doesn't look like JLink knows about nrf52840 yet ??

    Side note - I have googled around several times for this, but cannot find any good/current docs/tutorials for the native Segger utilities.  I understand Nordic uses these under the hood .. but please if you need me to run them, pass me an appropriate command line.  Thank you!

    $ JLinkExe -device nrf52840 -if swd -speed 1000 
    > connect
    
    SEGGER J-Link Commander V6.30b (Compiled Feb  2 2018 18:38:58)
    DLL version V6.30b, compiled Feb  2 2018 18:38:53
    
    J-Link connection not established yet but required for command.
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 12 2018 16:05:20
    Hardware version: V1.00
    S/N: 683889153
    VTref = 3.300V
    The selected device "NRF52840" is unknown to this version of the J-Link software.
    
    Please make sure that at least the core J-Link shall connect to, is selected.
    Proper device selection is required to use the J-Link internal flash loaders
    for flash download or unlimited flash breakpoints.
    
    For some devices which require a special handling, selection of the correct device is important.
    No valid device has been selected.
    

  • Also, I just noticed a new Segger version has been released; v6.30c (above is v6.30b).

    The error is identical with the new revC

  • I had adapted the above JLinkExe command line from the script (I believe @Hakon) linked folks to in a different question, https://github.com/ssfrr/nrfjprog.sh/blob/master/nrfjprog.sh

    If i change the --device param from nrf52840 to just nrf52, the connect does work.  It appears that simple commands like reset do as well.

    What is the JLinkExe command to erase / re-flash the 52840?

    Thank you for your help.

  • Hi,

    Try connecting with device profile "nrf52840_xxaa".

    It looks like your firmware has already been updated successfully:

    Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 12 2018 16:05:20

    You can now write "?" for help, and use commands like "loadfile /path/to/hex.hex" to program the device and "erase" to erase the flash.

    I suspect that nrfjprog will also work now that the fw has been updated.

    Cheers,

    Håkon

Related