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

openocd issue on Linux #73

Closed
kdsoo opened this issue Aug 11, 2016 · 8 comments
Closed

openocd issue on Linux #73

kdsoo opened this issue Aug 11, 2016 · 8 comments

Comments

@kdsoo
Copy link

kdsoo commented Aug 11, 2016

Hi,

I recently upgraded to bsp version 1.0.7 which seems to be the latest version and currently having problem just like we had in version 1.0.6. (revisiting.... #68 )

I rolled back to version 1.0.5 for now, which has no openocd problem.

But rolling back to 1.0.5 has also some problem. It won't compile some example codes with API function which have changed arguments

Please let me know if there is solution for this.

@kdsoo
Copy link
Author

kdsoo commented Aug 11, 2016

`Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-09-12:07)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : only one transport option; autoselect 'swd'
cortex_m reset_config sysresetreq
adapter speed: 1000 kHz
Error: unable to open CMSIS-DAP device 0xd28:0x204

the selected serial port
does not exist or your board is not connected`

This is the error message I got with version 1.0.7.
openocd version is different from the one of 1.0.5 but still not working

@Cheong2K
Copy link
Contributor

Thank you for pointing out this, we will look into this.

@zoujixing
Copy link

Tye open Arduino with sudo privileges

@kdsoo
Copy link
Author

kdsoo commented Aug 17, 2016

@zoujixing ,
Does that really resolve the problem? if the running privilege is the issue, I think "setcap" could solve the problem.
anyway I tried "sudo ./arduino" but the most irritating thing launching ide with sudo is the whole workspace and libraries are blanked because of the privilege changed to root (home directory get changed)
It seems to be solving the openocd problem but I don't think this is the solution.
running as root privilege is the last thing that I want to do on my Linux box...

@kdsoo
Copy link
Author

kdsoo commented Aug 17, 2016

I tried setcap on openocd (sudo setcap cap_net_raw+eip PATH_TO_REDBEAR_OPENOCD/openocd)
but didn't go well.
since launching arduino ide with sudo doesn't invoke openocd problem, privilege seems to be the cause but can't figure it out further.

@bapowell
Copy link

bapowell commented Sep 4, 2016

I had the same problem (under Ubuntu 14.04). After much googling, I found this: openocd.udev, which shows the following udev rules for the CMSIS-DAP device:

# mbed CMSIS-DAP
ATTRS{idVendor}=="0d28", ATTRS{idProduct}=="0204", MODE="664", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="0d28", ATTRS{idProduct}=="0204", MODE="664", GROUP="plugdev"

After ensuring that my userid was a member of the plugdev group, I created a new udev rules file, /etc/udev/rules.d/98-blenano.rules, with these rules; then reloaded with $ sudo udevadm control --reload-rules, plugged in the MK20 device, and it worked.

@kdsoo
Copy link
Author

kdsoo commented Sep 4, 2016

@bapowell Thank you. It works like a charm.
I couldn't imagine that mk20 is the problem since it's still ttyACMx.
Anyway I think the solution should be described in readme to avoid confusion.

@kdsoo kdsoo closed this as completed Sep 4, 2016
@asukiaaa
Copy link

Thanks for good information.
I succeeded with the bapowell way.

Arduino IDE supports its rules so I also succeeded with arduino/OpenOCD/contrib/60-openocd.rules

I set the rules by the following commands.

cd /etc/udev/rules.d
sudo wget https://raw.githubusercontent.com/arduino/OpenOCD/master/contrib/60-openocd.rules
sudo udevadm control --reload-rules

Thanks.

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

5 participants