我有新鲜的STM32 L1发现板,它似乎坏了。但我不完全确定。
当通过 USB 将开发板连接到 Linux 机器时,开发板完全正常启动,并且演示工作与供应商描述的一样。
但我无法真正连接到这块板。
➜ lsusb -s 002:074
Bus 002 Device 074: ID 0483:3748 STMicroelectronics ST-LINK/V2
电路板似乎已连接,用于在 ST-LINK 和 DISCOVERY 之间切换的大跳线 (CN3) 设置为 DISCOVERY。但是当我尝试使用我收到的 st-link 实用程序时。
➜ 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)
OpenOCD 也无法与董事会对话。
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'
板载芯片为STM32L152RCT6。我之前使用过 STM32F0..4 并且从未遇到过这样的问题,但是我之前没有使用过 L 系列,所以我不确定这是电路板问题还是我在这里跳过了一些重要的问题。
编辑:使用 OpenOCD 我发现不是预期的行为。在第一次运行时,我收到错误:
Error: init mode failed (unable to connect to the target)
在第二次运行:
Error: reset device failed
然后设备从系统中消失,dmesg
留下消息:
[ 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
我认为适配器速度可能存在问题,但我现在不确定。
EDIT2:我尝试使用 Windows ST Link Utility,但无法连接到电路板,电路板导致“检测错误”或“连接错误”,软件建议更改 SWD 频率或模式。我厌倦了几乎所有的组合,但没有一个有效。
EDIT3:如果这对某人有帮助,则板已被退回,我得到的信息表明它实际上已损坏并且我有新的。新的按预期完美运行。