no-OS
no-OS copied to clipboard
AD738x IIO Example Fails
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:
- When voltage0 and voltage1 both are enabled, the oscilloscope reads the data fine.
- When any 1 of voltage0 or voltage1 is enabled, the code reaches hardfault.
- The
ad738x_read_data_dma()setsspi_msg.bytes_number = samples * 4butiio_ad738x.csets the ADC data to be of 2Bytes through#define AD738X_ADC_RESOLUTION 16and#define AD738X_CHN_STORAGE_BITS 16. - 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
Tested the IIO example, the voltage in DMM doesn't match the voltage supplied through the inputs.