I finally have some more time for experimenting with OpenMV. Since I want it to control a hexapod robot, that’s a lot of servos to take care of. So I built myself a simple servo controller based on a Pro Mini, with which I can communicate over I²C, basically just sending the servo positions to the registers. I have tested it with Raspberry Pi and PyBoard, and it all works perfectly fine there.
Today I tried connecting it to OpenMV. Here are my results:
- First of all, the labels at https://openmv.io/docs/openmv/quickref.html are wrong – the SDA and SCL are swapped. SCL is PB11 and SDA is PB10.
- Scanning initially works. Just after connecting the OpenMV board and initializing the I2C class, I can do scan() and it shows my device.
- Writing to the device doesn’t seem to do anything (at least my device doesn’t receive correct data).
- As soon as I try writing, either with send() or mem_write(), scan() only returns an empty list, and any further writes result in OSError: 16.
- That continues through soft-reset (ctrl+d) and reset of my device. Only switching the OpenMV off and on again resets it to the initial state.
Below is an example session demonstrating what I mean:
>>> import pyb >>> import ustruct >>> bus = pyb.I2C(2, pyb.I2C.MASTER) >>> bus.scan()  >>> bus.mem_write(ustruct.pack("<H", 1500), 9, 0) >>> bus.scan()  >>> bus.mem_write(ustruct.pack("<H", 1500), 9, 0) Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: 16 >>> Micro Python v1.4.4-125-g07c8f99 on 2015-08-18; OPENMV2 with STM32F427 Type "help()" for more information. >>> import pyb >>> bus = pyb.I2C(2, pyb.I2C.MASTER) >>> bus.scan() 
Am I doing something wrong? Is there anything I should try?