sudo apt-get install libusb-dev //ubuntu环境 sudo pacman -S libusb sudo pacman -S libusb1 //archlinux环境
安装完usb驱动后安装dnw2 网上很多文章说的都是自己用dnw2编译安装
其实archlinux下可以很方便的使用yaourt安装
yaourt dnw2
关于yaourt的使用就不说明了
安装完成后
开发板未上电的情况下通过lsusb命令查看usb信息
[leftover-crazy@leftover-crazy ~]$ lsusb
Bus 002 Device 004: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 014: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 004: ID 04f2:b071 Chicony Electronics Co., Ltd 2.0M UVC Webcam / CNF7129
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
再次查看lsusb信息得到以下结果
[leftover-crazy@leftover-crazy ~]$ lsusb Bus 002 Device 004: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 020: ID 5345:1234 Owon PDS6062T Oscilloscope Bus 001 Device 014: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter Bus 001 Device 004: ID 04f2:b071 Chicony Electronics Co., Ltd 2.0M UVC Webcam / CNF7129 Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
查看dnw2.c源文件有如下宏定义
#define QQ2440_SECBULK_IDVENDOR 0x5345 #define QQ2440_SECBULK_IDPRODUCT 0x1234
所以就不需要修改源文件了 证明我们之前通过yaourt安装的是可以直接使用的
下面就是烧写过程了:
+------------------------------------------------------------+ | FL2440 Bootloader VER-5.1 www.witech.com.cn | |------------------------------------------------------------| |------------------------------------------------------------| |CPU ID is 0x32440001 | |FCLK=400MHz,HCLK=100MHz,PCLK=50MHz, CPU is running at 400MHz| |UPLL=96MHz, UCLK=48MHz | |Serial port 0, Baud rate is 115200. | |OS image stored in NAND Flash. | |Autoboot delay is 7 seconds. | +------------------------------------------------------------+ +------------------------------------------------------------+ | Select Menu | +------------------------------------------------------------+ | [0] Download & Run | | [1] Download to flash | | [2] Download From UART | | [3] Boot My Application | | [4] Boot Linux | | [5] Boot Wince | | [6] Erase Flash Partition | | [7] Config parameters | +------------------------------------------------------------+
选择6后擦除想烧写的分区
擦除完毕后选择烧写flash选项
接着选择烧写对应flash分区
之后就是使用dnw2烧写
dnw2使用格式是
Usage: dnw2 [options] file [address] Options: -h, --help - This help text. address - hexadecimal notation, e.g. 0x30800000, default is 0x30800000 //fl2440可以不设置烧写地址 因为默认的就是0x30800000
然后就是等待了 :-) usb烧写速度很快的 这种方法只适合在板上有bootloader的情况
先通过usb下载到ram里 然后通过bootloader的烧写功能烧写到响应的flash
这里minicom选择烧写分区就是用于指定烧写地址
dnw2的功能就是将目标文件下载到ram里
因为内存的速度很快 usb下载速度也很快 所以烧写速度很快