Digilent / Eclypse-Z7-SW

7 stars 8 forks source link

Eclypse Z7 petalinux sd card release V0.2 seems incompatible with linux zmod_adc_dac SW demo #1

Closed 46cv8 closed 3 years ago

46cv8 commented 3 years ago

I've provided full details of my issue(s) on the digilent forum including screenshots. https://forum.digilentinc.com/topic/21036-eclypse-z7-axi-dma-buffer-malloc-always-returning-0null

I'm mainly concerned with the petalinux related issues here as I don't think I will end up using baremetal.

The software on the zmod_dac branch doesn't seem to work with the provided hardware and the V0.2 petalinux release image. For whatever reason the DMA is detected as supporting receive but not transmit, this causes it to fail to get a valid buffer address so it returns 0/null and causes a memory access violation. (When run in baremetal the buffer always gets an address of 0/null for some reason too (not sure what though).)

The software on the zmod_adc_dac branch (https://github.com/Digilent/Eclypse-Z7-SW/tree/zmod_adc_dac/master) Appears to correctly obtain a DMA buffer for both the ADC and DAC petalinux examples, however DMA transfers appear to never complete. The interrupt is never triggered so it stays hung waiting forever.

I'm relatively certain my hardware is OK because I have no issues running the low_level_zmod_adc_dac example. Could you please test the latest https://github.com/Digilent/Eclypse-Z7-SW/tree/zmod_adc_dac/master and confirm you are able to get the ADC and DAC petalinux examples to run using the latest V0.2 release? https://github.com/Digilent/Eclypse-Z7/releases

I'm happy to run any additional tests to provide you with information in addition to that provided on the digilent forum.

46cv8 commented 3 years ago

I've renamed the title based on my latest findings I posted on the digilent forum. I've included that quoted below.

Update: I was able to get the baremetal version of the code to work, if I removed the sd card from the EclypseZ7, repowered it and then repeated the manual fpga programming before launching the code. I'm not sure why I needed to remove the sd card in addition to reprogramming the fpga as I had already tried reprogramming the fpga and making sure that if it did use the bit file on the sdcard boot it would use the adc_dac file. I'm guessing some how petalinux was overriding the fpga image I was flashing from xilinx sdk before I could start the code. (seems unlikely though). Also I was able to confirm that the working code does actually have a buffer address of 0 when run in baremetal mode.

I still can't get the petalinux version to work though which is what I want to hopefully use. Any help for digilent in this regard would be great. So far it seems that the following are true for my case.

    the adc_dac file included with the V0.2 image doesn't seem to work with the petalinux code in the SW repo.
    If I remove the petalinux sdcard and program the fpga from xilinx sdk manually I can get the bare metal demo the work with
        the bit file in the SW repo folder design_1_wrapper_hw_platform_0
        my own custom built bit file based on the latest HW repo

So it seems like most likely the issue is with the V0.2 release image just not being compatible.

I guess my final request if possible would be if someone from Digilent has time could they please test they can get the petalinux SD card release image https://github.com/Digilent/Eclypse-Z7/releases to work with the linux DAC software demo? https://github.com/Digilent/Eclypse-Z7-SW/tree/zmod_adc_dac/master/ZmodDAC1411_Demo_Linux

I've tried rebuilding petalinux by following the directions on https://reference.digilentinc.com/reference/programmable-logic/eclypse-z7/customizing-zmods-os

As well as the instructions at https://github.com/Digilent/Eclypse-Z7-OS/tree/zmod_adc_dac/master

I tried both building an image based on the V0.2 release image (replacing the files in the boot partition as instructed) and it didn't work (possibly due to me lacking the knowledge about how to get my bit image to load to the fpga automatically, even though I also tried programming from Xilinx SDK manually after too).

I also tried building an image based on initramfs (to try to eliminate the possibility the issue was related to some files in the rootfs of the release image that were causing issues). I was unable to get this working (due to my own lack of knowledge though)

It would be great if I could get your release image SD card to work as it would give me a working starting ground.

For now though I will start work on my hardware design using baremetal until I hear back from you. 
46cv8 commented 3 years ago

After re-flashing my sd card I was able to get both the zmod_adc_dac and zmod_dac petalinux examples working. I can only think I did something wrong or damaged the sd card file system through improper shutdown. I'm closing this ticket as there doesn't appear to be any issues with your examples as far as I can tell. My apologies.