Hi guys,
I believe there is an error in the macros in hal_i2s_lld.h that check whether correct DMA streams are configured in mcuconf.h.
Beginning in line 260 (/* Check on the validity of the assigned DMA channels.*/) the macro STM32_DMA_IS_VALID_ID is executed for every RX and TX channel. However, the required STM32_SPIx_RX_DMA_MSK is not defined for devices with DMAMUX peripheral, which leads to the error "invalid DMA stream associated to SPIx RX/TX".
In hal_spi_lld.h there is a differentiation between all devices (checked with STM32_DMA_IS_VALID_STREAM) and an additional check for devices without DMAMUX (line 392) with the macro STM32_DMA_IS_VALID_ID from above.
Copying the code from hal_spi_lld.h to hal_i2s_lld.h (and adjusting all occurrences of SPI to I2S) solves the problem.
Checking validity of DMA channels in I2S LLD on devices with DMAMUX peripheral Topic is solved
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Checking validity of DMA channels in I2S LLD on devices with DMAMUX peripheral
Hi,
Thanks for finding, could you post the modified file or a patch? (zipped or the forum would reject it)
Giovanni
Thanks for finding, could you post the modified file or a patch? (zipped or the forum would reject it)
Giovanni
Re: Checking validity of DMA channels in I2S LLD on devices with DMAMUX peripheral
Hi,
sure, see attached file. I also included a modified hal_spi_lld.h, as in line 336 only TX channel for SPI1 is checked and I think check for RX channel is missing.
As i mentioned, this is all regarding SPIv2 for STM32.
sure, see attached file. I also included a modified hal_spi_lld.h, as in line 336 only TX channel for SPI1 is checked and I think check for RX channel is missing.
As i mentioned, this is all regarding SPIv2 for STM32.
- Attachments
-
- hal_i2s_lld_fix.zip
- (5.2 KiB) Downloaded 101 times
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Checking validity of DMA channels in I2S LLD on devices with DMAMUX peripheral
bumping as self-reminder
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Checking validity of DMA channels in I2S LLD on devices with DMAMUX peripheral
Hi,
Fixed bug #1229.
Fixed the missing check in the SPI driver, the I2S file was wrong, it checked SPI settings instead of I2S, it appears OK on the repository.
Giovanni
Fixed bug #1229.
Fixed the missing check in the SPI driver, the I2S file was wrong, it checked SPI settings instead of I2S, it appears OK on the repository.
Giovanni
Who is online
Users browsing this forum: No registered users and 35 guests