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

cross mob
MiladMrad
Level 2
Level 2
10 replies posted First like given 5 questions asked

Hi. 
I'm using 

cyhal_spi_transfer(cyhal_spi_t *obj, const uint8_t *tx, size_t tx_length, uint8_t *rx, size_t rx_length, uint8_t write_fill)

function to transfer a larg bunch of data (1250 bytes) over spi. it works very well if I have a tx buffer and a rx buffer. 
However, If I just wanna use this function to receive same amount of b

bytes by doing:

cyhal_spi_transfer(&mSPI, NULL, 0, rx_buffer,  1250, 0xff);

it will have two long pauses in the middle:

MiladMrad_0-1704668365674.png

it sends 1 byte, then pause, then send 1248 bytes, then pause, then another single byte. 
Is there any work around for this? (except having a dummy tx buffer (I'm already doing it))
I'm running on cy8cking-062s2-43012 kit. SPI 6 on P12 at 25MHz master. CPU and clocks at 100MHz, 

 

0 Likes
1 Solution
Ekta
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi @MiladMrad 

You are correct, this is a known issue with cyhal_spi_transfer function.

And the recommended workaround is the one you are already using, i.e., to provide txBuffer with a writefill value so that after all TX data transfered, the write_fill value (provided by user) is being sent until all RX data recieved.

The fix for this issue will be available in the next release of mtb-pdl-cat1 which is going to be released shortly.

Hope this helps.

Best Regards
Ekta

View solution in original post

2 Replies
Ekta
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi @MiladMrad 

You are correct, this is a known issue with cyhal_spi_transfer function.

And the recommended workaround is the one you are already using, i.e., to provide txBuffer with a writefill value so that after all TX data transfered, the write_fill value (provided by user) is being sent until all RX data recieved.

The fix for this issue will be available in the next release of mtb-pdl-cat1 which is going to be released shortly.

Hope this helps.

Best Regards
Ekta

MiladMrad
Level 2
Level 2
10 replies posted First like given 5 questions asked

Hi @Ekta ,
Thanks for letting me know about the issue. 
I'll keep this thread open and will try with the new release and will update here. 
Cheers, 
Milad. 

0 Likes