SPI buffers larger than 16 bytes

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

cross mob
HeGi_2497906
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

I need to send 256 bytes, with a 4 bytes header, for a total of 260 bytes via SPI master.

Everything works fine with TX/RX  buffers set to 16bytes, and a 16 bytes data buffer. 

No matter what I do, when I increase the size of the data buffer, or the TX/RX buffers, or both, if stalls on the receive buffer full, I cannot find an example with a buffer larger than 8 or data buffer larger than 8, can someone help me understand what I am missing? 

I know it is interrupt related, but I cannot figure out what to handle to make this work?

H

0 Likes
5 Replies
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @HeGi_2497906,

  • Which device or kit are you using?
  • Are both the master and the slave in the same kit, or are you using two different kits?

Regards,
Nikhil

0 Likes
HeGi_2497906
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

I am using a CYBLE-012011 on a custom pcb, using SPI to access a MX253235F Macronix serial flash device.  I have to rewrite the flash from a BLE down load of data, one page is 256Bytes. 

I can see the 260Bytes going out the MOSI line (header+page of data), but the function locks up on checking the receive buffer, never leaves that function, so the buffer is not managed properly to complete the transaction.  I just need to know what I need to do to get it to complete the transaction?

0 Likes
Raj_C
Moderator
Moderator
Moderator
250 solutions authored 500 replies posted 50 likes received

Hi @HeGi_2497906,

Please, refer to the thread "PSOC6 DMA block selection for SPI " and the response from HARI as follows:

Raj_JC_0-1656957763836.png

Thank you

Best Regards

Raj Chaudhari


 

0 Likes

RaJ, That link is for PSoC6, I am using PSoC4

0 Likes
Raj_C
Moderator
Moderator
Moderator
250 solutions authored 500 replies posted 50 likes received

Hi @HeGi_2497906,

You can refer to the above example and implement it in the PSoC 4. Implement a ping-pong descriptor that transmits the required data. 

Thank you

Best Regards

Raj Chaudhari

0 Likes