Post Go back to editing

Temporary Update Firmware via Ethernet

Category: Hardware
Product Number: PLUTO

Greetings,

I am connecting to my PLUTO via an Ethernet - USB adapter. Ethernet works without issue** and I can work with my device. This includes updating my firmware using the on-device command (after uploading firmware):

# /sbin/update_frm.sh pluto.frm

What my question is: Is there a similar update that doesn't flash the device, but only temporarily updates it? I would like the functionality of the helper script pluto_ramboot Problem is, pluto_ramboot requires USB access and DFU mode. I for reasons** cannot get to this mode. During development, I will need to check out firmware often and don't want to have to risk bricking a device with a bad update if I can help it.

** For some as yet unknown reason, once I connected a wired Ethernet network to my Ubuntu machine, USB connections no longer work using IP address. I disconnected the Ethernet connection, rebooted, and connected only with USB cable, even to a brand new PLUTO; Still USB access using IP address fails. The Pluto SDR drive mounts and I can see the config etc. that way. I have something wonky in my host machine somewhere. Even if this worked, when deployed I will only have Ethernet access anyway so question remains.

Thank you!

Steve

  • Hi  ,

    Unfortunately some of the colleagues that would know to give a more definitive answer are out of office due to holidays, as such it might take a few days until someone settles this issue.

    Until then, these are my findings:
    - pluto_ramboot script calls device_reboot which in turn writes 7 to /sys/kernel/debug/zynq_rst/code
    - The sysfs attribute writes to the kernel variable zynq_rst_code. The value is used when a reboot is triggered here: reboot |= zynq_rst_code; 
    - Then this value is written to the register  "SLCR_REBOOT_STATUS_OFFSET 0x258 /* PS Reboot Status */"

    From here I have gotten kind of stuck, and could not progress either with the commit message that introduced the sysfs attribute: "This option adds an extra DBFS entry debug/zynq_rst/code. Values written are passed via REG slcr.REBOOT_STATUS Bits 15:0." nor the zynq documentation of this register field: BOOTROM_ERROR_CODE.

    At this time my assumption is that those values are used after the soft reboot by the FSBL, so at minimum your request would require modifications to the FSBL but I could be wrong.


    Dumitru

  • Values passed through this resister are persistent during soft reset.

    Some u-boot scripts will read the reset cause and act accordingly.

    https://github.com/analogdevicesinc/u-boot-xlnx/commit/74805f69632181d8e73e6bf7308d42cdee926712

    -Michael

  • Thank you kindly for your response. I apologize for the delay but I have been sidetracked by yet more issues. I don't fully understand the details, but you have given me a place to look. Sadly I expect it will be more complicated than "Put file in this location for a non-flashed reboot, or put it here to be flashed then reboot." :-P

    Edit: What would be good to know is the differences (which seem very non-trivial) between the DFU reboot with or without flashing (pluto_ramboot) vs. the on-device update_frm.sh process. They seem quite different. Anyway to use the DFU modes via ethernet? Thx!

  • Thank you. This is more information for digging.

  • From digging a little more I would say that the simplest approach to obtain ramboot only with OTG-Ethernet would be either "tftp booting" or "dfu tftp" directly from u-boot but it would require for you to also be connected to the UART port.

    From the u-boot terminal I can see that OTG works from u-boot as well and detects the adapter:

    M2k> usb start
    starting USB...
    USB0:   USB EHCI 1.00
    scanning bus 0 for devices... 2 USB Device(s) found
    USB1:   usb1 wrong num MIO: 0, Index 1
    lowlevel init failed
           scanning usb for storage devices... 0 Storage Device(s) found
    M2k> usb tree
    USB device tree:
      1  Hub (480 Mb/s, 0mA)
      |  u-boot EHCI Host Controller 
      |
      +-2  Vendor specific (480 Mb/s, 350mA)
           Realtek USB 10/100/1000 LAN 001000001


    But there are no drivers for it, so you will need to enable them +configs relating to tftpboot/dfu_tftp. This would require for you make some changes to u-boot:

    As a word of caution, I would really advice against making changes to u-boot if you do not have access to a JTAG programmer since you could brick your device. The following are merely suggestions and were not tested.

    - connect to the UART port on the pluto PCB either by using ADALM-UARTJTAG or a USB to UART of your choice so that you have access to the u-boot terminal and can see the boot log
    - backport changes from u-boot-xlnx in regards to the USB_HOST_ETHER  kconfig option (the source code for USB drivers are present in the current u-boot version used by the pluto, but they are not build and not referenced in any kconfig).
    - enable networking related configs for the zynq_m2k_defconfig (tftpboot/dfu tftp, USB ethernet drivers)

    You can use the following way to update u-boot (FSBL and u-boot partition is locked on the SPI flash and will not change while updating using the .frm file): build the whole firmware, copy the -fw-v0.xx-dirty.zip archive and eject.

    If booting fails and cannot get the device in DFU, you will need to follow the unbricking guide: unbricking_plutosdr

     it would be greatly appreciated if you could take a look at the above and give some advice if there exists a better way
     I guess that support will be limited from here on out since this falls outside the scope of the device's intended and supported functionality


    Dumitru

  • Thank you  Dumitru for the details. Yes, I do have a JTAG debugger and full Xilinx kit. Also, I understand that this is getting outside the realm of support from here out. I am very much appreciative of your feedback. I will experiment with this and report back.