debian下烧写stm32f429I discovery裸机程序
需要安装openocd软件.如果已安装默认的openocd,需要先卸载系统默认的openocd(默认版本是0.5.0,版本太低),然后再安装.
在安装前需要安装libusb库文件:
sudo apt-get install libusb-1.0--dev libusb-1.0-0 automake autconf libtool pkg-config
然后执行安装:
git clone git://git.code.sf.net/p/openocd/code openocd
cd openocd
./bootstrap
./configure --prefix=/usr/local \
--enable-stlink --enable-jlink
echo -e "all:\ninstall:" > doc/Makefile
make
sudo make install
默认情况下openocd会安装到/usr/local/bin文件夹下,有可能会无法执行openocd命令,如果无法执行,可以将/usr/local/bin加入到PATH变量即可。
本来我想自己写个stm32f429的裸机程序,所以要安装交叉编译器,但是后来考虑到写起来比较慢,还是下篇博文中再讲述如何为stm32f429写裸机程序。
linux下stm32f429可用的开发库有官方固件库和libopencm3两种可以选择.如果选用libopencm3,可以参考libopencm3例程,交叉编译器应选择gcc-arm-embedded。
可惜的是libopencm3例程中没有stm32f429i-discovery的例子,在其基础上写代码还是有不少难度的。
我将官方固件库中用于stm32f429i-discovery的hex文件解压,然后压缩成zip文件生成到博客上,可以在这里下载,也可以下载官方固件库后将该文件提取出来。
将该文件改名为f429.hex(要在命令行下输入名称,太长了不好输入)。
用miniusb线(通常我们手机的充电线使用microusb,miniusb头要大一些)连接开发板和pc,然后执行下面的步骤。
然后打开一个控制台,输入下面命令:
$ sudo openocd -f interface/stlink-v2.cfg -f board/stm32f429discovery.cfg
会得到下面的显示信息:
Open On-Chip Debugger 0.9.-dev--g930e41a (---:)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Warn : Interface already configured, ignoring
Error: already specified hl_layout stlink
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : This adapter doesn't support configurable speed
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.903844
Info : stm32f4x.cpu: hardware has breakpoints, watchpoints
Info : accepting 'telnet' connection on tcp/
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x080001d4 msp: 0x2001fff8
flash write image erase ~/soft/f429.hex: command requires more arguments
in procedure 'flash'
flash write image erase /home/host/soft/f429.hex: command requires more arguments
in procedure 'flash'
auto erase enabled
Info : device id = 0x10036419
Info : flash size = 2048kbytes
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x2001fff8
wrote bytes from file /home/host/soft/f429.hex in .677387s (25.785 KiB/s)
然后另外打开一个控制台,执行下面的命令:
telnet localhost
halt
flash write_image erase /home/host/soft/f429.hex
reset run
其中,/home/host/soft/f429.hex是我的f429.hex的绝对路径,需要修改成自己的文件的真实路径。
将开发板复位之后,可以看到需要重新矫正屏幕,矫正之后就可以进入到跟以前一模一样的图形界面。
debian下烧写stm32f429I discovery裸机程序的更多相关文章
- 1_jz2440在linux下烧写裸机程序
常用的烧写方法有: 1.使用并口工具烧写:接线(参考百问网JZ2440V2开发板使用手册),使用oflash烧写(速度比较慢),可烧写.bin文件,从新上电观察效果.可烧写u_boot. 2.使用op ...
- 基于BASYS2的VHDL程序与烧写——按键消抖程序
请尊重作者版权,转载请注明源地址http://www.cnblogs.com/connorzx/p/3548364.html 按键在按下的过程中通常会产生一段时间的抖动,为了消除这种抖动,一般采取两种 ...
- Linux下烧写工具DNW和USB驱动安装(一)
转:http://blog.csdn.net/zhengmeifu/article/details/8837930 Linux下编译记录:编译PC端USB驱动和写入工具dnw_linux.tgz压缩包 ...
- cygwin下烧写文件到sd卡中
在cygwin下将firmware_sdcard.bin写入到sd卡中(cygwin需要以管理员身份启动) 1查看sd分区情况 cat /proc/partitions (为了找到sd卡的标记) 2 ...
- 【Hi3516】 uboot下烧写BSP
setenv serverip xx.xx.xx.xx setenv ipaddr xx.xx.xx.xx setenv ethaddr xx:xx:xx:xx:xx:xx setenv netmas ...
- debian下使用ft232为stm32f429i-discovery烧写uboot和uImage
操作系统:debian 软件: openocd minicom 硬件: MiniUSB线.stm32f429i-discovery, WaveShare FT232串口模块(可以在淘宝上买到) 关 ...
- debian下为stm32f429i-discovery编译uboot、linux内核和根文件系统
交叉编译器:arm-uclinuxeabi-2010q1 交叉编译器下载下来后解压,然后将其中bin文件夹路径加入到PATH变量中. 根据<debian下烧写stm32f429I discove ...
- 给XC2440开发板烧写程序的N种方式
转:http://blog.chinaunix.net/uid-22030783-id-3420080.html 给XC2440开发板烧写程序非常灵活,总结起来有这么几种方式: 空片烧写(flas ...
- 利尔达CC3200模块烧写程序笔记
1. 硬件使用利尔达的CC3200模块,仿真下载器使用利尔达的FTDI仿真器,硬件完全兼容官方的仿真器.仿真器支持IAR的调试,单步运行等操作. 2. 硬件连接接线说明: RXD, TXD, GNG, ...
随机推荐
- 实例化Spring容器的两种常用方式
//在类路径下寻找配置文件来实例化容器 ApplicationContext ctx = new ClassPathXmlApplicationContext(new String[]{"b ...
- Android开发之布局文件里实现OnClick事件关联处理方法
一般监听OnClickListener事件,我们都是通过Button button = (Button)findViewById(....); button.setOClickLisener....这 ...
- Win2003 IIS 安装方法 图文教程
最近水一水 质量不高 见谅 一般大家先安装好win2003系统,图文教程 Win2003 服务器系统安装图文教程要通过控制面板来安装.具体做法为: 1. 进入“控制面板”. 2. 双击“添加或删除程序 ...
- vuex 深入理解
参考自:https://mp.weixin.qq.com/s?src=11×tamp=1528275978&ver=922&signature=ZeHPZ2ZrLir ...
- OJ刷题---ASCII码排序
题目要求: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbGluaGFpeXVuX3l0ZHg=/font/5a6L5L2T/fontsize/400/f ...
- request获取数据的几种方法
1.request.getparameter(); String value=request.getparameter("key"); 2.request.getParameter ...
- 安装WordPress
安装php yum install php-fpm yum install php systemctl start php-fpm 启动php nginx 配置
- java String概述
class StringDemo { public static void main(String[] args) { String s1 = "abc";//s1 是一个类类 ...
- 【Linux】OpenWRT的无线设置注意事项——从2.4G到5G,hwmode不简单
硬件说明: 操作系统:OpenWRT 网卡:AR9220R52Hn 网卡驱动:ath9k OpenWRT在刷机完成之后,并不会自动开启无线功能,需要手动修改配置文件,然后重启网络服务.管理无线功能的配 ...
- python学习(四)字符串学习
#!/usr/bin/python # 这一节学习的是python中的字符串操作 # 字符串是在Python中作为序列存在的, 其他的序列有列表和元组 # 1. 序列的操作 S = 'Spam' # ...