Skip to content

Commit e7b9d8f

Browse files
committed
Updated readme
1 parent 5718521 commit e7b9d8f

File tree

2 files changed

+64
-6
lines changed

2 files changed

+64
-6
lines changed

README.md

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ ClickID is a hardware & software solution based on a secure authenticator device
4545
![clickIDDiagram](images/ClickID.png)
4646
Fig 1. - The block diagram of ClickID functionality
4747

48-
## Click information in EEPROM
48+
## ClickID Memory Organization
4949

5050
Each [Click Board™](https://www.mikroe.com/click-boards) is described and identified by the information stored in the EEPROM memory of the [Click Board™](https://www.mikroe.com/click-boards). The [DS28E36](https://datasheets.maximintegrated.com/en/ds/DS28E36.pdf) is used as ID MCU for storing the manifest file and unique identifier of the [Click Board™](https://www.mikroe.com/click-boards). In the table below, you can see EEPROM memory organization:
5151

5252
The EEPROM memory is divided into two slices:
5353

5454
- permanent data - it is written to a zero page at production time, and this page is locked for changes.
55-
- configurable data - it's starting for the first sector, and it is rewritable. This part of EEPROM is reserved for configurable information (Default: Here will be a click manifest used by Embedded Linux OS)
55+
- configurable data - it's starting for the first sector, and it is rewritable. This part of EEPROM is reserved for configurable information (Default: Here will be a [Click Board™](https://www.mikroe.com/click-boards) manifest used by Embedded Linux OS)
5656

5757
![Information in first sector](images/fixed_data.png)
58-
Fig 2. The Click's permanent information is stored in the zero sector, and the manifest is stored in the rest of the EEPROM.
58+
Fig 2. The [Click Board™](https://www.mikroe.com/click-boards) permanent information is stored in the zero sector, and the manifest is stored in the rest of the EEPROM.
5959

6060

6161
**Permanent data description**
@@ -71,7 +71,7 @@ Fig 3. The permanent information
7171
- **Custom** - 1 bit
7272
* 0 - Standard Mikroelektronika's board
7373
* 1 - Customized board for customer
74-
- **Type** - 10 bits (big-endian). Product type (click, display, MCU card, etc.)
74+
- **Type** - 10 bits (big-endian). Product type ([Click Board™](https://www.mikroe.com/click-boards), display, MCU card, etc.)
7575
- **Reserved** - 5 bits reserved in case that should be needed to increase the length of fields custom or serial
7676
- **Serial** - 16 bits (little-endian) reserved for current Mikroelektronika's EPR PID number of hardware board
7777

@@ -80,7 +80,65 @@ Fig 3. The permanent information
8080

8181
## Variable data
8282

83-
This is a part of the EEPROM memory, where we store user-configurable information. By default, that is a manifest binary file that contains the necessary information for a specific Linux driver for the [Click Board™](https://www.mikroe.com/click-boards). Further, this section will describe the Click's manifest file format required for the ClickID driver in the Linux kernel. Click manifest is derived from the Greybus manifest. The detailed specification of the Greybus manifest can be read [here](https://raw.githubusercontent.com/cfriedt/greybus-for-zephyr/master/doc/GreybusSpecification.pdf).
83+
This is a part of the ID chip memory, where we store user-configurable information. By default, that is a [ClickID manifest](#clickid-manifest) binary file that contains the necessary information for a specific Linux driver for the [Click Board™](https://www.mikroe.com/click-boards).
84+
85+
## Embedded Linux and ClickID
86+
87+
For the purpose of identifying [Click Board™](https://www.mikroe.com/click-boards) in the Embedded Linux enviroment, [mikroBUS™ kernel driver](https://github.com/Ayush1325/linux/tree/mikrobus-base/drivers/misc/mikrobus) has been developed in collaboration with the [BeagleBoard Foundation](https://www.beagleboard.org/).
88+
To take full advantage of the clickID hot-plug functionality, it is necessary to have a Linux image kernel with the [mikroBUS driver](https://github.com/Ayush1325/linux/tree/mikrobus-base/drivers/misc/mikrobus) enabled.
89+
90+
Currently available images with the driver enabled are:
91+
- [BeagleBoard images](https://www.beagleboard.org/distros)
92+
93+
If you use one of the mentioned images, it is enough to simply plug the [Click Board™](https://www.mikroe.com/click-boards) into the mikroBUS socket, and Linux will automatically connect your [Click Board™](https://www.mikroe.com/click-boards) with the appropriate driver and expose the interface for working with it.
94+
95+
Information about the loaded driver can be found at the location ```/sys/bus/mikrobus/devices/mikrobus-0```. Additionally, some basic information can be seen through `dmesg (dmesg | grep mikrobus)`.
96+
97+
Depending on the type of mikroBUS™ Add-On board, the Linux driver could be of various different types. Identify how the driver exposes the data: IIO, net, etc. For sensors, the most common is the IIO driver and you could use all driver functionalities.
98+
99+
**NOTE:** _To be sure that your [Click Board™](https://www.mikroe.com/click-boards) is supported look for the “ID” logo on the back side of the [Click Board™](https://www.mikroe.com/click-boards) and check the currently [supported Click Board™](https://github.com/MikroElektronika/click_id/blob/generate_csv/clicks_status.csv)._
100+
101+
**NOTE:** _Even though the dynamic system allows for Plug-and-Play, [Click Boards™](https://www.mikroe.com/click-boards) are not hot-swappable! When switching between [Click Boards™](https://www.mikroe.com/click-boards), be sure to remove power from the device first in order to prevent damage to the [Click Board™](https://www.mikroe.com/click-boards) or the platform they are connected to._
102+
103+
<!-- ### How to include driver in kernel -->
104+
105+
If you do not have one of the mentioned images, things are slightly more complex:
106+
107+
* Rebuild the [mikroBUS driver](https://github.com/Ayush1325/linux/tree/mikrobus-base/drivers/misc/mikrobus) for your version of the kernel. You can do this by building the driver as a built-in driver or as a module for dynamic loading.
108+
109+
**NOTE:** _If you build the driver as a module, it is necessary to include both the mikroBUS module
110+
and the mikroBUS_id module._
111+
112+
* Modify the [Linux device tree](https://docs.kernel.org/devicetree/usage-model.html) so the mikroBUS™ compatible socket can be supported.
113+
114+
* After you have applied the mikroBUS™ kernel driver onto the embedded Linux platform, perform the following:
115+
116+
* Verify the mikroBUS™ kernel driver is enabled by utilizing the following command in the Terminal: `ls /sys/bus/mikrobus/devices/`.
117+
* What you will eventually get is something like this: `mikrobus-0` (and/or `mikrobus-1`, `mikrobus-2`, `mikrobus-3` - depending on how many [mikroBUS™](https://download.mikroe.com/documents/standards/mikrobus/mikrobus-standard-specification-v200.pdf) sockets Your embedded Linux Platform supports).
118+
119+
**Now you can use the driver the same as with the driver included in the prebuilt image.**
120+
121+
## ClickID for Linux driver developers
122+
123+
Currently, database of the [Click Boards™](https://www.mikroe.com/click-boards) is much larger than the number of drivers in Linux, so it is sometimes necessary to add support for a [Click Board™](https://www.mikroe.com/click-boards) in Linux.
124+
125+
Support for a [Click Board™](https://www.mikroe.com/click-boards) in Linux consists of several steps:
126+
127+
* Check if the embedded Linux has the [mikroBUS driver](https://github.com/Ayush1325/linux/tree/mikrobus-base/drivers/misc/mikrobus) installed. If this is not the case, refer to the previous section on how to do this.
128+
129+
* Checking if the module on the [Click Board™](https://www.mikroe.com/click-boards) already has a driver in the Linux kernel. If this is not the case, it is necessary to [develop a Linux driver](https://www.kernel.org/doc/html/v4.13/driver-api/index.html) for the respective module.
130+
131+
* Create a [ClickID manifest](#clickid-manifest) for the[Click Board™](https://www.mikroe.com/click-boards), which is necessary for the host to correctly configure the [Click Board™](https://www.mikroe.com/click-boards) during loading. [ClickID manifest](#clickid-manifest) file contains the necessary information for a specific Linux driver for the [Click Board™](https://www.mikroe.com/click-boards). For reference, you can analyze the example manifest for the [OLEDC Click](https://github.com/MikroElektronika/click_id/blob/main/clicks/OLEDC/manifest/OLEDC-CLICK.mnfs).
132+
133+
* Create the manifest binary file (mnfb file) from [ClickID manifest](#clickid-manifest) using a [Python tool](https://github.com/MikroElektronika/click_id/tree/main/manifesto)
134+
* Write the manifest file to the Click Board™.
135+
'``dd if=/lib/firmware/mikrobus/your_manifest.mnfb of=/sys/bus/w1/devices/w1_bus_master1-<unique ID>/mikrobus_manifest'``
136+
137+
**NOTE:** _Make a pull request to this repository if you want to add your ClickID manifest to our database._
138+
139+
## ClickID manifest
140+
141+
This section will describe the [Click Board™](https://www.mikroe.com/click-boards) manifest file format required for the ClickID driver in the Linux kernel. [Click Board™](https://www.mikroe.com/click-boards) manifest is derived from the [Greybus manifest](https://raw.githubusercontent.com/cfriedt/greybus-for-zephyr/master/doc/GreybusSpecification.pdf).
84142
Below are briefly described only fields of interest for the [Click Board™](https://www.mikroe.com/click-boards) manifest.
85143

86144
The manifest contains a header and an array of descriptors. All descriptors are 32-bit aligned, and the size of each descriptor is a multiple of 4 bytes.
@@ -221,7 +279,7 @@ mikroBus descriptor:
221279
<br>
222280
223281
The property descriptors are used to pass named properties or named GPIOs to the host.
224-
The host system uses this information to properly configure specific click drivers by passing the properties and GPIO name. There can be multiple instances of property descriptors per add-on board manifest.
282+
The host system uses this information to properly configure specific [Click Board™](https://www.mikroe.com/click-boards) drivers by passing the properties and GPIO name. There can be multiple instances of property descriptors per add-on board manifest.
225283
226284
* length (1 byte)
227285
* id (1 byte)

images/click-id-page-banner.jpg

-60.4 KB
Loading

0 commit comments

Comments
 (0)