Jump to content

bpwilliams

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

bpwilliams's Achievements

Newbie

Newbie (1/4)

2

Reputation

  1. I was able to get 1.3 ms of data with a block-ram depth of 131072 (per channel). This corresponds to kBufferSize =17 and DMA Buffer Length Register =19. When I tried a design to get 2.6 ms, it gave me an error that I was out of block-RAM. Thanks again! Brian
  2. Awesome, this was the trick! I also fixed the mask error I introduced. The DMA buffer length register was set to 16 I changed it to 17. I can now collect 320 us. I'll let you know what the maximum capture time ends up being. Thanks so much! ⭐ ⭐ ⭐ ⭐
  3. I'm trying to just increase the BRAM size to take ~3.2 ms of continuous data. So far, as a test I have increased the kBufferSize from 14 to 15 which should give me ~320 us of data. I changed kBufferSize in several modules : 'AXI_zmodADC1410_v1_0.vhd' (default and customization options) 'Circular_Buffer.vhd' 'Circular_Buffer--Block Memory Generator' (16384-->32768) Also had to change In Circular_Buffer.vhd line 94, 96 change line 94: addra : IN STD_LOGIC_VECTOR(13 DOWNTO 0); -->addra : IN STD_LOGIC_VECTOR(kBufferSize-1 DOWNTO 0); line 96: addrb : IN STD_LOGIC_VECTOR(13 DOWNTO 0); -->addrb : IN STD_LOGIC_VECTOR(kBufferSize-1 DOWNTO 0); On the software side: Changed 'zmodadc1410.h' line #define ZMODADC1410_MAX_BUFFER_LEN 0x3FFF --> #define ZMODADC1410_MAX_BUFFER_LEN 0x7FFF 'zmodadc1410.cpp' (perhaps a mistake here?) uint16_t ZMODADC1410::channelData(uint8_t channel, uint32_t data) { //return (channel ? (data >> 2) : (data >> 18)) & 0x00003FFF; return (channel ? (data >> 2) : (data >> 18)) & 0x00007FFF; } Finally I changed the acquisition length to 32768; I am still getting the first 160 us of data but just zero values for the rest. Any idea what I missed? Are there any changes necessary to the DMA structure? Thanks!
  4. Got it working! Here's my cheat sheet to replicate. Install PetaLinux 2019.1, my install directory is in /home/bw/Xilinx/petalinux-v2019.1 *** You will also need Vivado 2019.1 and SDK 2019.1 if you want to run baremetal or modify the actual hardware project (do additional/different stuff on the FPGA). *** To collect data with the ADC in Linux using the demo setup, I think you just need Petalinux 2019.1 Get Ubuntu and Format SD Card (just do steps 2, 5, and 6 in link): https://medium.com/developments-and-implementations-on-zynq-7000-ap/install-ubuntu-16-04-lts-on-zynq-zc702-using-petalinux-2016-4-e1da902eaff7 Get the Digilent Demo for the Eclypse Z7 Zmod ADC 1410: git clone --recursive https://github.com/Digilent/Eclypse-Z7 -b zmod_adc/master Source your Petalinux: source /home/bw/Xilinx/petalinux-v2019.1/settings.sh The libuio.git build links do not work in this Eclypse-Z7 petalinux project. My workaround is to go into Eclypse-Z7/os/project-spec/meta-user/recipes-apps and delete the 'libuio' folder. Then later you can install libuio manually in the Ubuntu OS running on the Eclypse Z7. From Eclypse-Z7/os/ directory run (change to your appropriate directory, probably not "bw"!): petalinux-config --get-hw-description=/home/bw/Documents/fpga/Eclypse-Z7/hw/hw_handoff/ ***In this menu set the rootfs to run from SD card petalinux-config -c kernel ***In this menu goto device drivers-->userspace I/O-->select (*) all Xilinx UIO options ***also device drivers-->IRQ chipset-->the Xilinx option (not 100% sure you need this) ***save the file by entering on save option, quick keys MAY be unreliable petalinux-build petalinux-package --boot --force --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/system.bit --u-boot Copy image.ub, boot.bin, and system.dtb from images folder into boot parition on SD card. You also need a uEnv.txt (given below at end of this). You should now also have Ubuntu as a rootfs on the SD card, copy the 'ZmodADC1410_Demo_Linux' and the 'zmodlib' folders into a folder onto the rootfs partion, I put mine into /home/ubuntu/RH Move ZmodADC1410 demo app from Eclypse-Z7-SW folder onto Eclypse Z7 Ubuntu rootfs add LINUX_APP to compile for example: g++ -std=c++11 -Wall -DLINUX_APP dma.c -c You need to compile all the .c files within the subfolders of zmodlib many files require adding #include <stdbool.h>, those needing it will give you an error about "bool" this or that Some may require libuio.h which I got from: git clone --recursive https://github.com/Digilent/libuio checkout you can then ``make" these files to build a library to put with outher library files in /lib/ for example you can also put libuio.h into /usr/include list of files to compile: dma.c, libaxidma.c, flash.dma, reg.dma, utils.c, zmod.cpp, zmodadc1410.cpp Finally, go to the directory holding main.cpp, for me its /home/ubuntu/RH/ZmodADC1410_Demo_Linux/src/ Link/compile main.cpp g++ -std=c++11 -DLINUX_APP main.cpp -o main -I "../../zmodlib/" -I "../../zmodlib/Zmod/" -I "../../zmodlib/Zmod/linux/" -I "../../zmodlib/Zmod/linux/dma/" -I "../../zmodlib/Zmod/linux/flash/" -I "../../zmodlib/Zmod/linux/reg/" -I "../../zmodlib/ZmodADC1410/" ../../zmodlib/Zmod/linux/reg/reg.o ../../zmodlib/Zmod/linux/flash/flash.o ../../zmodlib/Zmod/linux/dma/dma.o ../../zmodlib/Zmod/linux/dma/libaxidma.o ../../zmodlib/Zmod/linux/utils.o ../../zmodlib/ZmodADC1410/zmodadc1410.o ../../zmodlib/Zmod/zmod.o -luio You can now run it with: sudo ./main Won't run without sudo, some permission issue with axidma. (perhaps someone knows how to fix?) ################################### uEnv.txt ################################################### # Eclypse boot configuration #VARIABLES #Zmod configuratio to use: adc, dac, adc-dac zmod=system fdn=0 bit_addr=0x10000000 dtb_addr=0x11000000 img_addr=0x11400000 img_name=image.ub dtb_name=system.dtb ####### To evaluate before use eval_variables=\ setenv bit_name zm-${zmod}.bit; \ setenv dtb_name zm-${zmod}.dtb; \ setenv bootargs console=ttyPS0,115200 earlyprintk cma=25M uio_pdrv_genirq.of_id=generic-uio root=/dev/mmcblk0p2 rw rootwait; ####### To run mmc_fpga=load mmc 0:1 $bit_addr $bit_name && fpga loadb $fdn $bit_addr $filesize; mmc_dtb=load mmc 0:1 $dtb_addr $dtb_name #mmc_boot=load mmc 0:1 $img_addr $img_name && bootm $img_addr:kernel@1 - $img_addr:fdt@system-top.dtb $bootargs; mmc_boot=load mmc 0:1 $img_addr $img_name && bootm $img_addr:kernel@1 - $dtb_addr $bootargs; ####### Entry point uenvcmd=run eval_variables && run mmc_fpga && run mmc_dtb && run mmc_boot;
  5. Made some progress, I used g++ (was using gcc before) to compile all the source files: g++ -std=c++11 -Wall -DLINUX_APP reg.c -c Then my final linking command was g++ -std=c++11 -DLINUX_APP main.cpp -o main -I "../../zmodlib/" -I "../../zmodlib/Zmod/" -I "../../zmodlib/Zmod/linux/" -I "../../zmodlib/Zmod/linux/dma/" -I "../../zmodlib/Zmod/linux/flash/" -I "../../zmodlib/Zmod/linux/reg/" -I "../../zmodlib/ZmodADC1410/" ../../zmodlib/Zmod/linux/reg/reg.o ../../zmodlib/Zmod/linux/flash/flash.o ../../zmodlib/Zmod/linux/dma/dma.o ../../zmodlib/Zmod/linux/dma/libaxidma.o ../../zmodlib/Zmod/linux/utils.o ../../zmodlib/ZmodADC1410/zmodadc1410.o ../../zmodlib/Zmod/zmod.o -luio -lstdc++ However, not currently seeing my linux dma device. I will summarize my steps completely once I resolve that issue.
  6. Thanks, I'm compiling the source files in their respective directories with compile commands like gcc -DLINUX_APP reg.c -c -luio
  7. I am using the master branch of zmodlib and I've also tried the one that came with the first ZmodADC1410 demo. I am going into the subfolders and compiling dependencies such as reg.c, dma.c, etc. using commands similar to: gcc -DLINUX_APP reg.c -c -luio For some of these files I had to add the #include <stdbool.h> header to compile it. For cpp files zmod.cpp and zmodadc1410.cpp I am using: gcc -std=c++11 -DLINUX_APP zmodadc1410.cpp -c -luio I am then trying to link to the main.cpp for the ZmodADC1410_Demo_Linux using linking command: gcc -std=c++11 -DLINUX_APP main.cpp -o main -I "../../zmodlib/" -I "../../zmodlib/Zmod/" -I "../../zmodlib/Zmod/linux/" -I "../../zmodlib/Zmod/linux/dma/" -I "../../zmodlib/Zmod/linux/flash/" -I "../../zmodlib/Zmod/linux/reg/" -I "../../zmodlib/ZmodADC1410/" ../../zmodlib/Zmod/linux/reg/reg.o ../../zmodlib/Zmod/linux/flash/flash.o ../../zmodlib/Zmod/linux/dma/dma.o ../../zmodlib/Zmod/linux/dma/libaxidma.o ../../zmodlib/Zmod/linux/utils.o ../../zmodlib/ZmodADC1410/zmodadc1410.o ../../zmodlib/Zmod/zmod.o -luio -lstdc++ I also uploaded an image depciting the directory structure. I'm not super competent in building/linking things so hopefully I am just doing it incorrectly. Thanks for you help.
  8. I am trying to run the ZmodADC1410 demo directly on Ubuntu with a Petalinux built kernel running on the Eclypse Z7 board. I have successfully run the demo using SDK but want to do development directly on the device. When I try to build the project natively I get errors, in part: zmod.cpp:(.text+0x22): undefined reference to `fnInitZmod(unsigned int, int, void*, void*)' zmod.cpp:(.text+0x32): undefined reference to `fnInitDMA(unsigned int, dma_direction, int)' zmod.cpp:(.text+0x44): undefined reference to `fnInitFlash(unsigned int, unsigned short)' All other errors are similar in that they are looking for 'fnSOMETHING()' type definitions. Is there a file or library specifically in the sysroot files or somewhere else I am missing? I can see the device in /sys/class/uio and the dma device. Thanks!
×
×
  • Create New...