打印
[STM32F7]

STM32F746开发板启动Linux4.2也成功了

[复制链接]
7710|30
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
不爱说话|  楼主 | 2018-1-8 15:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 不爱说话 于 2018-1-8 15:15 编辑

去年的这个时候 我的STM32F429开发板成功运行Linux4.2(uClinux)
经过1年的完善,现在已经可以运行主线Linux4.14版本内核,随着主线更新相信外设驱动会逐渐完善的(已有USART, GPIO, I2C, SPI, ADC, DAC, PWM等驱动)。以后跟进主线内核更新就OK了。
现在可以腾出时间玩Cortex-M7了,于是前段时间选了一片和F429ZET6 pin2pin兼容的F7-STM32F746ZET6焊接了一块板子。除了主芯片其他和F429板子配置相同。
按照之前的流程,移植u-boot,移植linux,最后还算顺利,完成了emcraft的Linux4.2的移植。下面附上启动log,由于M7有cache因此速度相对于M4有了质的提高,达到了378.47 BogoMIPS!

U-Boot 2010.03 (Dec 05 2017 - 20:38:02)

CPU  : STM32F7 (Cortex-M7)
Freqs: SYSCLK=192MHz,HCLK=192MHz,PCLK1=48MHz,PCLK2=96MHz
Board: STM32F746 Discovery Rev 1.A, efusion.taobao.com
DRAM:  64 MB
In:    serial
Out:   serial
Err:   serial
Net:   miiphy_register done.
stm_phy_init: found PHY id = 0x7c0f1 at addr 0x0
eth hw init done.
STM32_MAC
Hit any key to stop autoboot:  0

STM32F746-DISCO> setenv ipaddr 169.254.1.10;setenv serverip 169.254.1.2;tftp STM32F7/rootfs
.uImage;setenv bootargs 'stm32_platform=stm-disco console=ttyS0,115200 panic=5 ip=169.254.1
.10:169.254.1.2:::stm32f7-disco:eth0:on';bootm
stm_phy_init: found PHY id = 0x7c0f1 at addr 0x0
STM32_MAC: link UP (100/Full)
stm_mac_address_set: mac is 0xc0:0xb1:0x3c:0x88:0x88:0x85.
Using STM32_MAC device
TFTP from server 169.254.1.2; our IP address is 169.254.1.10
Filename 'STM32F7/rootfs.uImage'.
Load address: 0xc0007fb4
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #####
done
Bytes transferred = 5785387 (58472b hex)
## Booting kernel from Legacy Image at c0007fb4 ...
   Image Name:   Linux-4.2.0
   Image Type:   ARM Linux Multi-File Image (uncompressed)
   Data Size:    5785323 Bytes =  5.5 MB
   Load Address: c0008000
   Entry Point:  c0008001
   Contents:
      Image 0: 5767448 Bytes =  5.5 MB
      Image 1: 17863 Bytes = 17.4 kB
   Verifying Checksum ... OK
## Flattened Device Tree from multi component Image at C0007FB4
   Booting using the fdt at 0xc0588118
   Loading Multi-File Image ... OK
OK
   Loading Device Tree to c3ff8000, end c3fff5c6 ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.2.0 (hw@localhost.localdomain) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1
-189) ) #21 Fri Dec 29 09:41:39 CST 2017
CPU: ARMv7-M [410fc271] revision 1 (ARMv7M), cr=00000000
CPU: WBA data cache, WBA instruction cache
Machine model: EmCraft Systems STM32F7-SOM board
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: stm32_platform=stm-disco console=ttyS0,115200 panic=5 ip=169.254.1.10:
169.254.1.2:::stm32f7-disco:eth0:on
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 58100K/65536K available (2299K kernel code, 166K rwdata, 504K rodata, 2660K init, 9
6K bss, 7436K reserved, 0K cma-reserved)
Virtual kernel memory layout:
    vector  : 0x00000000 - 0x00001000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0x00000000 - 0xffffffff   (4095 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
      .text : 0xc0008000 - 0xc02c5000   (2804 kB)
      .init : 0xc02c5000 - 0xc055e000   (2660 kB)
      .data : 0xc055e000 - 0xc0587a40   ( 167 kB)
       .bss : 0xc0588118 - 0xc05a03a4   (  97 kB)
NR_IRQS:16 nr_irqs:16 16
/interrupt-controller@40013c00: 24 External IRQs detected
clocksource: arm_system_timer: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 311077528
ns
ARM System timer initialized as clocksource
/soc/timer@40000000: STM32 clockevent driver initialized (32 bits)
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Calibrating delay loop... 378.47 BogoMIPS (lpj=1892352)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
devtmpfs: initialized
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 191126044627500
00 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
stm32-pinctrl pin-controller: nbanks = 11
stm32-pinctrl pin-controller: nfunctions = 16
stm32-pinctrl pin-controller: ngroups = 18
stm32-pinctrl pin-controller: GPIOA bank added.
stm32-pinctrl pin-controller: GPIOB bank added.
stm32-pinctrl pin-controller: GPIOC bank added.
stm32-pinctrl pin-controller: GPIOD bank added.
stm32-pinctrl pin-controller: GPIOE bank added.
stm32-pinctrl pin-controller: GPIOF bank added.
stm32-pinctrl pin-controller: GPIOG bank added.
stm32-pinctrl pin-controller: GPIOH bank added.
stm32-pinctrl pin-controller: GPIOI bank added.
stm32-pinctrl pin-controller: GPIOJ bank added.
stm32-pinctrl pin-controller: GPIOK bank added.
stm32-pinctrl pin-controller: Function[0         name:i2c_1,    groups:1]
stm32-pinctrl pin-controller: Function[1         name:i2c_2,    groups:1]
stm32-pinctrl pin-controller: Function[2         name:i2c_3,    groups:1]
stm32-pinctrl pin-controller: Function[3         name:mac,      groups:2]
stm32-pinctrl pin-controller: Function[4         name:sdio,     groups:1]
stm32-pinctrl pin-controller: Function[5         name:spi_1,    groups:1]
stm32-pinctrl pin-controller: Function[6         name:spi_2,    groups:1]
stm32-pinctrl pin-controller: Function[7         name:spi_4,    groups:1]
stm32-pinctrl pin-controller: Function[8         name:spi_5,    groups:1]
stm32-pinctrl pin-controller: Function[9         name:usart1,   groups:1]
stm32-pinctrl pin-controller: Function[10        name:usart6,   groups:1]
stm32-pinctrl pin-controller: Function[11        name:usart7,   groups:1]
stm32-pinctrl pin-controller: Function[12        name:usb_fs,   groups:1]
stm32-pinctrl pin-controller: Function[13        name:usb_hs,   groups:1]
stm32-pinctrl pin-controller: Function[14        name:ltdc,     groups:1]
stm32-pinctrl pin-controller: Function[15        name:gpio,     groups:2]
stm32_dma 40026000.dma: STM32 DMA Controller ( slave ), 8 channels
stm32_dma 40026400.dma: STM32 DMA Controller ( slave ), 8 channels
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
soc:phy_hs supply vcc not found, using dummy regulator
soc:phy_fs supply vcc not found, using dummy regulator
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
Bluetooth: Core ver 2.20
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
clocksource: Switched to clocksource arm_system_timer
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Power Management for STM32
futex hash table entries: 16 (order: -5, 192 bytes)
jffs2: version 2.2. (NAND) ?? 2001-2006 Red Hat, Inc.
fuse init (API version 7.23)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
io scheduler noop registered
io scheduler cfq registered (default)
STM32 USART driver initialized
stm32-pinctrl pin-controller: maps: function usart1 group usart1-0 num 3
40011000.serial: ttyS0 at MMIO 0x40011000 (irq = 33, base_baud = 6000000) is a stm32f7-usar
t
console [ttyS0] enabled
stm32-pinctrl pin-controller: maps: function spi_1 group spi_1-0 num 4
m25p80 spi0.0: found w25q128, expected m25p32
m25p80 spi0.0: w25q128 (16384 Kbytes)
2 ofpart partitions found on MTD device spi0.0
Creating 2 MTD partitions on "spi0.0":
0x000000000000-0x000000600000 : "spi_flash_part0"
0x000000600000-0x000001000000 : "spi_flash_part1"
stm32-spi 40013000.spi: SPI Controller 0 at 40013000,irq=35,hz=96000000
stm32-pinctrl pin-controller: maps: function mac group mac_rmii num 10
stmmac - user ID: 0x10, Synopsys ID: 0x35
Ring mode enabled
DMA HW capability register supported
Enhanced/Alternate descriptors
        Enabled extended descriptors
RX Checksum Offload Engine supported (type 2)
TX Checksum insertion supported
Wake-Up On Lan supported
Enable RX Mitigation via HW Watchdog Timer
libphy: stmmac: probed
eth0: PHY ID 0007c0f1 at 0 IRQ POLL (stmmac-0:00) active
PPP generic driver version 2.4.2
PPP BSD Compression module registered
PPP Deflate Compression module registered
usbcore: registered new interface driver rt2800usb
stm32-pinctrl pin-controller: maps: function usb_hs group usb_hs-0 num 3
(0x4004000C)GUSBCFG = 0x00001410
(0x4004000C)GUSBCFG = 0x20001440
dwc2 40040000.usb: DWC OTG Controller
dwc2 40040000.usb: new USB bus registered, assigned bus number 1
dwc2 40040000.usb: irq 53, io mem 0x00000000
dwc2 40040000.usb: Unable to clear enable on channel 0
dwc2 40040000.usb: Unable to clear enable on channel 1
dwc2 40040000.usb: Unable to clear enable on channel 2
dwc2 40040000.usb: Unable to clear enable on channel 3
dwc2 40040000.usb: Unable to clear enable on channel 4
dwc2 40040000.usb: Unable to clear enable on channel 5
dwc2 40040000.usb: Unable to clear enable on channel 6
dwc2 40040000.usb: Unable to clear enable on channel 7
dwc2 40040000.usb: Unable to clear enable on channel 8
dwc2 40040000.usb: Unable to clear enable on channel 9
dwc2 40040000.usb: Unable to clear enable on channel 10
dwc2 40040000.usb: Unable to clear enable on channel 11
dwc2 40040000.usb: Unable to clear enable on channel 12
dwc2 40040000.usb: Unable to clear enable on channel 13
dwc2 40040000.usb: Unable to clear enable on channel 14
dwc2 40040000.usb: Unable to clear enable on channel 15
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
stm32-pinctrl pin-controller: maps: function usb_fs group usb_fs-0 num 3
50000000.usb supply vusb_d not found, using dummy regulator
50000000.usb supply vusb_a not found, using dummy regulator
dwc2 50000000.usb: EPs: 6, dedicated fifos, 512 entries in SPRAM
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver ch341
usbserial: USB Serial support registered for ch341-uart
usbcore: registered new interface driver cp210x
usbserial: USB Serial support registered for cp210x
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
dwc2 50000000.usb: bound driver g_serial
i2c /dev entries driver
stm32-pinctrl pin-controller: maps: function i2c_1 group i2c_1-0 num 3
stm32f7-i2c 40005400.i2c: bus(100000) or ref(48000000) clock is not supported
stm32f7-i2c: probe of 40005400.i2c failed with error -22
usbcore: registered new interface driver btusb
stm32-pinctrl pin-controller: maps: function sdio group sdio-0 num 7
mmci-pl18x 40012c00.sdi: Got CD GPIO
mmci-pl18x 40012c00.sdi: No vqmmc regulator found
mmci-pl18x 40012c00.sdi: mmc0: PL180 manf 80 rev4 at 0x40012c00 irq 34,0 (pio)
mmci-pl18x 40012c00.sdi: DMA channels RX dma1chan3, TX dma1chan3
stm32-pinctrl pin-controller: maps: function gpio group outs num 2
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 17
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
stm32-pinctrl pin-controller: maps: function gpio group ins num 2
input: inputs as /devices/platform/inputs/input/input0
IP-Config: Guessing netmask 255.255.0.0
IP-Config: Complete:
     device=eth0, hwaddr=c0:b1:3c:88:88:85, ipaddr=169.254.1.10, mask=255.255.0.0, gw=255.2
55.255.255
     host=stm32f7-disco, domain=, nis-domain=(none)
     bootserver=169.254.1.2, rootserver=169.254.1.2, rootpath=
vmmc: disabling
Freeing unused kernel memory: 2660K (c02c5000 - c055e000)
init started: BusyBox v1.17.0 (2017-01-12 16:24:58 CST)
/ #
/ #
/ #
/ # stm32-dwmac 40028000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
ls dev
bus                 mtd1ro              ptyp3
console             mtdblock0           random
cpu_dma_latency     mtdblock1           rfkill
cuse                network_latency     tty
full                network_throughput  ttyGS0
fuse                null                ttyS0
input               ppp                 ttyp0
kmsg                ptmx                ttyp1
mem                 ptp0                ttyp2
memory_bandwidth    pts                 ttyp3
mtd0                ptyp0               urandom
mtd0ro              ptyp1               zero
mtd1                ptyp2
/ # ifconfig
eth0      Link encap:Ethernet  HWaddr C0:B1:3C:88:88:85
          inet addr:169.254.1.10  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:254 (254.0 B)  TX bytes:0 (0.0 B)
          Interrupt:52 Base address:0x8000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

andom: nonblocking pool is initialized
/ #

沙发
heisexingqisi| | 2018-1-8 18:39 | 只看该作者
移植的真成功,楼主是这方面高手啊,如果挂载个显示屏,可以跑各种小游戏了。

使用特权

评论回复
板凳
不爱说话|  楼主 | 2018-1-8 22:17 | 只看该作者
heisexingqisi 发表于 2018-1-8 18:39
移植的真成功,楼主是这方面高手啊,如果挂载个显示屏,可以跑各种小游戏了。 ...

现在极度不想做硬件,能不动手绝不动手:)

使用特权

评论回复
地板
fengfeng的恒| | 2018-1-9 09:30 | 只看该作者
厉害厉害,现在STM32H7出来了,听说性能很不错。楼主应该有兴趣移植上去的。

使用特权

评论回复
5
不爱说话|  楼主 | 2018-1-9 10:42 | 只看该作者
fengfeng的恒 发表于 2018-1-9 09:30
厉害厉害,现在STM32H7出来了,听说性能很不错。楼主应该有兴趣移植上去的。 ...

H7太贵,据说TB散片大约150一片。

使用特权

评论回复
6
dingbo95| | 2018-1-10 12:41 | 只看该作者
想学习下实例。不知道有没有资料

使用特权

评论回复
7
不爱说话|  楼主 | 2018-1-10 15:16 | 只看该作者
本帖最后由 不爱说话 于 2018-1-10 15:23 编辑
dingbo95 发表于 2018-1-10 12:41
想学习下实例。不知道有没有资料


linux一般来说没有统一通用的教程。这是开源软件不好的地方。
不过有一点linux基础的话还是很容易上手的。
另外linux有众多的开源软件,理论上只要重新编译源码就可以在不同的硬件平台上运行,这是其他嵌入式系统无法比拟的。

使用特权

评论回复
8
toofree| | 2018-1-11 02:02 | 只看该作者
楼主厉害,佩服。刚把去年的帖子也看了F429

使用特权

评论回复
9
ruanhongyu| | 2018-1-11 15:33 | 只看该作者
不是说跑Linux必须要有“内存管理单元”吗?Cortex-M系也可以?

使用特权

评论回复
10
51xlf| | 2018-1-11 16:18 | 只看该作者

使用特权

评论回复
11
usysm| | 2018-1-11 16:19 | 只看该作者
这个有移植的教程吗

使用特权

评论回复
12
typeof| | 2018-1-11 16:19 | 只看该作者
高端了。

使用特权

评论回复
13
yujielun| | 2018-1-11 16:20 | 只看该作者
运行的速度怎么样

使用特权

评论回复
14
htmlme| | 2018-1-11 16:20 | 只看该作者
u-boot怎么下载的?

使用特权

评论回复
15
51xlf| | 2018-1-11 16:24 | 只看该作者
这个都能移植。

使用特权

评论回复
16
usysm| | 2018-1-11 16:24 | 只看该作者
是否需要修改bootloader?

使用特权

评论回复
17
yujielun| | 2018-1-11 16:24 | 只看该作者
STM32是不是也需要字符驱动了

使用特权

评论回复
18
htmlme| | 2018-1-11 16:24 | 只看该作者
是jlink吗?

使用特权

评论回复
19
typeof| | 2018-1-11 16:24 | 只看该作者
Linux玩得很溜。

使用特权

评论回复
20
不爱说话|  楼主 | 2018-1-11 17:04 | 只看该作者
htmlme 发表于 2018-1-11 16:20
u-boot怎么下载的?

调试阶段,u-boot通过以太网下载内核镜像启动linux
稳定后可以烧写到SPI Flash里,上电u-boot直接从里面加载镜像到sdram里启动。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:飞翼电子工作室 http://shop68798667.taobao.com/

115

主题

885

帖子

34

粉丝