no-OS icon indicating copy to clipboard operation
no-OS copied to clipboard

AD738x IIO Example Fails

Open SwaroopPKADI opened this issue 9 months ago • 1 comments

The IIO Example for AD738x fails when a single channel is enabled in the oscilloscope. I did a preliminary debugging from my end and found the following:

  1. When voltage0 and voltage1 both are enabled, the oscilloscope reads the data fine.
  2. When any 1 of voltage0 or voltage1 is enabled, the code reaches hardfault.
  3. The ad738x_read_data_dma() sets spi_msg.bytes_number = samples * 4 but iio_ad738x.c sets the ADC data to be of 2Bytes through #define AD738X_ADC_RESOLUTION 16 and #define AD738X_CHN_STORAGE_BITS 16.
  4. When DMA is triggered, the extra 2Bytes per sample corrupts _events[] from 'stm32_irq.h` which eventually leads to Hardfault during DMA completion Interrupt.

As in the below images, the S0M0AR + S0NDTR exceeds _events[8].actions and _events[10].actions

Image

Image

SwaroopPKADI avatar Feb 19 '25 09:02 SwaroopPKADI

Tested the IIO example, the voltage in DMM doesn't match the voltage supplied through the inputs.

Image

SwaroopPKADI avatar Feb 24 '25 07:02 SwaroopPKADI