We are using secureblinky project as our base project and we are trying to use the HAL libraries but we are facing the issue in cyhal_spi_transfer api.
The procedure I am following is,
cyhal_spi_init to init the spi pins and to configure in master mode.
cyhal_spi_set_frequency to set the frequency at 10Mhz
cyhal_spi_transfer to send a stream of data
After the transfer API the system will hang and I am not able to see any output on the oscilloscope.
Kindly help me to resolve this.
Deepak H M
Check the return value when calling cyhal_spi_init. The initialization might be failing, which means the SPI object is invalid, which might cause a hard fault if using with other functions.
I am using this error handling function to check the spi init errors I dont see anything failing here.
result = cyhal_spi_init(&mSPI,CYBSP_SPI_MOSI,CYBSP_SPI_MISO,CYBSP_SPI_CLK,
/* Set the SPI baud rate */
result = cyhal_spi_set_frequency(&mSPI, SPI_FREQ_HZ);
Also if we use the single byte transfer we are able to send a data successfully. i.e. "cyhal_spi_send" this API. if we use the transfer API i.e. "cyhal_spi_transfer" we are seeing the issue.
Deepak H M
Maybe the problem is related to the way the TX/RX buffers are allocated and accessed.
Can you share the code around your cyhal_spi_transfer call?
Hi @deepakhm09 ,
The thread was locked due to inactivity for a long time. You can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.