From 57be9af6fc90a7c2377b1765b97c5fac607b672e Mon Sep 17 00:00:00 2001 From: Julia Pineda Date: Wed, 13 Mar 2024 10:28:29 +0800 Subject: [PATCH] debug DMA tests Signed-off-by: Julia Pineda --- +adi/+AD9081/Base.m | 6 +++--- test/AD9081HWTests.m | 10 ++++++++-- test/runHWTests.m | 8 ++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/+adi/+AD9081/Base.m b/+adi/+AD9081/Base.m index 2e7295fe..12bbfba3 100644 --- a/+adi/+AD9081/Base.m +++ b/+adi/+AD9081/Base.m @@ -84,9 +84,9 @@ doNotCloseConnection = false; end if isTx - dev = obj.phyDev; - else dev = obj.iioDev; + else + dev = obj.phyDev; end %% Parse data path configuration @@ -136,7 +136,7 @@ ss = 'D'; end numFDUCX = 0; numCDUCX = 0; - for DC = 0:7 + for DC = 0:7 % why is this 0 to 7? for k=1:length(filteredMap) if contains(filteredMap{k},sprintf('FD%sC%d',ss,DC)) numFDUCX = numFDUCX + 1; diff --git a/test/AD9081HWTests.m b/test/AD9081HWTests.m index 30f56c1b..f6ab5c84 100644 --- a/test/AD9081HWTests.m +++ b/test/AD9081HWTests.m @@ -1,7 +1,7 @@ classdef AD9081HWTests < HardwareTests properties - uri = 'ip:analog.local'; + uri = 'ip:localhost'; author = 'ADI'; end @@ -15,7 +15,7 @@ function CheckForHardware(testCase) end methods (Static) - function estFrequency(data,fs,saveNoShow,figname) + function freq = estFrequency(data,fs,saveNoShow,figname) nSamp = length(data); FFTRxData = fftshift(10*log10(abs(fft(data)))); % df = fs/nSamp; freqRangeRx = (-fs/2:df:fs/2-df).'/1000; @@ -221,6 +221,12 @@ function testAD9081RxWithTxData(testCase) % plot(real(out)); freqEst = meanfreq(double(real(out)),sr); + f = figure('visible','on'); + figname = 'freq_plot'; + meanfreq(double(real(out)),sr) + saveas(f,figname,'png') + saveas(f,figname,'fig') + testCase.verifyTrue(valid); testCase.verifyGreaterThan(sum(abs(double(out))),0); diff --git a/test/runHWTests.m b/test/runHWTests.m index 00743545..fcbe53ef 100644 --- a/test/runHWTests.m +++ b/test/runHWTests.m @@ -66,10 +66,10 @@ function runHWTests(board) fclose(fid); catch e disp(getReport(e,'extended')); - bdclose('all'); - exit(1); +% bdclose('all'); +% exit(1); end save(['BSPTest_',datestr(now,'dd_mm_yyyy-HH_MM_SS'),'.mat'],'t'); - bdclose('all'); - exit(exitcode); +% bdclose('all'); +% exit(exitcode); end