STMicroelectronics / STM32CubeH7

STM32Cube MCU Full Package for the STM32H7 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
https://www.st.com/en/embedded-software/stm32cubeh7.html
Other
477 stars 299 forks source link

Is it reasonable for HAL library SPI to judge RXP in blocking receive 8bit mode? Again, because of the old code to determine the RXWNE/FRLVL flag #249

Closed wdfk-prog closed 3 months ago

wdfk-prog commented 1 year ago

Describe the set-up

Additional context

Screenshots If applicable, add screenshots to help explain your problem.

HBOSTM commented 1 year ago

Hello @wdfk-prog,

Would you please give us more details about how you got this issue? And please share snippet of the code you have used to reproduce this problem.

With regards,

wdfk-prog commented 1 year ago

Hello @HBOSTM ,

fandelxin commented 1 year ago

HAL library version updated from V1.10 to V1.11. I have the same problem. If the data in flash (W25Q) is read continuously through SPI, there is a certain probability that it will timeout. The timeout is in this place "HAL_SPI_Receive ->if (__HAL_SPI_GET_FLAG (hspi, SPI_FLAG_RXP)"

axbusch commented 1 year ago

the new SPI H7 driver also has a problem with optimization & blocking mode

i used the old driver for stm32f4 without any problems in Keil armclang 6 with o1, o2, or o3. No Problem.

The new driver works only with o0. i think there is something optimized away(missing volatile or sth like that) i will try to reproduce and dig deeper to provide more information

escherstair commented 9 months ago

Hello @ASELSTM, @HBOSTM, @TOUNSTM I can add some information from my side, in case it helps. I have a code that works on STM32H7 with library V1.10 and that doesn't work anymore after the upgrade to V1.11. It's compiled with ARMCLANG 6, with O1 optimization, so similar to what @fandelxin described in his post. I use TransmitAndReceive in blocking mode, 8 bit, as described by @wdfk-prog

This is what my code does, and what I see with library V1.11:

I had to downgrade to V1.10 and this is a showstopper for my project. I need a fix as soon as possible.

Let me know if I can do something in my investigation to help the team.

escherstair commented 8 months ago

Hi @HBOSTM do you need some other detailon the issue, or is it clear? @wdfk-prog , @fandelxin , @axbusch do you have any news in the meanwhile?

This issue is a showstopper for me, and I had to downgrade

undisclosed67 commented 5 months ago

Regrettably, I am experiencing similar issues with the SPI peripheral, after upgrading to FW Package v1.11.1. I am not able to investigate further at this time, but I had it working again by reverting both stm32h7xx_hal_spi.c and stm32h7xx_hal_spi.h to version v1.10. I would like to thank the ST team for the hard work put into this. I know what it means.

escherstair commented 5 months ago

I can give an update on my issue (not sure if this is the same for the others).

Not sure why this happened.

KRASTM commented 4 months ago

Hello All,

thank you for your Reports.

@wdfk-prog: the issue has already been fixed internally, and it will be available on the next release of STM32CubeH7 Firmware.

Regarding the problem with the function HAL_SPI_Receive(), Please refer to last comment 47

With regards,

KRASTM commented 4 months ago

ST Internal Reference: 172042

wdfk-prog commented 4 months ago

大家好,

感谢您的报告。

@wdfk-prog:该问题已在内部修复,并将在下一版本的 STM32CubeH7 固件中提供。

关于函数HAL_SPI_Receive()的问题,请参考最后评论47

带着敬意,

KRASTM commented 4 months ago

Hello @wdfk-prog,

Attached the update files, but please be careful because it contains many changes. It may cause some errors while building your project. In that case, you must wait for the release (which will be available after a few days).

Otherwise, I hope it will be useful and good luck.

H7_HAL_SPI.zip

With regards.

TOUNSTM commented 3 months ago

Fixed in abbf9ca1b36c9abdb9339e86f0b7b2f4e79edc35