Skip to content

Latest commit

 

History

History
66 lines (52 loc) · 1.43 KB

README.md

File metadata and controls

66 lines (52 loc) · 1.43 KB

Serial Peripheral Interface (SPI)

This directory contains assembly language examples related to SPI.

SPI Controller/Peripheral example

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.

Building

$ make spi-c.elf spi-p.elf

Flash and Run the peripheral

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

Flash and Run the controller

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:

SPI Example image