Re: [OpenOCD-devel] Stlink v1 under Linux

2012-05-13 Thread Xiaofan Chen
On Sat, Mar 10, 2012 at 3:14 AM, Mathias K. kes...@freenet.de wrote:

 Debug: 165 52 stlink_usb.c:1068 stlink_usb_open(): transport: 1 vid: 0483 
 pid: 3744
 Debug: 166 53 stlink_usb.c:1078 stlink_usb_open(): claim interface failed
 Debug: 167 53 stlink_layout.c:50 stlink_layout_open(): failed
 Debug: 168 53 command.c:630 run_command(): Command failed with error code -4
 User : 169 54 command.c:668 command_run_line(): in procedure 'transport'
 Debug: 170 54 command.c:630 run_command(): Command failed with error code -4
 User : 171 54 command.c:668 command_run_line(): in procedure 'init'
 Debug: 172 54 stlink_interface.c:100 stlink_interface_quit(): 
 stlink_interface_quit
 dos@DoS-Aspire-7740:/mount/10.10/dos/INF/Projects/ARM/openocd6/openocd/tcl$


 Please reconnect you hardware and check the log messages from the dmesg 
 command:

 usb 1-1.1: USB disconnect, device number 50
 usb 1-1.1: new full speed USB device number 53 using ehci_hcd
 usb 1-1.1: New USB device found, idVendor=0483, idProduct=3744
 usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
 usb 1-1.1: Product: STM32 STLink
 usb 1-1.1: Manufacturer: STMicroelectronics
 usb 1-1.1: SerialNumber: 7
 usb-storage 1-1.1:1.0: device ignored

 The last line is very important. Anyway i think there is no problem if
 you send your log messages to this list.

Just wondering what is the minimum kernel version to
ignore the device for usb-storage, I am running Ubuntu 12.04
(kernel 3.2.0-24) and it still does not ignore the device.

On the other hand, it is possible to manually detach the
driver using the instruction from Alan Stern.


+ From Alan Stern ++
http://libusb.6.n5.nabble.com/How-to-dump-HID-report-descriptor-under-Linux-tp5971p5973.html

You can detach and attach drivers by hand.  To unbind hiddev from a
device:

cd /sys/bus/usb/drivers/hiddev
ls

Find the filename for the interface you want to unbind.  Interface
filenames have the form

B-P:C.I

where B is the bus number, P is a string of port numbers separated by
periods, C is the configuration value, and I is the interface number.
Having found the filename for the interface you want to unbind, do

echo -n interface-filename unbind

To re-attach the driver, do

echo -n interface-filename bind


For the usb-storage, it is similar.

mcuee@GX620Ubuntu:/sys/bus/usb/drivers/usb-storage$ ls
5-2:1.0  bind  module  remove_id  uevent  unbind

mcuee@GX620Ubuntu:/sys/bus/usb/drivers/usb-storage$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 148f:3070 Ralink Technology, Corp.
RT2870/RT3070 Wireless Adapter
Bus 003 Device 002: ID 0403:6001 Future Technology Devices
International, Ltd FT232 USB-Serial (UART) IC
Bus 003 Device 003: ID 046d:c315 Logitech, Inc. Classic New Touch Keyboard
Bus 004 Device 002: ID 413c:3010 Dell Computer Corp. Optical Wheel Mouse
Bus 005 Device 002: ID 046d:c52f Logitech, Inc. Wireless Mouse M305
Bus 005 Device 003: ID 0483:3744 SGS Thomson Microelectronics STLINK Pseudo disk

mcuee@GX620Ubuntu:/sys/bus/usb/drivers/usb-storage$ echo -n 5-2:1.0 |
sudo tee -a unbind
[sudo] password for mcuee:
5-2:1.0

mcuee@GX620Ubuntu:/sys/bus/usb/drivers/usb-storage$ ls
bind  module  remove_id  uevent  unbind


-- 
Xiaofan

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] Stlink v1 under Linux

2012-05-13 Thread Xiaofan Chen
On Sun, May 13, 2012 at 6:10 PM, Xiaofan Chen xiaof...@gmail.com wrote:

 Just wondering what is the minimum kernel version to
 ignore the device for usb-storage, I am running Ubuntu 12.04
 (kernel 3.2.0-24) and it still does not ignore the device.

 On the other hand, it is possible to manually detach the
 driver using the instruction from Alan Stern.

However, it still does not work after detaching the kernel usb-storage
driver.

mcuee@GX620Ubuntu:~/Desktop/build/openocd/stlink$ sudo openocd -f
board/stm32ldiscovery.cfg
Open On-Chip Debugger 0.6.0-dev-00549-g47cf0aa (2012-05-10-21:06)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
1000 kHz
Info : clock speed 1000 kHz
Error: open failed
in procedure 'transport'
in procedure 'init'


mcuee@GX620Ubuntu:~/Desktop/build/openocd/stlink$ sudo openocd -d3 -f
board/stm32ldiscovery.cfg
Open On-Chip Debugger 0.6.0-dev-00549-g47cf0aa (2012-05-10-21:06)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
User : 11 4 command.c:547 command_print(): debug_level: 3
Debug: 12 4 configuration.c:45 add_script_search_dir(): adding
/home/mcuee/.openocd
Debug: 13 4 configuration.c:45 add_script_search_dir(): adding
/usr/local/share/openocd/site
Debug: 14 4 configuration.c:45 add_script_search_dir(): adding
/usr/local/share/openocd/scripts
Debug: 15 5 configuration.c:86 find_file(): found
/usr/local/share/openocd/scripts/board/stm32ldiscovery.cfg
Debug: 16 5 configuration.c:86 find_file(): found
/usr/local/share/openocd/scripts/interface/stlink-v2.cfg
Debug: 17 5 command.c:145 script_debug(): command - ocd_command
ocd_command type ocd_interface stlink
Debug: 18 5 command.c:145 script_debug(): command - interface
ocd_interface stlink
Debug: 20 5 command.c:367 register_command_handler(): registering
'ocd_stlink_device_desc'...
Debug: 21 5 command.c:367 register_command_handler(): registering
'ocd_stlink_serial'...
Debug: 22 5 command.c:367 register_command_handler(): registering
'ocd_stlink_layout'...
Debug: 23 5 command.c:367 register_command_handler(): registering
'ocd_stlink_vid_pid'...
Debug: 24 5 command.c:145 script_debug(): command - ocd_command
ocd_command type ocd_stlink_layout usb
Debug: 25 6 command.c:145 script_debug(): command - stlink_layout
ocd_stlink_layout usb
Debug: 27 6 stlink_interface.c:161
stlink_interface_handle_layout_command():
stlink_interface_handle_layout_command
Debug: 28 6 command.c:145 script_debug(): command - ocd_command
ocd_command type ocd_stlink_device_desc ST-LINK/V2
Debug: 29 6 command.c:145 script_debug(): command - stlink_device_desc
ocd_stlink_device_desc ST-LINK/V2
Debug: 31 6 stlink_interface.c:133
stlink_interface_handle_device_desc_command():
stlink_interface_handle_device_desc_command
Debug: 32 6 command.c:145 script_debug(): command - ocd_command
ocd_command type ocd_stlink_vid_pid 0x0483 0x3748
Debug: 33 6 command.c:145 script_debug(): command - stlink_vid_pid
ocd_stlink_vid_pid 0x0483 0x3748
Debug: 35 6 stlink_interface.c:189
stlink_interface_handle_vid_pid_command():
stlink_interface_handle_vid_pid_command
Debug: 36 6 command.c:145 script_debug(): command - ocd_command
ocd_command type ocd_adapter_khz 1000
Debug: 37 6 command.c:145 script_debug(): command - adapter_khz
ocd_adapter_khz 1000
Debug: 39 6 core.c:1625 jtag_config_khz(): handle jtag khz
Debug: 40 6 core.c:1592 adapter_khz_to_speed(): convert khz to
interface specific speed value
Debug: 41 6 core.c:1592 adapter_khz_to_speed(): convert khz to
interface specific speed value
User : 42 7 command.c:547 command_print(): 1000 kHz
Debug: 43 7 configuration.c:86 find_file(): found
/usr/local/share/openocd/scripts/target/stm32lx_stlink.cfg
Debug: 44 7 configuration.c:86 find_file(): found
/usr/local/share/openocd/scripts/target/stm32_stlink.cfg
Debug: 45 7 command.c:145 script_debug(): command - ocd_command
ocd_command type ocd_transport select stlink_swd
Debug: 46 7 command.c:145 script_debug(): command - ocd_transport
ocd_transport select stlink_swd
Debug: 47 7 stlink_transport.c:179 stlink_transport_select():
stlink_transport_select
Debug: 48 7 command.c:367 register_command_handler(): registering
'ocd_stlink'...
Debug: 49 7 command.c:367 register_command_handler(): registering 'ocd_jtag'...
Debug: 50 7 command.c:367 register_command_handler(): registering 'ocd_jtag'...
Debug: 51 7 command.c:367 register_command_handler(): registering 'ocd_jtag'...
Debug: 52 8 command.c:367 register_command_handler(): registering 'ocd_jtag'...
Debug: 53 8 command.c:367 register_command_handler(): registering 'ocd_jtag'...
Debug: 54 8 command.c:367 register_command_handler(): registering 'ocd_jtag'...
Debug: 55 8 command.c:367 register_command_handler(): registering 'ocd_jtag'...
Debug: 56 8 command.c:367 register_command_handler(): registering 'ocd_jtag'...
Debug: 57 8 command.c:367 register_command_handler(): registering 'ocd_jtag'...
Debug: 58 8 command.c:145 script_debug(): 

Re: [OpenOCD-devel] Stlink v1 under Linux

2012-05-13 Thread Xiaofan Chen
On Sun, May 13, 2012 at 6:36 PM, Jacek Drewniak
jacek.drewn...@gmail.com wrote:
 Make a file with line:
 options usb-storage quirks=483:3744:i
 in /etc/modprobe.d/stlink.conf
 and reboot

Thanks for the hint. Somehow this does not work. I will check again later.


-- 
Xiaofan

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] Stlink v1 under Linux

2012-05-13 Thread Xiaofan Chen
On Sun, May 13, 2012 at 9:50 PM, Jacek Drewniak
jacek.drewn...@gmail.com wrote:
 Attach and rapidly detach (to get not a lot lines) the stlink and in syslog
 find lines like
 May 13 15:42:37 debian kernel: [15607.902175] usb 1-1.2: new full speed USB
 device using ehci_hcd and address 3
 May 13 15:42:37 debian kernel: [15607.997512] usb 1-1.2: New USB device
 found, idVendor=0483, idProduct=3744
 May 13 15:42:37 debian kernel: [15607.997518] usb 1-1.2: New USB device
 strings: Mfr=1, Product=2, SerialNumber=3
 May 13 15:42:37 debian kernel: [15607.997522] usb 1-1.2: Product: STM32
 STLink
 May 13 15:42:37 debian kernel: [15607.997525] usb 1-1.2: Manufacturer:
 STMicroelectronics
 Maybe You have another numbers, but it will be strange


The VID/PID is the same but somehow the option to
blacklist the usb-storage driver for the device using
the following file does not seem to work. I will check again,.

cat /etc/modprobe.d/stlink.conf
options usb-storage quirks=483:3744:i

But the following works.
sudo modprobe -r usb-storage  sudo modprobe usb-storage quirks=483:3744:i

Instructions from:
https://github.com/texane/stlink

[11122.712031] usb 5-2: new full-speed USB device number 10 using uhci_hcd
[11122.882725] usb-storage 5-2:1.0: device ignored


-- 
Xiaofan

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[OpenOCD-devel] Stlink v1 under Linux

2012-03-09 Thread Jacek Drewniak
Hi everyone,

I have some problem with openocd and stlink under linux. I have tried solve
it with forum, but noone could help my beacouse there are not a lot linux
users.

I know that this kind of problem was under windows and depends of drivers.

Ok, there is a problem:

I cant connect openocd with my stlinkv1. I'm using openocd 0.6 from git
ripository. I added udev rules I found in contrib dir, but this is only i
get:

http://snipt.org/uffQ1#expand  http://snipt.org/uffQ1#expand
I added a target line to stm32f1x_stlink.cfg:
http://snipt.org/uffR5#expand

I need tu run it with gdb to start my jurney with ARM.

Thanks for any help.

Regards

Jacek Drewniak
--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] Stlink v1 under Linux

2012-03-09 Thread Mathias K.

 Debug: 165 52 stlink_usb.c:1068 stlink_usb_open(): transport: 1 vid: 0483 
 pid: 3744
 Debug: 166 53 stlink_usb.c:1078 stlink_usb_open(): claim interface failed
 Debug: 167 53 stlink_layout.c:50 stlink_layout_open(): failed
 Debug: 168 53 command.c:630 run_command(): Command failed with error code -4
 User : 169 54 command.c:668 command_run_line(): in procedure 'transport'
 Debug: 170 54 command.c:630 run_command(): Command failed with error code -4
 User : 171 54 command.c:668 command_run_line(): in procedure 'init'
 Debug: 172 54 stlink_interface.c:100 stlink_interface_quit(): 
 stlink_interface_quit
 dos@DoS-Aspire-7740:/mount/10.10/dos/INF/Projects/ARM/openocd6/openocd/tcl$


Please reconnect you hardware and check the log messages from the dmesg command:

usb 1-1.1: USB disconnect, device number 50
usb 1-1.1: new full speed USB device number 53 using ehci_hcd
usb 1-1.1: New USB device found, idVendor=0483, idProduct=3744
usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.1: Product: STM32 STLink
usb 1-1.1: Manufacturer: STMicroelectronics
usb 1-1.1: SerialNumber: 7
usb-storage 1-1.1:1.0: device ignored

The last line is very important. Anyway i think there is no problem if you send 
your log messages to
this list.


Regards,

Mathias

On 09.03.2012 19:46, Jacek Drewniak wrote:
 Hi everyone,
 
 I have some problem with openocd and stlink under linux. I have tried solve 
 it with forum, but noone
 could help my beacouse there are not a lot linux users.
 
 I know that this kind of problem was under windows and depends of drivers.
 
 Ok, there is a problem:
 
 I cant connect openocd with my stlinkv1. I'm using openocd 0.6 from git 
 ripository. I added udev
 rules I found in contrib dir, but this is only i get:
 
 http://snipt.org/uffQ1#expand  http://snipt.org/uffQ1#expand
 I added a target line to stm32f1x_stlink.cfg:
 http://snipt.org/uffR5#expand
 
 I need tu run it with gdb to start my jurney with ARM.
 
 Thanks for any help.
 
 Regards
 
 Jacek Drewniak 
 
 
 
 
 
 --
 Virtualization  Cloud Management Using Capacity Planning
 Cloud computing makes use of virtualization - but cloud computing 
 also focuses on allowing computing to be delivered as a service.
 http://www.accelacomm.com/jaw/sfnl/114/51521223/
 
 
 
 ___
 OpenOCD-devel mailing list
 OpenOCD-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/openocd-devel


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel