f4discovery/blackpill: fix usbusart
This commit is contained in:
parent
b076d5cea1
commit
f69f29a660
|
@ -54,7 +54,7 @@ To exit from dfu mode press a "key" and "reset", release reset. BMP firmware sho
|
|||
10 pin male from pins
|
||||
========================================
|
||||
|
||||
| PB3/TDO | PB7/RX | PB8/TX | X | PA1/TDI |
|
||||
| PB3/TDO | PB7/RX | PB6/TX | X | PA1/TDI |
|
||||
| -------- | ----------- | ---------- | ---------- | ------- |
|
||||
| PB4/SRST | +3V3/PB8 SW | PA13/SWDIO | PA14/SWCLK | GND |
|
||||
|
||||
|
|
|
@ -79,6 +79,26 @@
|
|||
#define LED_IDLE_RUN GPIO15
|
||||
#define LED_ERROR GPIO14
|
||||
#define LED_BOOTLOADER GPIO13
|
||||
|
||||
#define USBUSART USART1
|
||||
#define USBUSART_CR1 USART1_CR1
|
||||
#define USBUSART_DR USART1_DR
|
||||
#define USBUSART_IRQ NVIC_USART1_IRQ
|
||||
#define USBUSART_CLK RCC_USART1
|
||||
#define USBUSART_PORT GPIOB
|
||||
#define USBUSART_TX_PIN GPIO6
|
||||
#define USBUSART_RX_PIN GPIO7
|
||||
#define USBUSART_ISR(x) usart1_isr(x)
|
||||
#define USBUSART_DMA_BUS DMA2
|
||||
#define USBUSART_DMA_CLK RCC_DMA2
|
||||
#define USBUSART_DMA_TX_CHAN DMA_STREAM7
|
||||
#define USBUSART_DMA_TX_IRQ NVIC_DMA2_STREAM7_IRQ
|
||||
#define USBUSART_DMA_TX_ISR(x) dma2_stream7_isr(x)
|
||||
#define USBUSART_DMA_RX_CHAN DMA_STREAM5
|
||||
#define USBUSART_DMA_RX_IRQ NVIC_DMA2_STREAM5_IRQ
|
||||
#define USBUSART_DMA_RX_ISR(x) dma2_stream5_isr(x)
|
||||
/* For STM32F4 DMA trigger source must be specified */
|
||||
#define USBUSART_DMA_TRG DMA_SxCR_CHSEL_4
|
||||
#else
|
||||
#define PLATFORM_IDENT "(F4Discovery) "
|
||||
|
||||
|
@ -127,6 +147,26 @@
|
|||
#define LED_IDLE_RUN GPIO13
|
||||
#define LED_ERROR GPIO14
|
||||
#define LED_BOOTLOADER GPIO15
|
||||
|
||||
#define USBUSART USART3
|
||||
#define USBUSART_CR1 USART3_CR1
|
||||
#define USBUSART_DR USART3_DR
|
||||
#define USBUSART_IRQ NVIC_USART3_IRQ
|
||||
#define USBUSART_CLK RCC_USART3
|
||||
#define USBUSART_PORT GPIOD
|
||||
#define USBUSART_TX_PIN GPIO8
|
||||
#define USBUSART_RX_PIN GPIO9
|
||||
#define USBUSART_ISR(x) usart3_isr(x)
|
||||
#define USBUSART_DMA_BUS DMA1
|
||||
#define USBUSART_DMA_CLK RCC_DMA1
|
||||
#define USBUSART_DMA_TX_CHAN DMA_STREAM3
|
||||
#define USBUSART_DMA_TX_IRQ NVIC_DMA1_STREAM3_IRQ
|
||||
#define USBUSART_DMA_TX_ISR(x) dma1_stream3_isr(x)
|
||||
#define USBUSART_DMA_RX_CHAN DMA_STREAM1
|
||||
#define USBUSART_DMA_RX_IRQ NVIC_DMA1_STREAM1_IRQ
|
||||
#define USBUSART_DMA_RX_ISR(x) dma1_stream1_isr(x)
|
||||
/* For STM32F4 DMA trigger source must be specified */
|
||||
#define USBUSART_DMA_TRG DMA_SxCR_CHSEL_4
|
||||
#endif
|
||||
|
||||
#define BOOTMAGIC0 0xb007da7a
|
||||
|
@ -166,25 +206,6 @@
|
|||
#define IRQ_PRI_USBUSART_DMA (2 << 4)
|
||||
#define IRQ_PRI_TRACE (0 << 4)
|
||||
|
||||
#define USBUSART USART3
|
||||
#define USBUSART_CR1 USART3_CR1
|
||||
#define USBUSART_DR USART3_DR
|
||||
#define USBUSART_IRQ NVIC_USART3_IRQ
|
||||
#define USBUSART_CLK RCC_USART3
|
||||
#define USBUSART_PORT GPIOD
|
||||
#define USBUSART_TX_PIN GPIO8
|
||||
#define USBUSART_RX_PIN GPIO9
|
||||
#define USBUSART_ISR(x) usart3_isr(x)
|
||||
#define USBUSART_DMA_BUS DMA1
|
||||
#define USBUSART_DMA_CLK RCC_DMA1
|
||||
#define USBUSART_DMA_TX_CHAN DMA_STREAM3
|
||||
#define USBUSART_DMA_TX_IRQ NVIC_DMA1_STREAM3_IRQ
|
||||
#define USBUSART_DMA_TX_ISR(x) dma1_stream3_isr(x)
|
||||
#define USBUSART_DMA_RX_CHAN DMA_STREAM1
|
||||
#define USBUSART_DMA_RX_IRQ NVIC_DMA1_STREAM1_IRQ
|
||||
#define USBUSART_DMA_RX_ISR(x) dma1_stream1_isr(x)
|
||||
/* For STM32F4 DMA trigger source must be specified */
|
||||
#define USBUSART_DMA_TRG DMA_SxCR_CHSEL_4
|
||||
|
||||
#define TRACE_TIM TIM3
|
||||
#define TRACE_TIM_CLK_EN() rcc_periph_clock_enable(RCC_TIM3)
|
||||
|
|
Loading…
Reference in New Issue