2017-09-29 06:22 AM
Is there a bug in the HAL driver lib FW 1.1.0 ?
Because SPI4 is not supported.
In the routine HAL_SPI_TransmitReceive there is a question
'if (IS_SPI_HIGHEND_INSTANCE(hspi->Instance)) ...'
the else branch is empty/not existing.....
SPI4 is not a member of the HIGHEND instance !
#define IS_SPI_HIGHEND_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
((INSTANCE) == SPI2) || \ ((INSTANCE) == SPI3))Somebody has already used SPI4 ?
Is there a bug in the HAL lib, or have the prototyps of the H743 a bug in this section ?
Solved! Go to Solution.
2017-11-08 06:13 AM
Hello
Bremauer.Volker
,I confirm this is a bug.It seems that nothing is sent/received in case of SPI supporting only data transfer up to 16bits (SPI4 to SPI6 support up to 16-bit data mode).This issue is due to the wrong condition if (IS_SPI_HIGHEND_INSTANCE(hspi->Instance)) in the case of 8 and 16-bit modes.
Normally the condition IS_SPI_HIGHEND_INSTANCE should be applicable only for 32-bit mode (SPI1 to SPI3 support up to 32-bit data mode).
So, I suggested to you modify:
1- /* Transmit and Receive data in 32 Bit mode */
if (IS_SPI_HIGHEND_INSTANCE(hspi->Instance) && (hspi->Init.DataSize > SPI_DATASIZE_16BIT))
2- For receiving data in 8 and 16 Bit modes, remove the condition if (IS_SPI_HIGHEND_INSTANCE(hspi->Instance)).
This issue will be fixed in the next release of STM32CubeH7.
Thank you for highlighting this issue, and sorry for any inconvenience it may bring for you.
Best Regards
Imen
2017-09-29 08:58 AM
Hello
Bremauer.Volker
,Thank you for you reported issue.I will check this issueandraise it internally if confirmed.
I will keep you informed with updates.
Kind Regards
Imen
2017-11-08 06:13 AM
Hello
Bremauer.Volker
,I confirm this is a bug.It seems that nothing is sent/received in case of SPI supporting only data transfer up to 16bits (SPI4 to SPI6 support up to 16-bit data mode).This issue is due to the wrong condition if (IS_SPI_HIGHEND_INSTANCE(hspi->Instance)) in the case of 8 and 16-bit modes.
Normally the condition IS_SPI_HIGHEND_INSTANCE should be applicable only for 32-bit mode (SPI1 to SPI3 support up to 32-bit data mode).
So, I suggested to you modify:
1- /* Transmit and Receive data in 32 Bit mode */
if (IS_SPI_HIGHEND_INSTANCE(hspi->Instance) && (hspi->Init.DataSize > SPI_DATASIZE_16BIT))
2- For receiving data in 8 and 16 Bit modes, remove the condition if (IS_SPI_HIGHEND_INSTANCE(hspi->Instance)).
This issue will be fixed in the next release of STM32CubeH7.
Thank you for highlighting this issue, and sorry for any inconvenience it may bring for you.
Best Regards
Imen
2017-11-21 04:46 AM
I also find this bug today. It spent me a day to do with SPI4.
I think it should be modified like this:
if (hspi->Init.DataSize > SPI_DATASIZE_16BIT)
{ if (IS_SPI_HIGHEND_INSTANCE(hspi->Instance)) {}
}Another question: When will the new issue be published?
Thank you !
2018-01-09 01:52 PM
Same has to be done in HAL_SPI_Receive
- Joerg -
2018-01-11 07:21 AM
Hi
Wagner.Joerg
,Yes,we have already passed this issue concerned functions (HAL_SPI_Transmit(), HAL_SPI_Receive(), HAL_SPI_TransmitReceive()) along to our development team.
We are sorry for the inconvenience and thank you for your comprehension.
Kind Regards,
Imen.