- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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.
Thanks
Deepak H M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @RodolfoGL
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,
CYBSP_SPI_CS,NULL,BITS_PER_FRAME,
CYHAL_SPI_MODE_00_MSB,false);
handle_error(result);
/* Set the SPI baud rate */
result = cyhal_spi_set_frequency(&mSPI, SPI_FREQ_HZ);
handle_error(result);
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.
Thanks
Deepak H M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?