Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated code and USB usage #2

Open
patrickpoirier51 opened this issue Oct 23, 2020 · 0 comments
Open

Updated code and USB usage #2

patrickpoirier51 opened this issue Oct 23, 2020 · 0 comments

Comments

@patrickpoirier51
Copy link

patrickpoirier51 commented Oct 23, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant