Checking validity of DMA channels in I2S LLD on devices with DMAMUX peripheral Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
jherold
Posts: 2
Joined: Sun Apr 11, 2021 1:33 pm
Been thanked: 3 times

Checking validity of DMA channels in I2S LLD on devices with DMAMUX peripheral  Topic is solved

Postby jherold » Sun Apr 11, 2021 1:47 pm

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.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Checking validity of DMA channels in I2S LLD on devices with DMAMUX peripheral

Postby Giovanni » Sun Apr 11, 2021 2:34 pm

Hi,

Thanks for finding, could you post the modified file or a patch? (zipped or the forum would reject it)

Giovanni

jherold
Posts: 2
Joined: Sun Apr 11, 2021 1:33 pm
Been thanked: 3 times

Re: Checking validity of DMA channels in I2S LLD on devices with DMAMUX peripheral

Postby jherold » Sun Apr 11, 2021 2:40 pm

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.
Attachments
hal_i2s_lld_fix.zip
(5.2 KiB) Downloaded 98 times

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Checking validity of DMA channels in I2S LLD on devices with DMAMUX peripheral

Postby Giovanni » Sun Dec 05, 2021 10:47 am

bumping as self-reminder

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Checking validity of DMA channels in I2S LLD on devices with DMAMUX peripheral

Postby Giovanni » Fri Mar 18, 2022 10:16 am

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


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 20 guests