feodra 20下建立STM32开发环境(1)

参考链接 http://www.eefocus.com/marianna/blog/13-09/298454_7e04f.html

http://vedder.se/2012/07/get-started-with-stm32f4-on-ubuntu-linux/


综合了以上两个帖子才成功,因为百度不到直接可用的方法,所以写个博客存着

首先去http://sourceforge.net/projects/openocd/下载openocd。解压 改名成openocd


cd openocd
./configure --enable-maintainer-mode --disable-option-checking --disable-werror --prefix=${PREFIX} --enable-dummy  --enable-ep93xx --enable-at91rm9200  --enable-usbprog --enable-jlink --enable-vsllink --enable-rlink --enable-stlink --enable-arm-jtag-ew
make
sudo make install



上面里理论的,,在执行./configure的时候会报错,,

错误信息我找不到了,,因为我已经安装上了,就是缺少libusb1.x的支持


使用yum安装libusb1.x

提示libusb0.1已经最新。。蛋疼。。

执行sudo yum search libusb


[ljh@localhost openocd-0.8.0]$ sudo yum search libusb
[sudo] password for ljh: 
已加载插件:fastestmirror, langpacks, refresh-packagekit
Loading mirror speeds from cached hostfile
 * fedora: mirrors.oschina.net
 * rpmfusion-free: ftp.sjtu.edu.cn
 * rpmfusion-free-updates: ftp.sjtu.edu.cn
 * rpmfusion-nonfree: mirrors.163.com
 * rpmfusion-nonfree-updates: mirrors.163.com
 * updates: mirrors.163.com
================================================================ N/S matched: libusb =================================================================
libusb-devel.i686 : Development files for libusb
libusb-devel.x86_64 : Development files for libusb
libusbg-devel.i686 : Development package for libusbg
libusbg-devel.x86_64 : Development package for libusbg
libusbx-devel.i686 : Development files for libusbx
libusbx-devel.x86_64 : Development files for libusbx
libusbx-devel-doc.noarch : Development files for libusbx
libgusb.i686 : GLib wrapper around libusb1
libgusb.x86_64 : GLib wrapper around libusb1
libusb.i686 : A library which allows userspace access to USB devices
libusb.x86_64 : A library which allows userspace access to USB devices
libusbg.i686 : Library for USB gadget-configfs userspace functionality
libusbg.x86_64 : Library for USB gadget-configfs userspace functionality
libusbg-utils.x86_64 : Utilities for USB gadget devices
libusbx.i686 : Library for accessing USB devices
libusbx.x86_64 : Library for accessing USB devices
mingw32-libusbx.noarch : MinGW library which allows userspace access to USB devices
mingw32-libusbx-static.noarch : MinGW static library which allows userspace access to USB devices
mingw64-libusbx.noarch : MinGW library which allows userspace access to USB devices
mingw64-libusbx-static.noarch : MinGW static library which allows userspace access to USB devices

libusb-devel.x86_64 : Development files for libusb


安装这个包
sudo yum install libusb-devel.x86_64

安装完成后继续./configure 。。。。。

然后make 

make install


安装成功

测试


[ljh@localhost openocd-0.8.0]$ openocd -f interface/jlink.cfg -f target/stm32f1x.cfg
Open On-Chip Debugger 0.8.0 (2014-08-10-11:32)
Licensed under GNU GPL v2
For bug reports, read
<span style="white-space:pre">	</span>http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m reset_config sysresetreq
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled Jul 17 2014 12:31:18
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 80000
Info : J-Link hw type J-Link
Info : J-Link max mem block 9224
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0x0
Info : Vref = 3.313 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
Info : clock speed 1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints



打开一个新标签

[ljh@localhost openocd-0.8.0]$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> 

然后看看能不能下载程序。


[ljh@localhost openocd-0.8.0]$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> halt                                                
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x080029ec msp: 0x20000758
> flash write_image erase /home/ljh/code/stm32/LCD.hex
auto erase enabled
device id = 0x10036414
flash size = 512kbytes
wrote 20480 bytes from file /home/ljh/code/stm32/LCD.hex in 0.883612s (22.634 KiB/s)
> 


复位以下。。OK。。。明天解决编译器和GDB


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值