Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AD738x IIO Example Fails #2463

Open
SwaroopPKADI opened this issue Feb 19, 2025 · 1 comment
Open

AD738x IIO Example Fails #2463

SwaroopPKADI opened this issue Feb 19, 2025 · 1 comment

Comments

@SwaroopPKADI
Copy link
Collaborator

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 SwaroopPKADI changed the title AD738x IIO Example Fails with Single Channel AD738x IIO Example Fails Feb 24, 2025
@SwaroopPKADI
Copy link
Collaborator Author

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

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant