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

Thingy91: pynrfjprog deadlocks at 100% cpu usage

I'm using the script from https://devzone.nordicsemi.com/f/nordic-q-a/53208/updating-nrf9160-modem-firmware-through-the-command-line/215357#215357

Under strace, it never forks any other process and doesn't create the file it's looking for, so I'm really not sure what it's expecting to happen.

Full strace at http://triffid-hunter.no-ip.info/pynrf-flash.strace since this forum thing keeps throwing errors when I try to attach it.

https://devzone.nordicsemi.com/f/nordic-q-a/62397/nrfjprog-bug-gets-stuck-due-to-temporary-directory-permissions seems related however my permissions are fine, and the directory tree in /tmp is recreated identically if I wipe it first.

Since this is apparently the only way to update the NRF91 modem firmware from a terminal, and all the examples seem to be complaining about out-of-date modem firmware, I'm once again stuck.

Parents
  • Hi,

     

    Unfortunately, this is a bug that we recently found in pynrfjprog. We are working on fixing this, but its not yet ready for release.

    My apologies for the inconvenience this has caused.

     

    Is it possible that you can use nRF connect for desktop (programmer app, works on *nix + win) to upgrade the modem on this device?

     

    Kind regards,

    Håkon

  • Is it possible that you can use nRF connect for desktop (programmer app, works on *nix + win) to upgrade the modem on this device?

    Not until https://devzone.nordicsemi.com/f/nordic-q-a/64132/nordic-thingy91-error-updating-modem-firmware is fixed for Linux, and since I have a very strong penchant for Makefiles and command-line tools (since I enjoy hands-off automation and CI) that would only ever be an unsustainable kludge for me.

    How usable are the tools mentioned in https://devzone.nordicsemi.com/f/nordic-q-a/14671/nrfjprog-for-arm-cpu-raspberry-pi-3 these days?

  • Same error with latest version of nRF connect and updated programmer:

    2020-08-12T07:54:14.478Z INFO Application data folder: /home/triffid/.config/nrfconnect/pc-nrfconnect-programmer
    2020-08-12T07:54:14.574Z DEBUG App pc-nrfconnect-programmer v1.4.4 official
    2020-08-12T07:54:14.574Z DEBUG App path: /home/triffid/.nrfconnect-apps/node_modules/pc-nrfconnect-programmer
    2020-08-12T07:54:14.575Z DEBUG nRFConnect 3.4.2 is supported by the app (^3.3.0)
    2020-08-12T07:54:14.575Z DEBUG nRFConnect path: /tmp/.mount_nrfconlNUQmN/resources/app.asar
    2020-08-12T07:54:14.575Z DEBUG HomeDir: /home/triffid
    2020-08-12T07:54:14.575Z DEBUG TmpDir: /tmp
    2020-08-12T07:54:14.582Z INFO Using nrfjprog library 10.9.0, pc-nrfjprog-js 1.7.3
    2020-08-12T07:54:14.612Z ERROR Error while probing devices: Error occured when get serial numbers. Errorcode: CouldNotCallFunction (0x9)
    Lowlevel error: INVALID_OPERATION (fffffffe)

    2020-08-12T07:54:25.278Z INFO Modem DFU starts to write...
    2020-08-12T07:54:25.279Z INFO Writing /home/triffid/Projects/NRF/thingy91_fw_2020-04-29_bc7ade8b/mfwnrf9160120.zip to device
    2020-08-12T07:54:25.719Z ERROR MCUboot DFU failed. Please make sure that the device is in MCUboot mode and try again.

    I followed the instructions wrt holding SW3 during poweron to access MCUBoot mode, although this doesn't seem to make any difference to the USB descriptors that it delivers:

    $ lsusb -d 1915:520f -v

    Bus 001 Device 026: ID 1915:520f Nordic Semiconductor ASA Weltrend USB Mouse
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass          239 Miscellaneous Device
      bDeviceSubClass         2
      bDeviceProtocol         1 Interface Association
      bMaxPacketSize0        64
      idVendor           0x1915 Nordic Semiconductor ASA
      idProduct          0x520f
      bcdDevice            0.11
      iManufacturer           1 Nordic Semiconductor
      iProduct                2 Thingy:91 UART
      iSerial                 3 PCA20035_e7cec1bcfe84
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength       0x008d
        bNumInterfaces          4
        bConfigurationValue     1
        iConfiguration          0
        bmAttributes         0xe0
          Self Powered
          Remote Wakeup
        MaxPower              100mA
        Interface Association:
          bLength                 8
          bDescriptorType        11
          bFirstInterface         0
          bInterfaceCount         2
          bFunctionClass          2 Communications
          bFunctionSubClass       2 Abstract (modem)
          bFunctionProtocol       0
          iFunction               0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         2 Communications
          bInterfaceSubClass      2 Abstract (modem)
          bInterfaceProtocol      0
          iInterface              0
          CDC Header:
            bcdCDC               1.10
          CDC Call Management:
            bmCapabilities       0x02
              use DataInterface
            bDataInterface          1
          CDC ACM:
            bmCapabilities       0x02
              line coding and serial state
          CDC Union:
            bMasterInterface        0
            bSlaveInterface         1
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x81  EP 1 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0010  1x 16 bytes
            bInterval              10
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           2
          bInterfaceClass        10 CDC Data
          bInterfaceSubClass      0
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x82  EP 2 IN
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x01  EP 1 OUT
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               0
        Interface Association:
          bLength                 8
          bDescriptorType        11
          bFirstInterface         2
          bInterfaceCount         2
          bFunctionClass          2 Communications
          bFunctionSubClass       2 Abstract (modem)
          bFunctionProtocol       0
          iFunction               0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        2
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         2 Communications
          bInterfaceSubClass      2 Abstract (modem)
          bInterfaceProtocol      0
          iInterface              0
          CDC Header:
            bcdCDC               1.10
          CDC Call Management:
            bmCapabilities       0x02
              use DataInterface
            bDataInterface          1
          CDC ACM:
            bmCapabilities       0x02
              line coding and serial state
          CDC Union:
            bMasterInterface        2
            bSlaveInterface         3
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x83  EP 3 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0010  1x 16 bytes
            bInterval              10
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        3
          bAlternateSetting       0
          bNumEndpoints           2
          bInterfaceClass        10 CDC Data
          bInterfaceSubClass      0
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x84  EP 4 IN
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x02  EP 2 OUT
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               0
    Device Status:     0x0000
      (Bus Powered)

    I tried numerous times, both with and without SW3 held to no avail.

  • I've also tried using a JLink, but nRF Connect Programmer won't recognise it, claiming "ERROR Unsupported device. The detected device could not be recognized as neither JLink device nor Nordic USB device." even though it works fine with nrfjprog :-

    $ nrfjprog --deviceversion
    NRF9160_xxAA_REV2

  • I ran nRF Connect programmer under strace to see what it's doing when I try to update modem firmware, doesn't look like it's doing much at all with the serial port - opens the port, writes a few bytes, hands it off to another process which waits a moment then quits.

    strace log here: triffid-hunter.no-ip.info/nrfc.strace.gz (gzipped because it's 47MB uncompressed) - ACM0 is opened at line 424297.

  • Hi,

     

    Is this the JLink version you're using?

    JLink_Linux_V630h_x86_64

     

    If that is the case, could you please update to a newer version? This one is quite old, and does not include support for nrf9160 (Cortex m33). You can download a bundle from here: https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Command-Line-Tools/Download#infotabs

     

    Did you update over ttyACMx in this trace log? Could you attach the error code when trying to connect using a standard swd debugger? a screenshot would suffice.

     

    Kind regards,

    Håkon

  • Is this the JLink version you're using?

    JLink_Linux_V630h_x86_64

    nrfjprog -v says nrfjprog version: 10.9.0, JLinkARM.dll version: 6.80a

    Did you update over ttyACMx in this trace log? Could you attach the error code when trying to connect using a standard swd debugger? a screenshot would suffice.

Reply Children
No Data
Related