Skip to content

Commit 9ebc57b

Browse files
committed
changed manifesto install script with makefile
1 parent e7b9d8f commit 9ebc57b

File tree

5 files changed

+33
-316
lines changed

5 files changed

+33
-316
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore all .mnfb files
2+
*.mnfb

manifesto/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
SRC_DIR := ../clicks
2+
BUILD_DIR := build
3+
SRCS := $(wildcard $(SRC_DIR)/**/**/*.mnfs)
4+
BINS := $(patsubst %.mnfs, $(BUILD_DIR)/%.mnfb, $(notdir $(SRCS)))
5+
6+
$(BUILD_DIR)/%.mnfb: $(SRC_DIR)/**/**/%.mnfs
7+
mkdir -p $(dir $@)
8+
./manifesto -I mnfs -O mnfb -o $@ $<
9+
10+
all: $(BINS)
11+
12+
install:
13+
mkdir -p $(DESTDIR)/lib/firmware/mikrobus
14+
install -m 0644 $(BUILD_DIR)/*.mnfb $(DESTDIR)/lib/firmware/mikrobus
15+
16+
PHONY: clean
17+
clean:
18+
rm -r $(BUILD_DIR) || true
19+
20+

manifesto/README.md

Lines changed: 11 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -7,180 +7,28 @@ Provided under BSD license. See *LICENSE* for details.
77

88
### Creating a Manifest Blob
99

10-
For creating a manifest blob(.mnfb) from a manifest file(.mnfs) :
11-
```
12-
manifesto -i /path/to/input.mnfs -o /path/to/output.mnfb
13-
```
14-
15-
## Install
16-
17-
For generating the manifest blobs from all the manifest sources in the manifest/ directory , run the installation script:
10+
# usage: manifesto [-h] [-I {mnfs,mnfb}] [-o OUT] [-O {mnfs,mnfb}] [-s] infile
1811

12+
For creating a manifest blob(.mnfb) from a manifest file(.mnfs) :
1913
```
20-
sh install.sh
14+
manifesto -I mnfs -O mnfb -o /path/to/output.mnfb /path/to/input.mnfs
2115
```
2216

23-
## Reproducing the Results using PocketBeagle
24-
25-
Flash the testing image with the mikrobus driver available at [https://rcn-ee.net/rootfs/bb.org/testing/2020-08-15/buster-iot-mikrobus/](https://rcn-ee.net/rootfs/bb.org/testing/2020-08-15/buster-iot-mikrobus/) using [Etcher](https://www.balena.io/etcher/), then to load the mikrobus driver:
26-
27-
Then edit the uEnv.txt to load the overlays for the mikrobus port-0 and port-1 on the pocketbeagle
28-
```
29-
sudo nano /boot/uEnv.txt
30-
(Edit the below lines)
31-
#uboot_overlay_addr0=/lib/firmware/<file0>.dtbo
32-
#uboot_overlay_addr1=/lib/firmware/<file1>.dtbo
33-
(to)
34-
uboot_overlay_addr0=/lib/firmware/PB-MIKROBUS-0.dtbo
35-
uboot_overlay_addr1=/lib/firmware/PB-MIKROBUS-1.dtbo
36-
```
17+
Usage:
3718

38-
Then clone the manifesto repository and checkout the mikrobusv3 branch and create all the manifest binaries:
19+
Clone the repository and create all the manifest binaries:
3920
```
40-
git clone https://github.com/vaishnav98/manifesto.git
21+
git clone https://github.com/MikroElektronika/click_id.git
4122
cd manifesto
42-
git checkout mikrobusv3
43-
./install.sh (will take about a minute)
44-
```
45-
The click can now be plugged in to the mikrobus port and the manifest binary can be passed to the mikrobus driver to load the click device driver(s), the manifests under manifests/ directory are TESTED and the test script provided can be used for testing different click.
46-
47-
### Test Script Usage
48-
49-
```
50-
debian@beaglebone:~/manifesto$ ./test
51-
board name> MPU- (Press Tab to Auto complete from list of supported clicks)
52-
MPU-9DOF-CLICK MPU-IMU-CLICK
53-
board name> MPU-9DOF-CLICK
54-
port> mikrobus- (Press Tab to Auto complete from list of attached mikrobus port)
55-
mikrobus-0 mikrobus-1
56-
port> mikrobus-0
57-
testing MPU-9DOF-CLICK on mikrobus-0
58-
59-
[ 2805.111767] mikrobus_manifest:mikrobus_manifest_parse: MPU 9DOF Click manifest parsed with 1 devices
60-
[ 2805.111813] mikrobus:mikrobus_port_pinctrl_select: setting pinctrl pwm_default
61-
[ 2805.111824] mikrobus:mikrobus_port_pinctrl_select: setting pinctrl uart_default
62-
[ 2805.111836] mikrobus:mikrobus_port_pinctrl_select: setting pinctrl i2c_default
63-
[ 2805.111848] mikrobus:mikrobus_port_pinctrl_select: setting pinctrl spi_default
64-
[ 2805.111873] mikrobus mikrobus-0: registering device : mpu9150
65-
[ 2805.169305] inv-mpu6050-i2c 1-0068: mounting matrix not found: using identity...
66-
[ 2805.169346] inv-mpu6050-i2c 1-0068: supply vdd not found, using dummy regulator
67-
[ 2805.169445] inv-mpu6050-i2c 1-0068: supply vddio not found, using dummy regulator
68-
[ 2805.280525] inv-mpu6050-i2c 1-0068: whoami mismatch got 0x71 (MPU9250)expected 0x68 (MPU9150)
69-
IN_ACCEL_Z_CALIBBIAS /sys/bus/iio/devices/iio:device1/in_accel_z_calibbias : -2045
70-
IN_ANGLVEL_Z_RAW /sys/bus/iio/devices/iio:device1/in_anglvel_z_raw : -13
71-
IN_ANGLVEL_Y_CALIBBIAS /sys/bus/iio/devices/iio:device1/in_anglvel_y_calibbias : 0
72-
IN_ACCEL_Y_RAW /sys/bus/iio/devices/iio:device1/in_accel_y_raw : -200
73-
IN_MAGN_Z_SCALE /sys/bus/iio/devices/iio:device1/in_magn_z_scale : 0.003574
74-
IN_ANGLVEL_SCALE /sys/bus/iio/devices/iio:device1/in_anglvel_scale : 0.001064724
75-
IN_ACCEL_MOUNT_MATRIX /sys/bus/iio/devices/iio:device1/in_accel_mount_matrix : 1, 0, 0; 0, 1, 0; 0, 0, 1
76-
IN_MAGN_Z_RAW /sys/bus/iio/devices/iio:device1/in_magn_z_raw : -8
77-
IN_ACCEL_X_CALIBBIAS /sys/bus/iio/devices/iio:device1/in_accel_x_calibbias : 8684
78-
IN_TEMP_SCALE /sys/bus/iio/devices/iio:device1/in_temp_scale : 2.941176
79-
IN_ACCEL_Z_RAW /sys/bus/iio/devices/iio:device1/in_accel_z_raw : 17212
80-
IN_MAGN_X_SCALE /sys/bus/iio/devices/iio:device1/in_magn_x_scale : 0.003574
81-
IN_ACCEL_SCALE /sys/bus/iio/devices/iio:device1/in_accel_scale : 0.000598
82-
IN_ANGLVEL_Z_CALIBBIAS /sys/bus/iio/devices/iio:device1/in_anglvel_z_calibbias : 0
83-
IN_ANGLVEL_SCALE_AVAILABLE /sys/bus/iio/devices/iio:device1/in_anglvel_scale_available : 0.000133090 0.000266181 0.000532362 0.001064724
84-
IN_ACCEL_SCALE_AVAILABLE /sys/bus/iio/devices/iio:device1/in_accel_scale_available : 0.000598 0.001196 0.002392 0.004785
85-
IN_ANGLVEL_X_RAW /sys/bus/iio/devices/iio:device1/in_anglvel_x_raw : 78
86-
IN_TEMP_OFFSET /sys/bus/iio/devices/iio:device1/in_temp_offset : 12420
87-
IN_ACCEL_Y_CALIBBIAS /sys/bus/iio/devices/iio:device1/in_accel_y_calibbias : 3831
88-
IN_ANGLVEL_X_CALIBBIAS /sys/bus/iio/devices/iio:device1/in_anglvel_x_calibbias : 0
89-
IN_MAGN_X_RAW /sys/bus/iio/devices/iio:device1/in_magn_x_raw : -17
90-
IN_MAGN_Y_SCALE /sys/bus/iio/devices/iio:device1/in_magn_y_scale : 0.003574
91-
IN_ANGLVEL_MOUNT_MATRIX /sys/bus/iio/devices/iio:device1/in_anglvel_mount_matrix : 1, 0, 0; 0, 1, 0; 0, 0, 1
92-
IN_ACCEL_MATRIX /sys/bus/iio/devices/iio:device1/in_accel_matrix : 0, 0, 0; 0, 0, 0; 0, 0, 0
93-
IN_ANGLVEL_Y_RAW /sys/bus/iio/devices/iio:device1/in_anglvel_y_raw : -65
94-
IN_ACCEL_X_RAW /sys/bus/iio/devices/iio:device1/in_accel_x_raw : 320
95-
IN_MAGN_MOUNT_MATRIX /sys/bus/iio/devices/iio:device1/in_magn_mount_matrix : 0, 1, 0; 1, 0, 0; 0, 0, -1
96-
IN_GYRO_MATRIX /sys/bus/iio/devices/iio:device1/in_gyro_matrix : 0, 0, 0; 0, 0, 0; 0, 0, 0
97-
IN_TEMP_RAW /sys/bus/iio/devices/iio:device1/in_temp_raw : 1493
98-
IN_MAGN_Y_RAW /sys/bus/iio/devices/iio:device1/in_magn_y_raw : -33
99-
remove board[y/n]> y
100-
[ 2818.790861] mikrobus mikrobus-0: removing device mpu9150
101-
debian@beaglebone:~/manifesto$
102-
```
103-
104-
### Loading Add-on Board (Debug Interface run as root)
105-
106-
```
107-
cat manifests/BOARD_NAME.mnfb > /sys/class/mikrobus-port/mikrobus-0/new_device
108-
cat manifests/WEATHER-CLICK.mnfb > /sys/class/mikrobus-port/mikrobus-0/new_device
109-
```
110-
### Unloading the Add-on Board (Debug Interface run as root)
111-
112-
```
113-
echo 0 > /sys/class/mikrobus-port/mikrobus-0/delete_device
23+
make all
24+
sudo make install
11425
```
26+
The click can now be plugged in to the mikrobus port and the manifest binary can be passed to the mikrobus driver to load the click device driver(s)
11527

11628
### Writing a Manifest Blob to EEPROM
11729

118-
For writing a manifest blob(.mnfb) created from a manifest file(.mnfs) to an EEPROM (the EEPROM probe is specific to the type of EEPROM) :
119-
```
120-
echo 24c32 0x57 > /sys/bus/i2c/devices/i2c-1/new_device
121-
./manifesto -i manifests/mpu9dof.mnfs -o /sys/bus/nvmem/devices/1-00570/nvmem
122-
echo 0x57 > /sys/bus/i2c/devices/i2c-1/delete_device
123-
```
124-
125-
### Writing a Manifest Blob to Click ID EEPROM
126-
127-
If a valid manifest binary is not found in the Click ID EEPROM, the device is exposed as a NVMEM device and the manifest can be written to the EEPROM in the following manner.
128-
```
129-
$ ./manifesto -i manifests/RTC-6-CLICK.mnfs -o /sys/bus/nvmem/devices/mikrobus-port0/nvmem
130-
$ hexdump /sys/bus/nvmem/devices/mikrobus-port0/nvmem (reading back written manifest)
131-
0000000 0074 0100 0008 0001 0201 0000 0018 0002
132-
0000010 0110 694d 726b 456f 656c 746b 6f72 696e
133-
0000020 616b 0000 0014 0002 020b 5452 2043 2036
134-
0000030 6c43 6369 006b 0000 0010 0005 0104 0707
135-
0000040 0606 0505 0505 0102 0008 0004 0001 0301
136-
0000050 0014 0007 0301 6f03 0000 0000 0000 0000
137-
0000060 0000 0000 0010 0002 0308 636d 3770 3439
138-
0000070 7831 0000 0000 0000 0000 0000 0000 0000
139-
0000080 ffff ffff ffff ffff ffff ffff ffff ffff
140-
*
141-
```
142-
143-
### Writing Manifests for new Add-On Boards
144-
145-
For writing manifests for new add-on boards using an interactive interface head over to https://vaishnavachath.github.io/manifesto/
146-
147-
### Status of Supported Add-on Boards
148-
149-
To see the status of Supported add-on boards, view [this CSV sheet](click_info.csv)
150-
151-
### Hardware Modifications
152-
153-
Some of the Existing Clicks require minor hardware modifications to work with the kernel driver correctly. This section maintains the list of the clicks which require hardware modifications:
154-
155-
* GNSS ZOE Click : Swap COMM SEL Jumpers Default Position to select UART.
156-
* GNSS Clicks: All GNSS Clicks are Supported through the gnss linux subsytems, so their COMM SEL Default position needs to be in the UART Position
157-
* 6 LoWPAN T Click : The driver requires fifo, fifop, sfd, cca, vreg and reset gpio of which vreg, reset and fifo gpios are routed to the mikroBUS headers correctly but the
158-
other GPIOs are not accessible, GPIO 2,3,4 from CC2520 needs to be routed to the mikroBUS headers(GPIO reference 1MHZ Clock is not necessary).
159-
* 6 LoWPAN C Click : The driver requires fifo, fifop, sfd, cca, vreg and reset gpio of which vreg, reset and fifo gpios are routed to the mikroBUS headers correctly but the
160-
other GPIOs are not accessible, GPIO 2,3,4 from CC2520 needs to be routed to the mikroBUS headers(GPIO reference 1MHZ Clock is not necessary).
161-
162-
### Kconfig
163-
This list contains a few dependent Kconfig settings that needs to be applied(if you are testing all of the supported) apart from the Click Driver Kconfig.
164-
30+
For writing a manifest blob(.mnfb) created from a manifest file(.mnfs) to an click :
16531
```
166-
CONFIG_MODULES=y
167-
CONFIG_SYSFS=y
168-
CONFIG_I2C=y
169-
CONFIG_SPI=y
170-
CONFIG_GPIOLIB=y
171-
CONFIG_PWM=y
172-
CONFIG_IIO=m
173-
CONFIG_MIKROBUS=m
174-
CONFIG_STAGING=y
175-
CONFIG_FB=y
176-
CONFIG_FB_TFT=m
177-
CONFIG_NET=y
178-
CONFIG_NETDEVICES=y
179-
CONFIG_ETHERNET=y
180-
CONFIG_NET_VENDOR_MICROCHIP=y
181-
CONFIG_MMC=m
182-
CONFIG_RTC_CLASS=y
183-
CONFIG_NFC=m
184-
CONFIG_NFC_DIGITAL=m
32+
dd if=/lib/firmware/mikrobus/your_manifest.mnfb of=/sys/bus/w1/devices/w1_bus_master1-<unique ID>/mikrobus_manifest
18533
```
18634

0 commit comments

Comments
 (0)