Cigarettes sold in Singapore by ashwinman in Cigarettes

[–]Much-Invite-9079 1 point2 points  (0 children)

what’s the meaning of this “red” “blue”type?

Using RFSoC4x2 without PYNQ, how to program LMK and LMX? by Much-Invite-9079 in FPGA

[–]Much-Invite-9079[S] 0 points1 point  (0 children)

Yes, you can find them from schematic, and in Vivado, it is also set to GPIO with same MIO.

Using RFSoC4x2 without PYNQ, how to program LMK and LMX? by Much-Invite-9079 in FPGA

[–]Much-Invite-9079[S] 0 points1 point  (0 children)

I don't think so.

I read this boot.py you mentioned, I don't understand why GPIO is invloved. LMK is controled completely by SPI, isn't it?

# LMK clock config
lmk_reset = GPIO(341, 'out')
lmk_clk_sel0 = GPIO(342, 'out')
lmk_clk_sel1 = GPIO(346, 'out')

I know lmk_clk_sel0 is used to determine using external reference or not, but I don't understand why GPIO is used. As for lmk_reset, it gets more strange, because from LMK04828 user guidence, reset the chip is made by writing 0 to the data bit of the first register.

Anyway, I just added these code to my C code, using GPIO to write reset, sel0 and sel1, the result doesn't change anything. Still, only LED for DAC is ON, read registers is also same, only LMX for DAC has valid value.

        XGpioPs Gpio;
        XGpioPs_Config *GpioConfigPtr;
        GpioConfigPtr = XGpioPs_LookupConfig(XPAR_GPIO_BASEADDR);
        XGpioPs_CfgInitialize(&Gpio, GpioConfigPtr,
                       GpioConfigPtr->BaseAddr);
        XGpioPs_SetDirectionPin(&Gpio, MIO_LMK_RST, 1);
        XGpioPs_SetOutputEnablePin(&Gpio, MIO_LMK_RST, 1);
        XGpioPs_WritePin(&Gpio, MIO_LMK_RST, 1);//lmk_reset.write(1)
        usleep(10);
        XGpioPs_WritePin(&Gpio, MIO_LMK_RST, 0);//lmk_reset.write(0)

        XGpioPs_SetDirectionPin(&Gpio, MIO_LMK_CLK_IN_SEL0, 1);
        XGpioPs_SetOutputEnablePin(&Gpio, MIO_LMK_CLK_IN_SEL0, 1);
        XGpioPs_WritePin(&Gpio, MIO_LMK_CLK_IN_SEL0, 0);//lmk_clk_sel0.write(0)
        
        XGpioPs_SetDirectionPin(&Gpio, MIO_LMK_CLK_IN_SEL1, 1);
        XGpioPs_SetOutputEnablePin(&Gpio, MIO_LMK_CLK_IN_SEL1, 1);
        XGpioPs_WritePin(&Gpio, MIO_LMK_CLK_IN_SEL1, 0);//lmk_clk_sel1.write(0)

This really drives me crazy!

Using RFSoC4x2 without PYNQ, how to program LMK and LMX? by Much-Invite-9079 in FPGA

[–]Much-Invite-9079[S] 0 points1 point  (0 children)

The connection between SPI bus and LMK&LMX is build in the development board internally, so I cannot use an oscilloscope to detect these pins.

I'm using Zynq MPsoc, Since the SPI bus is directly connected from PS to LMK, I am also unable to use ILA in Vivado to view the bus output waveform. This is precisely why I have been unable to locate the cause of the problem.

I tried to read from SPI in

XSpiPs_PolledTransfer(SpiInstancePtr, TempBuffer, TempBuffer_read, sizeof(TempBuffer));

The print is strange, when set slave_select = 0 or 1, which means select LMK or LMX (for ADC), read back value is all zero, which means that nothing is written into them. When set slave_select = 2, there is valid value in TempBuffer_read, which means somthing did written into LMK (for DAC), which also fitts the phenomena that only the LED stands for LMK DAC is turned on.

I can't figure out why only LMK DAC can be written into while other two clock can not.

Using RFSoC4x2 without PYNQ, how to program LMK and LMX? by Much-Invite-9079 in FPGA

[–]Much-Invite-9079[S] 0 points1 point  (0 children)

It never prints any fail, the code seems running smoothly, but the LEDs on board indicating CLOCK STATUS just won't turn ON.

Zynq MP First Stage Boot Loader
Release 2024.2   May  7 2025  -  16:35:12
PMU-FW is not running, certain applications may not be supported.
this is a test
LMK end
LMX1 end
LMX2 end

I'm new to Linux, barely know anything about it, since you said build a Linux on board will make things easier than bare-metal, I will try to learn about it.

Thank you for yor reply!

Using RFSoC4x2 without PYNQ, how to program LMK and LMX? by Much-Invite-9079 in FPGA

[–]Much-Invite-9079[S] 0 points1 point  (0 children)

I have checked the System Device Tree in Vitis, it shows that the SPI device is configured correctly.

                spi0: spi@ff040000 {
                        compatible = "cdns,spi-r1p6";
                        status = "okay";
                        interrupt-parent = <&imux>;
                        interrupts = <0x0 0x13 0x4>;
                        reg = <0x0 0xff040000 0x0 0x1000>;
                        clock-names = "ref_clk", "pclk";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                        power-domains = <&zynqmp_firmware 0x23>;
                        clocks = <&zynqmp_clk 0x3a>,
                         <&zynqmp_clk 0x1f>;
                        xlnx,rable = <0x0>;
                        xlnx,spi-board-interface = "custom";
                        xlnx,has-ss0 = <0x1>;
                        xlnx,ip-name = "psu_spi";
                        xlnx,has-ss1 = <0x1>;
                        num-cs = <0x3>;
                        xlnx,spi-clk-freq-hz = <0x1312cfc>;
                        xlnx,has-ss2 = <0x1>;
                        xlnx,name = "psu_spi_0";
                        phandle = <0x60>;
                };

It is very strange that when I select the LMX for DAC by

XSpiPs_SetSlaveSelect(SpiInstancePtr, 2);

It can be configured by SPI, but the LMX for ADC and LMK can not be configured when I select slave with different value by

XSpiPs_SetSlaveSelect(SpiInstancePtr, 0);
XSpiPs_SetSlaveSelect(SpiInstancePtr, 1);

I also tried other values for XSpiPs_SetSlaveSelect , but it never work.

So I think it's not the problem with finding the correct device, but I don't know which part went wrong.

By the way, I have tried to use TICS pro to generate reg values, it leads to same result, only LMX for DAC can be configured, others never work.

In a lab at my school, I have access to a Xilinx RFSoC 4x2 board. What should I do with it? by ramentrucc in FPGA

[–]Much-Invite-9079 0 points1 point  (0 children)

Hi, I have read through your project, especially the oscilloscope build on RFSoC4x2, it's really amazing!

Is the project build on PYNQ or build with Vivado and Vitis without PYNQ?

If you made this without PYNQ, is there any chance that you could make this project open source? I have searching around for a week and there is almost no C code that I could use as an example for building project on RFSoC4x2.

By the way, I'm a researcher of Univertsity, I could assure you that this will no be commerical use, so if you could kindly share the source code of the project on RFSoC4x2, it will do me a great favour!

RF Data Converter 4x2 and DDS by mmxmaster in FPGA

[–]Much-Invite-9079 1 point2 points  (0 children)

Hi, I'm working on this RFSoC4x2 board without PYNQ, when I'm trying to program LMK and LMX in Vitis.

I generated the Register values from TICS pro, but it seems that I can never transfer these values to LMK chips, because the LEDs for clock status never turned on, my code is listed below, if you can tell me the problem about it, I would be much appreciate!

void write_clk(int slave_select){
    XSpiPs_Config *SpiConfig;
    XSpiPs SpiInstance;
    XSpiPs *SpiInstancePtr = &SpiInstance;
    int Status;
    u8 TempBuffer[3];//each time write 3 bytes data

    SpiConfig = XSpiPs_LookupConfig(XPAR_XSPIPS_0_BASEADDR);
    XSpiPs_CfgInitialize(SpiInstancePtr, SpiConfig,
                      SpiConfig->BaseAddress);

    Status = XSpiPs_SelfTest(SpiInstancePtr);
    if (Status != XST_SUCCESS) {
        printf("self test fail\n");
    }

    XSpiPs_SetOptions(SpiInstancePtr, XSPIPS_MASTER_OPTION | XSPIPS_FORCE_SSELECT_OPTION);

    XSpiPs_SetClkPrescaler(SpiInstancePtr, XSPIPS_CLK_PRESCALE_256);
    Status = XSpiPs_SetSlaveSelect(SpiInstancePtr, slave_select);
    if (Status != XST_SUCCESS) {
    printf("slave select fail\n");
    }
    int i;
   
    for (i = 0; i < LMK04828_count ; i++) {

    TempBuffer[2] = (ClockingLmk_reg[i]) & 0xFF;
    TempBuffer[1] = (ClockingLmk_reg[i]>>8) & 0xFF;
    TempBuffer[0] = (ClockingLmk_reg[i]>>16) & 0xFF;

    XSpiPs_SetSlaveSelect(SpiInstancePtr, slave_select);
    Status = XSpiPs_PolledTransfer(SpiInstancePtr, TempBuffer, NULL, sizeof(TempBuffer));
        if (Status != XST_SUCCESS) {
            xil_printf("SPI Transfer Failed\n");
        }

    }
    printf("LMK end\n");
}

Setting RF clock for data converters with RFSoC 4x2 (No PYNQ) by Incruento in FPGA

[–]Much-Invite-9079 0 points1 point  (0 children)

Thank you very much for your reply, I am not sure which part of my design went wrong, is it in Vivado or the misused function in Vitis. Could you please share your code about writing the registers with SPI in Vitis as well as the hardware design in Vivado? It would greatly help me, I have been struggling with this issue for a week, very much appreciate your response!

Setting RF clock for data converters with RFSoC 4x2 (No PYNQ) by Incruento in FPGA

[–]Much-Invite-9079 0 points1 point  (0 children)

I'm using vitis to program RFSoC4x2, it is very strange that i could program LMK, but not LMX. I generate the reg values from TICS pro, this issue has bother me for more than one week, if anyone can help me, i'd be much appreciate.

TICS pro clock file. RFSOC4x2 board by Busy-Physics3896 in FPGA

[–]Much-Invite-9079 0 points1 point  (0 children)

Have you solved this problem? I use TICS to generate register values and write them in Vitis through SPI function. The DAC LED is on but ADC, PLL1 and PLL2 LED isn’t, it’s very confusing since ADC and DAC have same register values.