mikroBUS
Introduction
The mikroBUS is a standard connector with a predetermined pin assignment to allow the creation of portable add-on hardware that can be used on several different platforms requiring only adjustments on teh software side. It is currently implemented by the Hummingboard Gate and the Clearfog Pro.
PIN Header
Pin to GPIO mapping on Clearfog Pro:
AN
MCP3021 (via i2c)
RST
MPP29
CS
MPP43
SCK
MPP57
MISO
MPP58
MOSI
MPP56
PWM
MPP54
INT
MPP22
RX
MPP24
TX
MPP25
SCL
MPP26
SDA
MPP27
Enable pin function / clickboard in DeviceTree
To actually use the mikroBUS pins with a userspace application or from a kernel driver, their specific function has to be enabled in the kernel DeviceTree file. The DTS files to be modified are available in the kernel tree, under arch/arm/boot/dts/ For the Clearfog Pro it is called armada-388-clearfog.dts. Any modifications belong inside the main {} block, the one that contains the model property, i.e. model = “SolidRun Clearfog A1”;
SPI
This is an example for a device attached to the SPI Bus:
I2C
i2c is already preconfigured to provide userspace access via /dev/i2c-1 on the clearfog. The userspace i2c-tools can be used, e.g. i2cdetect
the i2c userspace interface, be it /dev/isc-* or i2c-tools, expect a 7-bit device address! This is because the read/write bit is not considered part of the address by the driver.
Keep away from device address 0xA0 and 0xA1 (7-bit: 0x50). these are reserved for the SFP module!
UART
TBD
GPIO
TBD
(Re-)Compile DeviceTree
Generically speaking, the raw .dts files can be compiled into .dtb using the device-tree-compiler dtc. The most straightforward way to invoke it is by configuring the linux kernel tree, and then running
The kernel-tree needs to be configured first. Please refer to A388 Kernel for generic instructions, or consult the distro documentation
DTB files can also be de- and recompiled. Consult the manpage of dtc for additional information.
Examples
EEPROM 3 click
This chip listens on multiple i2c addresses to facilitate access to all the eeprom memory addresses. The AT24CM02 datasheet explains this in detail!
This is example code for writing the value 0x2A to address 0x0000
Because reading from a specific address is harder, there is no sample available yet.
Yes No
Last updated