MicroPhase / antsdr-fw-patch

Repository of antsdr firmware make
27 stars 18 forks source link

Not clear how to use 2r2t mode (documentation issue) #8

Closed BatchDrake closed 8 months ago

BatchDrake commented 11 months ago

In the meantime, while the other issue is being discussed:

What I want to do with this E310 is basically direction finding. For this purpose, I am using the latest firmware (https://github.com/MicroPhase/antsdr-fw-patch/releases/tag/v0.34) with the 2r2t mode. Still, I am struggling to find documentation on the subject. I was expecting libiio to provide me with facilities at API level to do such a thing, but I am afraid I found none so far. Is the documentation somewhere? How could I do this?

Cheers,

AlexeyBarsuk commented 11 months ago

Read the bottom of Readme.md in https://github.com/MicroPhase/antsdr-fw-patch, there is described how to enable 2r2t. Also I was not able to switch 2r2t in QSPI mode, only in SD card mode it was succeed

r4d10n commented 10 months ago

I also have been facing issue trying to enable the 2r2t mode on ANTSDR 310 using the description given in the README.

I tried to update the QSPI flash with the current release fw (0.34) with DFU. While running fw_printenv, it is returning this Bad CRC warning, with most of the env entries missing:

root@ant.local's password:
Welcome to:
    ___    _   _____________ ____  ____
   /   |  / | / /_  __/ ___// __ \/ __ \
  / /| | /  |/ / / /  \__ \/ / / / /_/ /
 / ___ |/ /|  / / /  ___/ / /_/ / _, _/
/_/  |_/_/ |_/ /_/  /____/_____/_/ |_|

v0.34-dirty
https://github.com/MicroPhase/antsdr-fw
# fw_printenv
Warning: Bad CRC, using default environment
bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=5
baudrate=115200
#

As @AlexeyBarsuk pointed out, it is only working in the SD card mode, even though not straight forward. Editing the uEnv.txt in the sdcard as mentioned in the README.md and rebooting with SD, fw_printenv does not show any changes based on the updated uEnv.txt.

The only way it worked was with manually setting the env variables with fw_setenv command from bash prompt as shown below. Thankfully, it is persistent after reboot.

fw_setenv adi_loadvals "fdt addr \${devicetree_load_address} && fdt get value fdt_choosen /configurations/\${fit_config}/ fdt && fdt get addr fdtaddr /images/\${fdt_choosen} data && fdt addr \${fdtaddr}; fdt get value model / model; if test \"\${model}\" > \"Analog Devices Pluto\"; then run adi_loadvals_pluto; fi;"
fw_setenv sdboot "if mmcinfo; then run uenvboot; echo Copying Linux from SD to RAM... && load mmc 0 \${fit_load_address} \${kernel_image} && load mmc 0 \${devicetree_load_address} \${devicetree_image} && load mmc 0 \${ramdisk_load_address} \${ramdisk_image} && run adi_loadvals;bootm \${fit_load_address} \${ramdisk_load_address} \${devicetree_load_address}#{fit_config}; fi"
fw_setenv usbboot "if usb start; then run uenvboot; echo Copying Linux from USB to RAM... && load usb 0 \${fit_load_address} \${kernel_image} && load usb 0 \${devicetree_load_address} \${devicetree_image} && load usb 0 \${ramdisk_load_address} \${ramdisk_image} && bootm \${fit_load_address} \${ramdisk_load_address} \${devicetree_load_address}; fi"
fw_setenv attr_name compatible
fw_setenv attr_val ad9361
fw_setenv compatible ad9361
fw_setenv model "Analog Devices PlutoSDR Rev.C (Z7010/AD9363)"
fw_setenv maxcpus 2
fw_setenv mode 2r2t

Kindly look into these issues and suggest/rectify needed changes.

lone-boy commented 9 months ago

If 2r2t does not work properly under qspi, you can update boot.frm through usb dfu, and then rewrite the command to enable 2r2t mode. I think this will be useful.