博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
STM32F429-Discovery 编译 uclinux
阅读量:4125 次
发布时间:2019-05-25

本文共 6343 字,大约阅读时间需要 21 分钟。

STM32F429 Discovery 编译 uclinux

文章目录

1. 环境要求

1.1 硬件环境

  • STM32F429-Disc1 官方开发板
  • usb mini线
  • usb转串口线(TTL电平)

1.2 软件环境

  • Ubuntu 14.04 64位
  • STM32 ST-LINK Utility烧写工具

2. 安装交叉工具链

  • Download from Mentor Graphics
  • only arm-2010q1 is known to work; don’t use SourceryG++ arm-2011.03
tar jxvf arm-2010q1-189-arm-uclinuxeabi-i686-pc-linux-gnu.tar.bz2export PATH=$PATH:`pwd`/arm-2010q1/bin

$ arm-uclinuxeabi-gcc -v 会遇到以下问题

arm-uclinuxeabi-gcc: No such file or directory
The toolchain commands are made by 32bit program, and need 32bit running environment.
(My host OS is ubuntu 64bit)

$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

安装交叉工具链测试正常如下:

lisongze@lisongze-ubuntu14:~/stm32f429_uclinux/stm32f429-linux-builder$ arm-uclinuxeabi-gcc -vUsing built-in specs.Target: arm-uclinuxeabiConfigured with: /scratch/julian/2010q1-release-uclinux-lite/src/gcc-4.4-2010q1/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-uclinuxeabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-gnu-as --with-gnu-ld --with-specs='%{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --disable-shared --disable-lto --with-pkgversion='Sourcery G++ Lite 2010q1-189' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-uclinuxeabi/libc --with-build-sysroot=/scratch/julian/2010q1-release-uclinux-lite/install/arm-uclinuxeabi/libc --with-gmp=/scratch/julian/2010q1-release-uclinux-lite/obj/host-libs-2010q1-189-arm-uclinuxeabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/2010q1-release-uclinux-lite/obj/host-libs-2010q1-189-arm-uclinuxeabi-i686-pc-linux-gnu/usr --with-ppl=/scratch/julian/2010q1-release-uclinux-lite/obj/host-libs-2010q1-189-arm-uclinuxeabi-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/julian/2010q1-release-uclinux-lite/obj/host-libs-2010q1-189-arm-uclinuxeabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/2010q1-release-uclinux-lite/install/arm-uclinuxeabi/bin --with-build-time-tools=/scratch/julian/2010q1-release-uclinux-lite/install/arm-uclinuxeabi/binThread model: singlegcc version 4.4.1 (Sourcery G++ Lite 2010q1-189)

3. 安装romfs工具

$ sudo apt-get install genromfs

4. stm32f429 linux download, build and install

4.1 下载源码

$ git clone http://github.com/jserv/stm32f429-linux-builder

或者

$ git clone http://github.com/lisongze2016/stm32f429-linux-builder

4.2 编译

$ cd stm32f429-linux-builder$ make$ make install

5. 烧写

5.1 用STM32 ST-LINK Utility烧写工具烧写:

addr bin 编译生成路径
0x08000000 u-boot.bin out/uboot/u-boot.bin
0x08020000 xipuImage.bin out/kernel/arch/arm/boot/xipuImage.bin
0x08120000 romfs.bin out/romfs.bin

5.2 serial connections.

  • STM32 PC11 --> Cable connector Orange Txd(PC)
  • STM32 PC10 --> Cable connector Yellow Rxd(PC)

5.3 Terminal settings:

  • Baud rate: 115200
  • Data: 8 bit
  • Parity: none
  • Stop: 1 bit
  • Flow control: none

5.4 Booting console output.

U-Boot 2010.03-00003-g934021a (Feb 26 2020 - 22:18:29)CPU  : STM32F4 (Cortex-M4)Freqs: SYSCLK=180MHz,HCLK=180MHz,PCLK1=45MHz,PCLK2=90MHzBoard: STM32F429I-DISCOVERY board,Rev 1.0DRAM:   8 MBUsing default environmentHit any key to stop autoboot:  0 ## Booting kernel from Legacy Image at 08020000 ...   Image Name:   Linux-2.6.33-arm1   Image Type:   ARM Linux Kernel Image (uncompressed)   Data Size:    738336 Bytes = 721 kB   Load Address: 08020040   Entry Point:  08020041   Verifying Checksum ... OK   Loading Kernel Image ... OKOKStarting kernel ...Linux version 2.6.33-arm1 (lisongze@lisongze-ubuntu14) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-189) ) #1 Wed Feb 26 23:16:15 CST 2020CPU: ARMv7-M Processor [410fc241] revision 1 (ARMv7M)CPU: NO data cache, NO instruction cacheMachine: STMicro STM32Ignoring unrecognised tag 0x54410008Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 1778Kernel command line: stm32_platform=stm32429-disco mem=7M console=ttyS2,115200n8 consoleblank=0 root=/dev/mtdblock0 rdinit=/sbin/init video=vfb:enable,fbmem:0x90700000,fbsize:0x100000PID 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: 7MB = 7MB totalMemory: 6976k/6976k available, 192k reserved, 0K highmemVirtual kernel memory layout:    vector  : 0x00000000 - 0x00001000   (   4 kB)    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)    vmalloc : 0x00000000 - 0xffffffff   (4095 MB)    lowmem  : 0x90000000 - 0x90700000   (   7 MB)    modules : 0x90000000 - 0x90800000   (   8 MB)      .init : 0x9000a000 - 0x9000e000   (  16 kB)      .text : 0x08028000 - 0x080c4000   ( 624 kB)      .data : 0x90008000 - 0x90018460   (  66 kB)Hierarchical RCU implementation.NR_IRQS:90Console: colour dummy device 80x30Calibrating delay loop... 168.34 BogoMIPS (lpj=841728)Mount-cache hash table entries: 512bio: create slab 
at 0Switching to clocksource cm3-systickROMFS MTD (C) 2007 Red Hat, Inc.io scheduler noop registeredio scheduler deadline registered (default)Console: switching to colour frame buffer device 60x53fb0: Virtual frame buffer device, using 1024K of video memorySerial: STM32 USART driverstm32serial.2: ttyS2 at MMIO 0x40004800 (irq = 39) is a STM32 USART Portconsole [ttyS2] enabledbrd: module loadeduclinux[mtd]: ROM probe address=0x8120000 size=0x59000Creating 1 MTD partitions on "ROM":0x000000000000-0x000000059000 : "ROMfs"ARMv7-M VFP Extension supportedVFS: Mounted root (romfs filesystem) readonly on device 31:0.Freeing init memory: 16Kstarting pid 27, tty '/dev/ttyS2': '/bin/login -f root'Welcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ \ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_|For further information check:http://www.uclinux.org/Jan 1 00:00:01 login[27]: root login on 'ttyS2'~ # lsbin etc proc root sys usrdev lib ramfs.img sbin tmp var~ # dateThu Jan 1 00:00:52 UTC 1970~ #

5.5 lcd 显示如下:

stm32f429_display

6.参考链接

转载地址:http://orlpi.baihongyu.com/

你可能感兴趣的文章
Spring MVC中使用Thymeleaf模板引擎
查看>>
PHP 7 的五大新特性
查看>>
深入了解php底层机制
查看>>
PHP中的stdClass 【转】
查看>>
XHProf-php轻量级的性能分析工具
查看>>
OpenCV gpu模块样例注释:video_reader.cpp
查看>>
就在昨天,全球 42 亿 IPv4 地址宣告耗尽!
查看>>
如果你还不了解 RTC,那我强烈建议你看看这个!
查看>>
沙雕程序员在无聊的时候,都搞出了哪些好玩的小玩意...
查看>>
Mysql复制表以及复制数据库
查看>>
Linux下SVN客户端使用教程
查看>>
Linux分区方案
查看>>
如何使用 systemd 中的定时器
查看>>
git命令速查表
查看>>
linux进程监控和自动重启的简单实现
查看>>
OpenFeign学习(三):OpenFeign配置生成代理对象
查看>>
OpenFeign学习(四):OpenFeign的方法同步请求执行
查看>>
OpenFeign学习(五):OpenFeign请求结果处理及重试控制
查看>>
OpenFeign学习(六):OpenFign进行表单提交参数或传输文件
查看>>
Ribbon 学习(二):Spring Cloud Ribbon 加载配置原理
查看>>