in stm32_registry.h there are declarations like these for every peripheral.
Code: Select all
#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
I have a usecase where I intend to use both SPI1 an USART1 which are mapped to the same DMA stream by default. However, the hardware supports remapping those to
Code: Select all
#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
via
Code: Select all
/**
* Remap USART1 DMA to CH5/CH6
*/
SYSCFG->CFGR1 |= SYSCFG_CFGR1_USART1_TX_DMA_RMP | SYSCFG_CFGR1_USART1_RX_DMA_RMP:
I have tried using board.h and mcuconf.h for overriding, however these files are included before the registry files. Therefore the registry will take preference.
This leads me to my questions:
1) Is there a preferred place where to override definitions from the registry?
2) If not, wouldn't it be smarter to include mcuconf.h AFTER the registry in all headers in order to allow overrides?
Best regards, Uli