DMA streams/channel reallocation on a STM32F767

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

joaquin
Posts: 38
Joined: Sat Jan 22, 2011 8:44 pm
Has thanked: 1 time
Been thanked: 3 times

DMA streams/channel reallocation on a STM32F767

Postby joaquin » Fri Dec 07, 2018 6:48 pm

I'd appreciatte any help on this question, it seems basic but I'm unable to understand how an STM32F767 does DMA stream/channel allocation.
I have a Nucleo-767 board, and I'm doing a port from a STM32F103 to this new board. Whit the last peripheral (UART7) I have a assert error "stream already allocated" for UART7-RX.

In fact, the channel/stream (1, 3) was identical to the one used by I2C2_RX. From another questions I saw that the only reallocations allowed were those contained at corresponding "stm32_registry.h" (I can't locate that limitation at the reference manual), so I tried the following alternatives for the peripherals I use:

Code: Select all

#define STM32_ADC_ADC1_DMA_STREAM           STM32_DMA_STREAM_ID(2, 4)
#define STM32_I2C_I2C2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3) => (1, 2)
#define STM32_I2C_I2C2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7) => (1, 4)
#define STM32_I2C_I2C4_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2) => (1, 5)
#define STM32_I2C_I2C4_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 6)
#define STM32_SPI_SPI4_RX_DMA_STREAM        STM32_DMA_STREAM_ID(2, 0)
#define STM32_SPI_SPI4_TX_DMA_STREAM        STM32_DMA_STREAM_ID(2, 1)
#define STM32_UART_USART1_RX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 5)
#define STM32_UART_USART1_TX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 7)
#define STM32_UART_UART5_RX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 0)
#define STM32_UART_UART5_TX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 7)
#define STM32_UART_USART6_RX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 2)
#define STM32_UART_USART6_TX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 7) => (2, 6)
#define STM32_UART_UART7_RX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 3)  ====> ORIGINAL PROBLEM!!
#define STM32_UART_UART7_TX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 1)


However, the working code stopped working: I2C4 was unable to send data. As a bad solution, I have use interrupts instead of DMA for I2C (by declaring STM32_I2C_USE_DMA FALSE on mcuconf.h).

Any ideas would be welcomed...

User avatar
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: DMA streams/channel reallocation on a STM32F767

Postby Giovanni » Fri Dec 07, 2018 6:57 pm

Valid DMAs are those described in tables 24 and 25 of the RM which should be the same you see in the registry.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 8 guests