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

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: 1 time

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

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: 13520
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 861 times
Been thanked: 743 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: 1 time

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 3 times


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 3 guests