This directory contains assembly language examples related to SPI.
This example for consists of two discovery boards connected to each other,
where spi-c.s is the controller which sends a character
(currently A
) to spi-p.s which is the peripheral. The peripheral
then uses UART to send that character out which can be displayed using minicom.
$ make spi-c.elf spi-p.elf
Connect the USB micro cable to the STM32 ST-LINK port on the board that is going to be used as the peripheral.
Start openocd:
$ make openocd
Start a telnet session:
$ telnet localhost 4444
Flash the program:
> reset halt
> flash write_image erase spi-p.elf.hex
> reset run
Connect the USB micro cable to the STM32 ST-LINK port on the board that is going to be used as the controller.
Start openocd:
$ make openocd
Start a telnet session:
$ telnet localhost 4444
Flash the program:
> reset halt
> flash write_image erase spi-c.elf.hex
> reset run
Start minicom
:
$ minicom --baudrate 115200 --device /dev/ttyUSB0
Next press the reset button on the controller board and 'A7' should be displayed in minicom: