cancel
Showing results for 
Search instead for 
Did you mean: 

Does HAL SPI receive library API requires a array initialized to zero before it is called

NKshi.1
Associate

Hello,

I have a STM32F401VDT6 microcontroller. I am using STM32CubeIde for programming and a HAL library of version 1.25.0. We have interfaced ADS1299 ADC chip to MCU over SPI peripheral. ADC chip generates the data ready signal once conversion complete and this signal is configured as hardware interrupt. Once signal is generated, MCU calls HAL_SPI_Receive_IT() API to read the data from chip. API requires a array to be passed to store data. We observed that, if we initialize array to zero using memset() function before calling receive API, ADC chip continues with n number of conversion. But if we remove memset() function, ADC chip stop conversion after some conversions.

We want to understand does HAL SPI library has some bug or is it recommended practice to initialize array before SPI receive call??

2 REPLIES 2
TDK
Guru

You do not need to initialize an array before using HAL_SPI_Receive_IT. There must be something else going on.

If you feel a post has answered your question, please click "Accept as Solution".

Thank you for reply. I will look into some other perspective why this issue is occurred.