cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in HAL_SPI_Receive

shar9393
Associate
Posted on October 07, 2016 at 02:31

 

 

The original post was too long to process during our migration. Please click on the attachment to read the original post.
3 REPLIES 3
Nesrine M_O
Lead II
Posted on October 07, 2016 at 12:13

Hi Alex,

Thanks for highlighting this issue, we are aware about it but the fix has not yet been released on the web.

-Syrine-

shar9393
Associate
Posted on October 14, 2016 at 22:37

Thank you. Hope to see fix soon.

stefano239955_st
Associate
Posted on November 03, 2016 at 18:30

Hi,

I'm trying to have 3-wires SPI high speed communication using a Nucleo F746ZG working at 192MHz.

My goal is to have an efficient (no dead time) 3-wire SPI communication.

I'm afraid it is an impossible task.

SPI2 is configured in half duplex mode. Let us start one byte RX using HAL_SPI_receive():

HAL_SPI_Receive(&hspi2, data, 1, 1);

In RX mode, to enable SPI clock the driver setsSPI_1LINE_RX(hspi).

The issue is that to stop SPI clock we need to disable SPI peripheral. Disable time depends on software and we have more SPI clock pulses then expected. The faster is the SPI clock the more extra clock we have.

Alex modified HAL_SPI_RECEIVE anticipating _HAL_SPI_DISABLE(hspi);

Using high SPI clock speed the trick does not work. At 12MHz SPI clock, to read a single byte, we generate 16 clock pulses instead of 8 and at 24MHz we have much more clock pulses and clock remains high level at the end of transfer. (please see pictures)

I tried also DMA:HAL_SPI_Receive_DMA(&hspi2, data, 1)but I have more extra clock pulses than withHAL_SPI_Receive. It means that SPI peripheral is disabled later.

Please, do you have any suggestion or I have to give up?

Than you!

Stefano

________________

Attachments :

12MHZ.bmp : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htgm&d=%2Fa%2F0X0000000aVl%2FkpIQz6RNSce0Yt3MJG9zlowz3zfPCPKxwQ_JVkLe6eE&asPdf=false

24MHZ.bmp : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htgw&d=%2Fa%2F0X0000000aVn%2FVSjTggS0TGWE3KzrQRRr5UwVPozHiyz9OxEckJhmhrI&asPdf=false