jadonk / beagleconnect

Moved to https://git.beagleboard.org/beagleconnect/freedom
https://git.beagleboard.org/beagleconnect/freedom
35 stars 16 forks source link

sw: mikrobus: add mikrobus click ID flasher as submodule #60

Closed vaishnavachath closed 3 years ago

vaishnavachath commented 3 years ago

This project allows to flash the eeprom on the new mikrobus click ID adapter from BeagleConnect Freedom,

The scheme for writing manifests is as follows:

  1. write production manifest(fixed, minimum information for enabling through userspace if driver is available) at addr 0x0000 onwards
  2. write variable manifest at next free block after writing production manifest
  3. update eeprom bytes with production manifest start block
  4. write protect fixed/production manifest(currently commented)

production/fixed manifest :

manifest available at click production time(contains some mikroe specific strings also), if driver does not exist at production time,it will contain minimal information on click hardware to enable for development through userspace, if driver exists additonal greybus/mikrobus information will be present

variable manifest :

vaishnavachath commented 3 years ago

For flashing mikrobus click ID EEPROM with a click manifest, perform:

./flash-clickid.sh RTC-6-CLICK {or any other click with manifest available in manifests directory}

from sw directory after plugging in the click ID adapter on the mikrobus port 1(USB, Battery Connector Side) on BeagleConnect Freedom

vaishnavachath commented 3 years ago

Tested over greybus (BeagleConnect Rev C3 2.4G) :

Buildroot Console:

buildroot login: $setting up wpanusb gateway for IEEE 802154 CHANNEL 26\n killall: gbridge: no process killed PING 2001:db8::1(2001:db8::1) from 2001:db8::2 lowpan0: 56 data bytes 64 bytes from 2001:db8::1: icmp_seq=1 ttl=64 time=78.9 ms 64 bytes from 2001:db8::1: icmp_seq=2 ttl=64 time=69.1 ms 64 bytes from 2001:db8::1: icmp_seq=3 ttl=64 time=45.8 ms 64 bytes from 2001:db8::1: icmp_seq=4 ttl=64 time=51.4 ms 64 bytes from 2001:db8::1: icmp_seq=5 ttl=64 time=52.6 ms

--- 2001:db8::1 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4017ms rtt min/avg/max/mdev = 45.799/59.546/78.878/12.400 ms greybus 1-2.2: Interface added (greybus) greybus 1-2.2: GMP VID=0x00000126, PID=0x00000126 greybus 1-2.2: DDBL1 Manufacturer=0x00000126, Product=0x00000126 greybus 1-2.2: excess descriptors in interface manifest mikrobus:mikrobus_port_gb_register: mikrobus gb_probe , num cports= 3, manifest_size 428 mikrobus:mikrobus_port_gb_register: protocol added 11 mikrobus:mikrobus_port_gb_register: protocol added 3 mikrobus:mikrobus_port_gb_register: protocol added 2 mikrobus:mikrobus_port_register: registering port mikrobus-0 mikrobus_manifest:mikrobus_manifest_attach_device: parsed device 1, driver=opt3001, protocol=3, reg=44 mikrobus_manifest:mikrobus_manifest_attach_device: parsed device 2, driver=hdc2010, protocol=3, reg=40 mikrobus_manifest:mikrobus_manifest_attach_device: parsed device 3, driver=lis2dh12_accel, protocol=3, reg=18 mikrobus_manifest:mikrobus_manifest_attach_device: parsed device 4, driver=bme280, protocol=3, reg=76 mikrobus_manifest:mikrobus_manifest_attach_device: parsed device 8, driver=mcp7941x, protocol=3, reg=6f mikrobus_manifest:mikrobus_manifest_parse: Greybus Service Sample Application manifest parsed with 5 devices mikrobus mikrobus-0: registering device : opt3001 opt3001 0-0044: Found TI OPT3001 mikrobus mikrobus-0: registering device : hdc2010 mikrobus mikrobus-0: registering device : lis2dh12_accel iio iio:device1: registered accelerometer lis2dh12_accel mikrobus mikrobus-0: registering device : bme280

Welcome to Buildroot buildroot login: mikrobus mikrobus-0: registering device : mcp7941x rtc-ds1307 0-006f: registered as rtc1

Welcome to Buildroot buildroot login: root Password:

iio_info Library version: 0.19 (git tag: v0.19) Compiled with backends: local xml ip usb serial IIO context created with local backend. Backend version: 0.19 (git tag: v0.19) Backend description string: Linux buildroot 5.8.14 #1 SMP Tue Mar 2 01:01:36 IST 2021 x86_64 IIO context has 1 attributes: local,kernel: 5.8.14 IIO context has 3 devices: iio:device0: opt3001 1 channels found: illuminance: (input) 2 channel-specific attributes found: attr 0: input value: 11.420000 attr 1: integration_time value: 0.800000 2 device-specific attributes found: attr 0: current_timestamp_clock value: realtime

            attr  1: integration_time_available value: 0.1 0.8
iio:device1: lis2dh12_accel (buffer capable)
    4 channels found:
        accel_x:  (input, index: 0, format: le:s12/16>>4)
        3 channel-specific attributes found:
            attr  0: raw value: -992
            attr  1: scale value: 0.009806
            attr  2: scale_available value: 0.009806 0.019613 0.039226 0.117679
        accel_y:  (input, index: 1, format: le:s12/16>>4)
        3 channel-specific attributes found:
            attr  0: raw value: -32
            attr  1: scale value: 0.009806
            attr  2: scale_available value: 0.009806 0.019613 0.039226 0.117679
        accel_z:  (input, index: 2, format: le:s12/16>>4)
        3 channel-specific attributes found:
            attr  0: raw value: 36
            attr  1: scale value: 0.009806
            attr  2: scale_available value: 0.009806 0.019613 0.039226 0.117679
        timestamp:  (input, index: 3, format: le:S64/64>>0)
    3 device-specific attributes found:
            attr  0: current_timestamp_clock value: realtime

            attr  1: sampling_frequency value: 1
            attr  2: sampling_frequency_available value: 1 10 25 50 100 200 400 1600
    2 buffer-specific attributes found:
            attr  0: data_available value: 0
            attr  1: watermark value: 1
iio:device2: bme280
    3 channels found:
        temp:  (input)
        2 channel-specific attributes found:
            attr  0: input value: 25320
            attr  1: oversampling_ratio value: 2
        pressure:  (input)
        2 channel-specific attributes found:
            attr  0: input value: 100.748921875
            attr  1: oversampling_ratio value: 16
        humidityrelative:  (input)
        2 channel-specific attributes found:
            attr  0: input value: 56785
            attr  1: oversampling_ratio value: 16

cat /sys/class/rtc/rtc1/name rtc-ds1307 0-006f

vaishnavachath commented 3 years ago

This PR has the read manifest changes, https://github.com/jadonk/greybus-for-zephyr/pull/2