Configuration of GPIO, USART, DMA and SPI peripherals to transmit bytes between a USART and an SPI (in slave mode) in DMA mode. This example is based on the STM32C0xx USART LL API. The peripheral initialization uses LL unitary service functions for optimization purposes (performance and size).
This example works with only one NUCLEO-C071RB.
USART1 Peripheral is acts as Master. SPI1 Peripheral is configured in Slave mode. GPIO associated to User push-button is linked with EXTI.
Example execution:
LED1 is blinking Fast (200ms) and wait User push-button action. Press User push-button on BOARD start a Full-Duplex communication through DMA. On USART1 side, Clock will be generated on SCK line, Transmission done on TX, reception on RX. On SPI1 side, reception is done through the MOSI Line, transmission on MISO line.
At end of transmission, both received buffers are compared to expected ones. In case of both transfers successfully completed, LED1 is turned on. In case of errors, LED1 is blinking Slowly (1s).
Connectivity, UART/USART, Synchronous, baud rate, DMA, SPI interface, Receiver, Transmitter, full-duplex
This example runs on STM32C071RBTx devices.
This example has been tested with NUCLEO-C071RB board and can be easily tailored to any other supported device and development board.
NUCLEO-C071RB Set-up
Board connector:
In order to make the program work, you must do the following :