Skip to content

Updated code and USB usage #2

Description

@patrickpoirier51

These are my notes on how I kinda made it work

The ec2 code need to be updated, here is one that works:
https://github.com/paragonRobotics/ec2-new
Git clone
make a build directory and ccmake from there
make
copy ec2/build/bin to /usr/local/bin

Now the fun part:
using dmesg , check how the EC2 is handled by kernel, here is mine:

[ 2419.004111] usb 5-1: reset full-speed USB device number 7 using uhci_hcd
[ 2485.360286] usb 5-1: USB disconnect, device number 7
[ 2487.868207] usb 5-1: new full-speed USB device number 8 using uhci_hcd
[ 2488.050384] usb 5-1: New USB device found, idVendor=10c4, idProduct=8044
[ 2488.050388] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2488.050390] usb 5-1: Product: USB Debug Adapter
[ 2488.050392] usb 5-1: Manufacturer: Silicon Laboratories
[ 2488.050394] usb 5-1: SerialNumber: EC3005AC7E3
[ 2488.074188] hid-generic 0003:10C4:8044.0007: hiddev0,hidraw1: USB HID v1.11 Device [Silicon Laboratories USB Debug Adapter] on usb-0000:00:1d.0-1/input0

We need to unbind so the ec2 progs can get access:
echo -n 5-1:1.0 | tee -a /sys/bus/usb/drivers/usbhid/unbind

So based on that , we can make a devrule to unbind while pluging:
sudo nano /etc/udev/rules.d/99-ec2.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="8044", MODE="0660", GROUP="plugdev", RUN="/bin/sh -c 'echo -n $id:1.0 > /sys/bus/usb/drivers/usbhid/unbind'"

Activate rule:
sudo udevadm control --reload
sudo udevadm trigger

Simple test , that read EC2 Firmare and write to file
./ec2readfw --port=USB test.bin

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions