This directory contains assembly language examples related to I2C.
This example for consists of two discovery boards connected to each other,
where i2c-c.s is the controller which sends a character
(currently A
) to i2c-p.s which is the peripheral. The peripheral
then uses UART to send that character out which can be displayed using minicom.
$ make i2c-c.elf i2c-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 i2c-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 i2c-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: