title: Cannot run STM32 L1 Discovery board
body: <p>I have fresh STM32 L1 discovery board, and it seems to be broken.
  But I am not completely sure.</p>
  
  <p>When connecting board via USB to the Linux machine, board starts 
  perfectly fine, and the demo works just as described by vendor.</p>
  
  <p>But I am unable to actually connect to this board.</p>
  
  <pre><code>➜ lsusb -s 002:074
  Bus 002 Device 074: ID 0483:3748 STMicroelectronics ST-LINK/V2
  </code></pre>
  
  <p>Board seems to be connected, big jumper (CN3) to switch between ST-LINK and DISCOVERY is set to DISCOVERY. But when I try to use st-link utility
  I am receiving.</p>
  
  <pre><code>➜  stlink git:(master) ./st-flash --reset erase
  libusb_handle_events() timeout
  [!] send_recv
  libusb_submit_transfer(-6)
  [!] send_recv
  libusb_submit_transfer(-6)
  [!] send_recv
  libusb_submit_transfer(-6)
  [!] send_recv
  libusb_submit_transfer(-6)
  [!] send_recv
  2015-12-25T19:24:57 INFO src/stlink-common.c: Loading device parameters....
  libusb_submit_transfer(-6)
  [!] send_recv
  libusb_submit_transfer(-6)
  [!] send_recv
  libusb_submit_transfer(-6)
  [!] send_recv
  2015-12-25T19:24:57 WARN src/stlink-common.c: unknown chip id! 0
  fish: Job 1, './st-flash --reset erase' terminated by signal SIGSEGV (Address boundary error)
  </code></pre>
  
  <p>Also OpenOCD is unable to talk to the board.</p>
  
  <pre><code>openocd -f board/stm32ldiscovery.cfg
  Open On-Chip Debugger 0.9.0 (2015-12-25-18:43)
  Licensed under GNU GPL v2
  For bug reports, read
       http://openocd.org/doc/doxygen/bugs.html
  adapter speed: 300 kHz
  adapter_nsrst_delay: 100
  Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
  none separate
  srst_only separate srst_nogate srst_open_drain connect_deassert_srst
  Info : Unable to match requested speed 300 kHz, using 240 kHz
  Info : Unable to match requested speed 300 kHz, using 240 kHz
  Info : clock speed 240 kHz
  Error: reset device failed
  in procedure 'init' 
  in procedure 'ocd_bouncer'
  </code></pre>
  
  <p>The chip on board is STM32L152RCT6. I worked with STM32F0..4 before and had never such problems, but I did not worked with L series before, so I am not sure if this is board problem or I am skipping something important here.</p>
  
  <p>EDIT: Using OpenOCD i found out not expected behaviour. At first run I am receiving error:</p>
  
  <pre><code>Error: init mode failed (unable to connect to the target)
  </code></pre>
  
  <p>At second run:</p>
  
  <pre><code>Error: reset device failed
  </code></pre>
  
  <p>Then device dissapears from the system, <code>dmesg</code> leaves messages:</p>
  
  <pre><code>[ 1336.080239] usb 2-1.1: reset full-speed USB device number 4 using ehci-pci
  [ 1336.154250] usb 2-1.1: device descriptor read/64, error -32
  [ 1336.329341] usb 2-1.1: device descriptor read/64, error -32
  [ 1336.503334] usb 2-1.1: reset full-speed USB device number 4 using ehci-pci
  [ 1336.566330] usb 2-1.1: device descriptor read/64, error -32
  [ 1336.741385] usb 2-1.1: device descriptor read/64, error -32
  [ 1336.915427] usb 2-1.1: reset full-speed USB device number 4 using ehci-pci
  [ 1337.317517] usb 2-1.1: device not accepting address 4, error -32
  [ 1337.390532] usb 2-1.1: reset full-speed USB device number 4 using ehci-pci
  [ 1337.792623] usb 2-1.1: device not accepting address 4, error -32
  [ 1337.793110] usb 2-1.1: USB disconnect, device number 4
  [ 1337.855642] usb 2-1.1: new full-speed USB device number 5 using ehci-pci
  [ 1337.918651] usb 2-1.1: device descriptor read/64, error -32
  [ 1338.093691] usb 2-1.1: device descriptor read/64, error -32
  [ 1338.267730] usb 2-1.1: new full-speed USB device number 6 using ehci-pci
  [ 1338.330727] usb 2-1.1: device descriptor read/64, error -32
  [ 1338.505783] usb 2-1.1: device descriptor read/64, error -32
  [ 1338.679823] usb 2-1.1: new full-speed USB device number 7 using ehci-pci
  [ 1339.081921] usb 2-1.1: device not accepting address 7, error -32
  [ 1339.154935] usb 2-1.1: new full-speed USB device number 8 using ehci-pci
  [ 1339.557024] usb 2-1.1: device not accepting address 8, error -32
  [ 1339.557168] usb 2-1-port1: unable to enumerate USB device
  </code></pre>
  
  <p>I think there might be a problem with adapter speed, but I am not sure for now.</p>
  
  <p>EDIT2: I tried with Windows ST Link Utility and I am not able to connect to the board, board causing "Detection Error" or "Connection Error", software suggests changing SWD frequency or mode. I tired with literally every combination but none works.</p>
  
  <p>EDIT3: If this helps somebody, board was sent back, I have got information that it is actually broken and I have got new one. New one works flawlessly as expected.</p>