From 0b58a8b06224e29a514737e204b69ad9fcb6f297 Mon Sep 17 00:00:00 2001 From: tfcollins Date: Wed, 25 Feb 2026 08:05:08 -0500 Subject: [PATCH] Add workaround for HDL limitation on DMA for AD4630-24 design Signed-off-by: tfcollins --- +adi/+AD463x/Base.m | 16 +++++++++++++++- examples/ad4630_DataCapture.m | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/+adi/+AD463x/Base.m b/+adi/+AD463x/Base.m index 2686242..1076882 100644 --- a/+adi/+AD463x/Base.m +++ b/+adi/+AD463x/Base.m @@ -32,6 +32,10 @@ isOutput = false end + properties(Access = protected) + InSetup = false; + end + properties (Abstract, Nontunable, Hidden) Timeout kernelBuffersCount @@ -81,8 +85,10 @@ end % Connects to device temporarily and fetches the channel names + obj.InSetup = true; obj.setup(); release(obj); + obj.InSetup = false; end function set.SamplesPerFrame(obj, value) @@ -138,6 +144,14 @@ function setupInit(obj) end obj.set_channel_names(); + if obj.InSetup + obj.EnabledChannels = 1:length(obj.channel_names); + else + % This looks like an HDL bug, but all channels need to be + % enabled or they will timeout or not correctly be configured + assert(length(obj.EnabledChannels)==length(obj.channel_names), ... + 'All channels must be enabled for platform'); + end end @@ -147,7 +161,7 @@ function set_channel_names(obj) chanCount = obj.iio_device_get_channels_count(phydev); for c = 1:chanCount chanPtr = obj.iio_device_get_channel(phydev, c - 1); - obj.channel_names{end + 1} = obj.iio_channel_get_name(chanPtr); + obj.channel_names{end + 1} = obj.iio_channel_get_id(chanPtr); end end diff --git a/examples/ad4630_DataCapture.m b/examples/ad4630_DataCapture.m index c296161..40a5fba 100644 --- a/examples/ad4630_DataCapture.m +++ b/examples/ad4630_DataCapture.m @@ -15,7 +15,7 @@ % Only a select few channel groupings yield sensible outputs. Refer to the % Limitations section in the documentation for more details -rx.EnabledChannels = [1]; +rx.EnabledChannels = [1,2]; % Capture data data = rx();