偶然看到https://hackaday.io/project/186329-32mhz-spectrum-sdr-ft8-in-an-fpga大佬开源了矿渣板SDR。正好手里有矿渣板,准备复刻山寨一个,JLC打样了一个扩展板,实物如下:
记录一下山寨过程,先从最简单的AD采样,通过以太网把数据送到PC,PC端显示频谱的例程开始:
1.VIVADO搭建工程,原工程:https://github.com/guido57/EBAZ4205_Spectrum
2.修改XDC文件,综合实现,生成.xsa文件
3.在ubuntu里安装petalinux,然后新建工程
petalinux-create --type project --template zynq --name ebaz4205
4.把.xsa文件拷贝到ebaz4205目录下
cd ebaz4205
petalinux-config --get-hw-description=.
5.配置根文件系统
petalinux-config -c rootfs
选择Filesystem Packages -> misc -> gcc-runtime -> libstdc,保存退出
6.修改project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi ,内容如下:
/include/ "system-conf.dtsi"
/ {
chosen {
bootargs = "earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait cma=256M ";
};
};
7.修改/components/plnx_workspace/device-tree/device-tree/system-conf.dtsi关于nand的部分如下:
&nfc0 {
nand@0 {
partitions {
partition@0 {
label = "nand-boot";
reg = <0x0 0x00000000 0x00500000>;
};
partition@1 {
label = "nand-kernel";
reg = <0x0 0x00500000 0x00a80000>;
};
partition@2 {
label = "nand-bootenv";
reg = <0x0 0x00f80000 0x00020000>;
};
partition@3 {
label = "nand-device-tree";
reg = <0x0 0x00fa0000 0x00400000>;
};
partition@4 {
label = "nand-rootfs";
reg = <0x0 0x013a0000 0x03c00000>;
};
};
};
};
8.编译,生成BIN和WIC文件
petalinux-build
petalinux-package --boot --force --fsbl ./images/linux/zynq_fsbl.elf --fpga ./project-spec/hw-description/ebaz4205_wrapper.bit --u-boot
petalinux-package --wic
9.用balenaEtcher把wic文件烧写到TF卡,上电启动即可,注意默认的用户名是petalinux