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

nrfutil for DFU Mesh on Raspberry Pi

Hello,

Has anybody achieved to perform Mesh DFU over serial on a Raspberry Pi using nrfutil?

I can successfully perform it on Windows 7/10 (intel) so far with no problems on both official example and custom applications, with MSD disabled or enabled.

On the Raspberry Pi 3 Model B (Raspbian 9, Stretch) I could use JLink.exe instead of nrfjprog tool to reprogram and control the connected PCA10040 which would act as the DFU "master" for relevant applications.  And where I am stuck now:

I now want to use nrfutil 3.0.0 to just flash the .zip over serial (I won’t need to create it on the Pi). Nrfutil gives an error that it can’t open serial port ttyACM0. Device is present, user has root rights and added to the serial port user group (also tried with sudo). Since JLink.exe works fine I don’t reckon there is an issue with the port functionality/device itself (as it also works fine on Windows).

Some more information:

This seemed quite relevant, and according to that nrfutil shouldn’t be expected to work at all on Pi.  https://devzone.nordicsemi.com/f/nordic-q-a/45345/run-nrfutil-dfu-on-a-raspberry-pi
Another most relevant workaround in a thread seems quite outdated: https://devzone.nordicsemi.com/f/nordic-q-a/15509/trying-to-use-a-nrfutil-command-on-raspbian-os

Last thread was not on Mesh DFU I would assume given the date but still it was DFU over serial. I didn’t have any problems installing mine though from repository (as per the documentation) so I didn’t use any python workarounds.

On the PI: a generic mouse and a keyboard are the only additional things attached on USB, DK had MSD enabled, I get same error with MSD disabled):

pi@raspberrypi:~/nRF5_SDK_for_Mesh_v3.1.0 $ nrfutil --verbose dfu serial -pkg dfu_server_v2.zip -p ttyACM0 -b115200 -fc --mesh

Upgrading target on ttyACM0 with DFU package /home/pi/nRF5_SDK_for_Mesh_v3.1.0/dfu_server_v2.zip. Flow control is enabled.



Failed to upgrade target. Error is: Serial port could not be opened on ttyACM0. Reason:



Possible causes:

- bootloader, SoftDevice or application on target does not match the requirements in the DFU package.

- baud rate or flow control is not the same as in the target bootloader.

- target is not in DFU mode. If using the SDK examples, press Button 4 and RESET and release both to enter DFU mode.

Closing serial port...



pi@raspberrypi:~/nRF5_SDK_for_Mesh_v3.1.0 $ dmesg | grep tty

[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 bcm2708_fb.fbwidth=1366 bcm2708_fb.fbheight=768 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 root=PARTUUID=1f3112b2-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

[    0.000297] console [tty1] enabled

[    0.764503] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2

[    0.766015] console [ttyS0] disabled

[    0.766047] 3f215040.serial: ttyS0 at MMIO 0x0 (irq = 53, base_baud = 31250000) is a 16550

[    0.766093] console [ttyS0] enabled

[    3.204604] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device

pi@raspberrypi:~/nRF5_SDK_for_Mesh_v3.1.0 $ lsusb -t

/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M

    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M

        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M

        |__ Port 3: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M

        |__ Port 4: Dev 5, If 1, Class=CDC Data, Driver=cdc_acm, 480M

        |__ Port 4: Dev 5, If 2, Class=Vendor Specific Class, Driver=, 480M

        |__ Port 4: Dev 5, If 0, Class=Communications, Driver=cdc_acm, 480M

        |__ Port 4: Dev 5, If 3, Class=Mass Storage, Driver=usb-storage, 480M

        |__ Port 5: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M

        |__ Port 5: Dev 6, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M



pi@raspberrypi:~/nRF5_SDK_for_Mesh_v3.1.0 $ sudo adduser pi dialout

The user `pi' is already a member of `dialout'.

Assuming that nrfutil wouldn’t work on a PI (ARM) I have also tried it on Ubuntu 16.04 on an Intel laptop, and I got the same error from nrfutil 0.3.0.0 (again with MSD either disabled or enabled), so it could be some linux configuration for nrfutil which I missed?

On Ubuntu: The below is from dmesg when I connect the DK (MSD enabled):

[  602.348089] usb 2-1: new high-speed USB device number 7 using ehci-pci

[  602.504756] usb 2-1: config 1 interface 1 altsetting 0 bulk endpoint 0x83 has invalid maxpacket 64

[  602.504761] usb 2-1: config 1 interface 1 altsetting 0 bulk endpoint 0x4 has invalid maxpacket 64

[  602.505247] usb 2-1: New USB device found, idVendor=1366, idProduct=1015

[  602.505251] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[  602.505255] usb 2-1: Product: J-Link

[  602.505258] usb 2-1: Manufacturer: SEGGER

[  602.505261] usb 2-1: SerialNumber: 000682551905

[  602.505968] cdc_acm 2-1:1.0: ttyACM0: USB ACM device

[  602.507059] usb-storage 2-1:1.3: USB Mass Storage device detected

[  602.508207] scsi host6: usb-storage 2-1:1.3

[  603.516928] scsi 6:0:0:0: Direct-Access     SEGGER   MSD Volume       1.00 PQ: 0 ANSI: 4

[  603.517590] sd 6:0:0:0: Attached scsi generic sg2 type 0

[  603.519010] sd 6:0:0:0: [sdb] 21829 512-byte logical blocks: (11.2 MB/10.7 MiB)

[  603.520059] sd 6:0:0:0: [sdb] Write Protect is off

[  603.520065] sd 6:0:0:0: [sdb] Mode Sense: 0b 00 00 08

[  603.521389] sd 6:0:0:0: [sdb] No Caching mode page found

[  603.521397] sd 6:0:0:0: [sdb] Assuming drive cache: write through

[  603.531415]  sdb:

[  603.535266] sd 6:0:0:0: [sdb] Attached SCSI removable disk

On Ubuntu: The below is from dmesg when I connect the DK (MSD disabled):

[  268.320083] usb 2-1: new high-speed USB device number 3 using ehci-pci

[  268.477284] usb 2-1: New USB device found, idVendor=1366, idProduct=0105

[  268.477289] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[  268.477293] usb 2-1: Product: J-Link

[  268.477296] usb 2-1: Manufacturer: SEGGER

[  268.477300] usb 2-1: SerialNumber: 000682551905

[  268.541599] cdc_acm 2-1:1.0: ttyACM0: USB ACM device

[  268.542250] usbcore: registered new interface driver cdc_acm

[  268.542252] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

Thanks,

Con

Parents Reply Children
No Data
Related