Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
deepakhm09
Level 1
Level 1
5 replies posted 10 sign-ins 5 sign-ins

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

 

0 Likes
4 Replies
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

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.

0 Likes
deepakhm09
Level 1
Level 1
5 replies posted 10 sign-ins 5 sign-ins

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

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

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?

0 Likes
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

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.

Best Regards,

Aashita

0 Likes