STM32F100: UART1 and I2C2 simultaneously
Posted: Thu Aug 29, 2013 10:30 am
Hi,
I'm trying to use both UARTD1 and I2C2 on an STM32F101 (similar to an STM32F100). I have my board defined, and I'm getting debug text out the serial port. The serial port will be the primary means of communication with this device.
I noticed that when I initialize I2C2 before UARTD1, I'm able to see text on the serial port but I only get the I2C address emitted on the I2C bus. Weirdly, it looks like the I2C data is ending up on the serial port rather than getting sent.
If I initialize UARTD1 before I2C2, then I2C2 is able to send data but I get no serial text at all.
In my mcuconf.h I have I2C2 on DMA priority 3, and USART1 at priority 0.
I did notice that both UARTD1 and I2C2 are defined to have their TX and RX DMA stream IDs set as STM32_DMA_STREAM_ID(1,4) and STM32_DMA_STREAM_ID(1,5) respectively, but I'm not sure how to change that.
How can I use both UARTD1 and I2C2 at the same time?
I'm trying to use both UARTD1 and I2C2 on an STM32F101 (similar to an STM32F100). I have my board defined, and I'm getting debug text out the serial port. The serial port will be the primary means of communication with this device.
I noticed that when I initialize I2C2 before UARTD1, I'm able to see text on the serial port but I only get the I2C address emitted on the I2C bus. Weirdly, it looks like the I2C data is ending up on the serial port rather than getting sent.
If I initialize UARTD1 before I2C2, then I2C2 is able to send data but I get no serial text at all.
In my mcuconf.h I have I2C2 on DMA priority 3, and USART1 at priority 0.
I did notice that both UARTD1 and I2C2 are defined to have their TX and RX DMA stream IDs set as STM32_DMA_STREAM_ID(1,4) and STM32_DMA_STREAM_ID(1,5) respectively, but I'm not sure how to change that.
How can I use both UARTD1 and I2C2 at the same time?