操作系统:debian

软件: openocd  minicom

硬件:  MiniUSB线、stm32f429i-discovery, WaveShare FT232串口模块(可以在淘宝上买到)

关于openocd的配置可以参看我的博文: 《debian下烧写stm32f429I discovery裸机程序

u-boot源码下载:

git clone https://github.com/EmcraftSystems/u-boot.git

linux源码下载:

git clone https://github.com/EmcraftSystems/linux-emcraft.git

将u-boot和linux源码下载下来后进行编译可以得到uboot和linux二进制文件。

也可以直接下载已经编译好的uboot和linux内核(下载地址)。

我暂时先选择直接下载编译好的uboot(u-boot.bin)和linux内核(下载地址,名为networking.uImage),然后下载到/home/host/soft/stm32f429i-discovery/文件夹下。

将FT232的USB口与pc相连。

然后将stm32f429i-discovery与FT232连接(参考链接),连线方式如下:

VDD与VDD相连,GND与GND相连。 PA10(USART_RX)连接FT232的TXD,PA9(USART_TX)链接FT232的RXD。

连好后,执行下面命令:

$ dmesg | tail -n
[ 7875.657099] pl2303 -:1.0: device disconnected
[ 7937.764668] usb -1.1: USB disconnect, device number
[ 7950.012188] usb 1-1.1: new full-speed USB device number 12 using ehci_hcd
[ 7950.126301] usb 1-1.1: New USB device found, idVendor=0403, idProduct=6001
[ 7950.126308] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7950.126312] usb 1-1.1: Product: FT232R USB UART
[ 7950.126316] usb 1-1.1: Manufacturer: FTDI
[ 7950.126320] usb 1-1.1: SerialNumber: A603T3WV
[ 7950.234911] USB Serial support registered for FTDI USB Serial Device
[ 7950.234981] ftdi_sio 1-1.1:1.0: FTDI USB Serial Device converter detected
[ 7950.235018] usb 1-1.1: Detected FT232RL
[ 7950.235020] usb 1-1.1: Number of endpoints 2
[ 7950.235022] usb 1-1.1: Endpoint 1 MaxPacketSize 64
[ 7950.235024] usb 1-1.1: Endpoint 2 MaxPacketSize 64
[ 7950.235026] usb 1-1.1: Setting MaxPacketSize 64
[ 7950.235595] usb 1-1.1: FTDI USB Serial Device converter now attached to ttyUSB0
[ 7950.235614] usbcore: registered new interface driver ftdi_sio
[ 7950.235616] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver

红色字体部分是插入ft232模块后的系统信息,现在可以通过/dev/ttyUSB0来访问ft232串口。

参考文章《debian下烧写stm32f429I discovery裸机程序

在一个控制台执行sudo minicom,配置成/dev/ttyUSB0,115200,8N1,No Harware Flow Control,No Software Flow Control.

另一个控制台下执行下面命令:

sudo openocd -f  interface/stlink-v2.cfg -f board/stm32f429discovery.cfg 

再开一个控制台执行下面的命令:

telnet localhost 4444
halt
flash probe 0
flash info 0
flash write_image erase  /home/host/soft/stm32f429i-discovery/u-boot.bin 0x08000000 bin
reset run

其中可以用flash banks查看flash信息:

> flash banks
# : stm32f4x.flash (stm32f2x) at 0x08000000, size 0x00200000, buswidth , chipwidth

flash映射地址位于0x08000000,前面的命令用来将uboot也烧写到这个位置。

再参考文章《Loading Linux Images over UART》将内核下载到内存中。

然后就可以在运行minicom的控制台下按任意键看到下面的信息:

U-Boot 2010.03-linux-cortexm-1.12. (Jan   - ::)

CPU  : STM32F4 (Cortex-M4)
Freqs: SYSCLK=180MHz,HCLK=180MHz,PCLK1=45MHz,PCLK2=90MHz
Board: STM32F429-DISCOVERY Rev .A
DRAM: MB
*** Warning - bad CRC, using default environment In: serial
Out: serial
Err: serial
Net: STM32_MAC
Hit any key to stop autoboot:
STM32F429-DISCO>

在uboot下执行loady,然后按下快捷键ctrl+A,再按下z键,再按下S键,选择ymodem,然后按g键,输入文件夹路径/home/host/soft/stm32f429i-discovery,多次按下‘向下’键,

直到光标到networking.uImage处,然后按下空格键,同时要保证最下面的光标位于Okay处(如果不在Okay处,可以左右键找到将其移动到Okay处),然后按下回车键,

就会开始传输文件了,等传输完毕后,屏幕中间会显示下面的信息:

Transfer complete
READY: press any key to continue...

按下任意键,显示下面信息:

## Ready for binary (ymodem) download to 0xD0007FC0 at 115200 bps...                                                       
Cdem - CRC mode, 12442(SOH)/0(STX)/0(CAN) packets, 5 retries
## Total Size      = 0x00184ba0 = 1592224 Bytes

然后在uboot下执行下面命令:

STM32F429-DISCO> bootm 0xd0007fc0
## Booting kernel from Legacy Image at d0007fc0 ...
   Image Name:   Linux-2.6.33-arm1
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1592160 Bytes =  1.5 MB
   Load Address: d0008000
   Entry Point:  d0008001
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK Starting kernel ... Linux version 2.6.33-arm1 (vlad@ocean.emcraft.com) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-189) ) #4 Fri Jan 24 14:49:11 MSK 2014
CPU: ARMv7-M Processor [410fc241] revision 1 (ARMv7M)
CPU: NO data cache, NO instruction cache
Machine: STMicro STM32
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 2032
Kernel command line: stm32_platform=stm-disco console=ttyS0,115200 panic=10 ip=172.17.4.206:172.17.0.1:::stm-disco:eth0:off ethaddr=C0:B1:3C:88:88:85
PID hash table entries: 32 (order: -5, 128 bytes)
Dentry cache hash table entries: 1024 (order: 0, 4096 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 8MB = 8MB total
Memory: 6496k/6496k available, 1696k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0x00000000 - 0x00001000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0x00000000 - 0xffffffff   (4095 MB)
    lowmem  : 0xd0000000 - 0xd0800000   (   8 MB)
    modules : 0xd0000000 - 0xd0800000   (   8 MB)
      .init : 0xd0008000 - 0xd0092000   ( 552 kB)
      .text : 0xd0092000 - 0xd017d000   ( 940 kB)
      .data : 0xd017e000 - 0xd018cb60   (  59 kB)
Hierarchical RCU implementation.
NR_IRQS:90
Calibrating delay loop... 36.45 BogoMIPS (lpj=182272)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
Switching to clocksource cm3-systick
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: STM32 USART driver
stm32serial.0: ttyS0 at MMIO 0x40011000 (irq = 37) is a STM32 USART Port
console [ttyS0] enabled
blackfin-eth: Using SRAM for DMA buffers from 20001000
blackfin-eth: found MAC at 0x40028000, irq 61
blackfin_mii_bus: probed
found PHY id 0x0 addr 0
eth0: using MII interface
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=00:00, irq=-1)
TCP cubic registered
NET: Registered protocol family 17
ARMv7-M VFP Extension supported
IP-Config: Failed to open eth0
IP-Config: Device `eth0' not found.
Freeing init memory: 552K
init started: BusyBox v1.17.0 (2014-01-24 14:46:25 MSK)
~ # ls
bin    dev    etc    httpd  init   mnt    proc   root   sys    usr    var

现在uboot和uImage都已经下载成功了,尽情的hack吧!

debian下使用ft232为stm32f429i-discovery烧写uboot和uImage的更多相关文章

  1. 通过NORFLASH中的uboot烧写uboot到nandFlash

    在mini2440的教程中,在构建nandflash系统的时候是首先通过supervivi借助dnw烧写uboot.bin到nand flash 第零块, 由于我使用的是64位操作系统,usb驱动没安 ...

  2. 嵌入式系统烧写uboot/bootloader/kernel的一般方法

    嵌入式系统烧写uboot/bootloader/kernel的一般方法   本文介绍了在嵌入式系统中烧写uboot/bootloader/kernel 的一般方法,以及如果uboot或者内核出现错误, ...

  3. arm+linux 裸机环境搭建之初试minicom+dnw烧写uboot

    下面的步骤将会实现在linux下面使用dnw+minicom来烧写uboot 一.安装minicom 下载地址:http://download.csdn.net/detail/king_bingge/ ...

  4. Jlink 烧写Uboot

    第一章 Hi3531_SDK_Vx.x.x.x版本升级操作说明 如果您是首次安装本SDK,请直接参看第2章. 第二章首次安装SDK 1.Hi3531 SDK包位置 在"Hi3531_V100 ...

  5. EASYARM-IMX283 烧写uboot和linux系统

    新入手一台EASYARM-IMX283开发板(以下简称IMX823),价格比较便宜,配置也不错. 开发板默认安装了WINCE,我还是决定重新烧写uboot和linux内核. 开发板配套光盘里面有不少烧 ...

  6. 驱动开发学习笔记. 0.02 基于EASYARM-IMX283 烧写uboot和linux系统

    驱动开发读书笔记. 0.02 基于EASYARM-IMX283 怎么烧写自己裁剪的linux内核?(非所有arm9通用) 手上有一块tq2440,但是不知道什么原因,没有办法烧boot进norflas ...

  7. Tiny210编译和烧写u-boot步骤

    当有多个交叉编译器是,不方便设置环境变量时,可以在编译命令中指定交叉编译器,具体如下: make ARCH=arm CROSS_COMPILE=/opt/FriendlyARM/toolschain/ ...

  8. Tiny4412 烧写uboot到emmc步骤

    将uboot写入emmc,并通过EMMC驱动,不在只用SD卡启动 烧写uboot的之前用如下命令查看EMMC卡信息及分区信息: mmcinfo 0: 查看mmc卡信息, 0表示SD卡:1表示emmc卡 ...

  9. 烧写uboot和openwrt固件ARxx系列

      以AR9331为例. 1.用烧录器将uboot烧写到flash中 (AR9331_U-Boot_Oolite-v1-v20170713.bin) 2.登录:192.168.1.1网页烧写uboot ...

随机推荐

  1. 【cocos2d-x 3.x 学习笔记】对象内存管理

    内存管理 内存管理一直是一个不易处理的问题.开发人员必须考虑分配回收的方式和时机,针对堆和栈做不同的优化处理,等等.内存管理的核心是动态分配的对象必须保证在使用完成后有效地释放内存,即管理对象的生命周 ...

  2. 经常使用socket函数具体解释

    经常使用socket函数具体解释 关于socket函数,每一个的意义和基本功能都知道,但每次使用都会去百度,參数究竟是什么,返回值代表什么意义.就是说用的少,也记得不够精确. 每次都查半天.常常烦恼于 ...

  3. python中wxpython用法

    转载:https://wxpython.org/pages/overview/ Hello World Every programming language and UI toolkit needs ...

  4. mac eclipse 删除不用的workspace

    file--->switch workspace---->other 点击 recent workspace--->选中删除即可

  5. ubuntu安装分区

    ♠ 文件系统 windows下常见的文件系统有FAT, FAT32, NTFS 在linux里可使用的文件系统: Ext2: 早期的格式,不支持日志. Ext3: 是ext2改良版,增加了日志功能, ...

  6. Crashing Robots - poj 2632

      Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8352   Accepted: 3613 Description In ...

  7. Maven项目Update Project...后JRE System Library会自动变回1.5解决办法

    <build> <finalName>pay</finalName> <plugins> <plugin> <groupId>o ...

  8. 【JMeter4.0学习(五)】JMeter对服务器监控测试脚本开发

    目录: 下载相关JMeter插件 服务器监控测试脚本开发 附:参考相关文档 本文主要来说一下如何通过JMeter插件来监控服务器CPU.内存.磁盘.网络等相关资源. 一.首先,需要下载相关JMeter ...

  9. py.test

    只运行某一个用例 pytest test_mod.py::test_func 或者 pytest test_mod.py::TestClass::test_method

  10. php 如何把中文写入json中 当json文件中还显示的是中文

    /*** * 更新版本 */ function showupversionsub(){ #接受post 过来的数据 $app_type=$_POST['aap_type']; if($app_type ...