Enable mcumgr features on NRF5340 DK board while Bluetooth HCI_USB program is running

Hello community,

I am trying for multiple firmware updates for my NRF5340 DK board. 

What I am doing is I have build and flashed the SMP server sample program found /zephyr/samples/subsys/mgmt/mcumgr/smp_svr

After flashing this application, I can see my board recognised as a ttyACM0 device while I perform ls /dev.

Using the mcumgr tool I am also able to flash the Bluetooth HCI_USB sample program and after confirming the image and resetting the board, the board now acts as a bluetooth controller. I can verify this using the bluetoothctl command.

Now If I want to do a firmware upgrade, I dont have any way in the HCI_USB application to go back to smp server application. How can I perform multiple firmware updates using mcumgr?

Can virtual com port concept be useful here? If yes then I would like to have a detailed tutorial for this .

Parents
  • Hello Utsav,

    In a different DevZone case, I was able to emulate two UART COM on the same USB peripheral simply by setting one more cdc_acm_uart node under the usbd node. 

    		usbd: zephyr_udc0: usbd@40027000 {
    			compatible = "nordic,nrf-usbd";
    			reg = < 0x40027000 0x1000 >;
    			interrupts = < 0x27 0x1 >;
    			num-bidir-endpoints = < 0x1 >;
    			num-in-endpoints = < 0x7 >;
    			num-out-endpoints = < 0x7 >;
    			num-isoin-endpoints = < 0x1 >;
    			num-isoout-endpoints = < 0x1 >;
    			status = "okay";
    			cdc_acm_uart: cdc_acm_uart {
    				compatible = "zephyr,cdc-acm-uart";
    			};
    			cdc_acm_uart0: cdc_acm_uart0 {
    				compatible = "zephyr,cdc-acm-uart";
    				label = "CDC_ACM_0";
    			};

    Once that second virtual COM port is setup, you can select it for MCUmgr by overlaying the chosen property as such:

    /{
    	chosen {
    		zephyr,uart-mcumgr = &new_usb_uart_com;
    	};
    }

    Please note that it is the Christmas - New Year holiday season here. We are thus severely understaffed, and there would be delays in responses. Our apologies for the inconveniences. 

    Hieu

  •   I had successfully used the HCI_UART program to open 2 virtual ports - once for attaching the bluetooth device to HCI and another for accepting MCUMGR specific commands. The two functionalities are working fine but there is an issue with the scanning while using the program. In my use case I have been using BlueZ which communicates via the Dbus for various bluetooth related commands. What I have observed during my testing is that after a certain time the bluetooth controller is unable to detect any advertising devices. I have to do a power reset for it to make it scan again only to get the same issue after sometime. 

    More details of this problem is being discussed on another thread posted by one my acquaintance :

     NRF5340 HCI_USB & HCI_UART Stop Scanning 

    Let me know if you have anything on this that can be of help

  • You are in good hands with Torbjørn, he is more experienced with USB than I am. In fact I asked him for assistance with this ticket.

    But thanks for pointing out that ticket, I will keep an eye on it!

Reply Children
No Data
Related