I have two ADF4351 PLL eval boards, each with their own local 25MHz crystal for a reference clock. One ADF is wired to spi0 cs0, and the other is wired to spi1 cs0. An iio driver is used to configure and control the ADFs from user space.
My issue is that after booting, neither ADF locks.
My setup on my rpi4 is as follows:
1) Config.txt: I have the following additions
dtparam=spi=on
dtoverlay=spi1-3cs
dtoverlay=rpi-adf4351-combined //dtbo file
2) Contents of rpi-adf4351-combined.dtsI get a promising output from iio_info:
However, neither PLL locks. When I run "dmesg | grep spi", I get the following outputSo it seems there is a conflict using the chipselect. I have tried the following:
1) Adding specific fragments to disable spidev
2) Not enabling spi0 or spi1 in the config.txt, and hoping the overlay would do it
3) Separating the dts file into two overlays, one for each ADF, and adding them to /boot/config.txt
In this last case (3), I can get one of the ADFs to lock, but not both. Also, if I only use an overlay for one device and not the other, I can get that one to lock. This works for either ADF on either spi bus, so I don't think there is anything wrong with either ADF board, or how they are wired to the rpi.
Can anyone give me some ideas to try in order to get both ADFs to lock.
Thanks
Andy
My issue is that after booting, neither ADF locks.
My setup on my rpi4 is as follows:
1) Config.txt: I have the following additions
dtparam=spi=on
dtoverlay=spi1-3cs
dtoverlay=rpi-adf4351-combined //dtbo file
2) Contents of rpi-adf4351-combined.dts
Code:
/dts-v1/;/plugin/;/ { compatible = "bcrm,bcm2711"; // Fragment 0: Clock Setup for ADF4351 devices fragment@0 { target-path = "/"; __overlay__ { crystal_25mhz_0: oscillator0 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <25000000>; status = "okay"; }; crystal_25mhz_1: oscillator1 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <25000000>; status = "okay"; }; }; }; // Fragment 1: Configure ADF4351 on SPI0 CS0 fragment@1 { target = <&spi0>; __overlay__ { #address-cells = <1>; #size-cells = <0>; adf4351_0: adf4351@0 { compatible = "adi,adf4351"; reg = <0>; // Use SPI0 CS0 spi-max-frequency = <1000000>; clocks = <&crystal_25mhz_0>; clock-names = "clkin"; adi,channel-spacing = <1>; adi,power-up-frequency = <50000000>; adi,phase-detector-polarity-positive-enable; adi,charge-pump-current = <2500>; adi,output-power = <3>; adi,mute-till-lock-enable; status = "okay"; }; }; }; // Fragment 2: Configure ADF4351 on SPI1 CS0 fragment@2 { target = <&spi1>; __overlay__ { #address-cells = <1>; #size-cells = <0>; adf4351_1: adf4351@0 { compatible = "adi,adf4351"; reg = <0>; // Use SPI1 CS0 spi-max-frequency = <1000000>; clocks = <&crystal_25mhz_1>; clock-names = "clkin"; adi,channel-spacing = <1>; adi,power-up-frequency = <60000000>; adi,phase-detector-polarity-positive-enable; adi,charge-pump-current = <2500>; adi,output-power = <3>; adi,mute-till-lock-enable; status = "okay"; }; }; };};
Code:
iio_info version: 0.26 (git tag:bdd5c000)Libiio version: 0.26 (git tag: bdd5c00) backends: local xml ip usb serialIIO context created with local backend.Backend version: 0.26 (git tag: bdd5c00)Backend description string: Linux analog 6.1.54-v7l+ #1 SMP Tue Nov 5 15:29:09 UTC 2024 armv7lIIO context has 4 attributes: hw_carrier: Raspberry Pi 4 Model B Rev 1.4 dtoverlay: spi1-3cs,vc4-kms-v3d,rpi-adf4351-combined local,kernel: 6.1.54-v7l+ uri: local:IIO context has 4 devices: hwmon0: cpu_thermal 1 channels found: temp1: (input) 2 channel-specific attributes found: attr 0: crit value: 110000 attr 1: input value: 44790 No trigger on this device hwmon1: rpi_volt 1 channels found: in0: (input) 1 channel-specific attributes found: attr 0: lcrit_alarm value: 0 No trigger on this device iio:device0: /soc/spi@7e204000/adf4351@0 1 channels found: altvoltage0: (output) 4 channel-specific attributes found: attr 0: frequency value: 49999999 attr 1: frequency_resolution value: 1 attr 2: powerdown value: 0 attr 3: refin_frequency value: 25000000 1 device-specific attributes found: attr 0: waiting_for_supplier value: 0 No trigger on this device iio:device1: /soc/spi@7e215080/adf4351@0 1 channels found: altvoltage0: (output) 4 channel-specific attributes found: attr 0: frequency value: 60000000 attr 1: frequency_resolution value: 1 attr 2: powerdown value: 0 attr 3: refin_frequency value: 25000000 1 device-specific attributes found: attr 0: waiting_for_supplier value: 0 No trigger on this device
Code:
[ 1.868267] SPI driver pulsar_adc has no spi_device_id for adi,pulsar,ad7986[ 1.868286] SPI driver pulsar_adc has no spi_device_id for adi,pulsar,ad7985[ 1.868302] SPI driver pulsar_adc has no spi_device_id for adi,pulsar,ad7944[ 6.645355] adf4350 spi0.0: supply vcc not found, using dummy regulator[ 6.646849] spi-bcm2835 fe204000.spi: chipselect 0 already in use[ 6.646867] spi_master spi0: spi_device register error /soc/spi@7e204000/spidev@0[ 6.646905] spi_master spi0: Failed to create SPI device for /soc/spi@7e204000/spidev@0[ 7.109421] adf4350 spi1.0: supply vcc not found, using dummy regulator[ 7.119629] spi-bcm2835aux fe215080.spi: chipselect 0 already in use[ 7.119650] spi_master spi1: spi_device register error /soc/spi@7e215080/spidev@0[ 7.119688] spi_master spi1: Failed to create SPI device for /soc/spi@7e215080/spidev@0[ 8.522845] SPI driver spidev has no spi_device_id for adi,swspi
1) Adding specific fragments to disable spidev
2) Not enabling spi0 or spi1 in the config.txt, and hoping the overlay would do it
3) Separating the dts file into two overlays, one for each ADF, and adding them to /boot/config.txt
In this last case (3), I can get one of the ADFs to lock, but not both. Also, if I only use an overlay for one device and not the other, I can get that one to lock. This works for either ADF on either spi bus, so I don't think there is anything wrong with either ADF board, or how they are wired to the rpi.
Can anyone give me some ideas to try in order to get both ADFs to lock.
Thanks
Andy
Statistics: Posted by A622266 — Thu Dec 26, 2024 1:36 pm — Replies 0 — Views 20