htjgdw 发表于 2018-1-8 22:25:55

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

本帖最后由 htjgdw 于 2018-1-9 15:06 编辑

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


U-Boot 2010.03 (Dec 29 2017 - 10:35:40)


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 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
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
stm32-pinctrl pin-controller: Function
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 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_throughputttyGS0
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:EthernetHWaddr C0:B1:3C:88:88:85
          inet addr:169.254.1.10Bcast:169.254.255.255Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICASTMTU:1500Metric: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.1Mask:255.0.0.0
          UP LOOPBACK RUNNINGMTU:65536Metric: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
/ #



qiuchen 发表于 2018-1-8 22:35:09

老大太牛了,改天我也试试。

tuoxin 发表于 2018-1-8 22:48:26

移到STM32H会不会更快?

htjgdw 发表于 2018-1-8 23:13:09

tuoxin 发表于 2018-1-8 22:48
移到STM32H会不会更快?

会的。有了Cache速度会比flash或者sdram里运行都快,基本上等于处理器主频。

zhcj66 发表于 2018-1-8 23:20:57

想学习,不知道什么资料适合初学者,所以Linux一直就放下了,羡慕捯饬Linux的

湛无双 发表于 2018-1-8 23:36:09

厉害,厉害,楼主能分享下移植的过程么?目前我只会做一些应用,对于uboot、设备树还有内核方面知道很少,不知道从哪里入手学习。

devcang 发表于 2018-1-9 00:22:46

boot
然后定制linux
是乐趣

Excellence 发表于 2018-1-9 06:26:11

恭喜。不支持最新uboot?

leiyitan 发表于 2018-1-9 07:46:16

仰望高端玩家

leiyitan 发表于 2018-1-9 07:48:10

仰望高端玩家

lsx007 发表于 2018-1-9 09:06:09

仰望高端玩家

myemcu 发表于 2018-1-9 09:25:03

此等高手,生平未见。。

凌海滨 发表于 2018-1-9 09:26:21

贵到天际的东西 玩玩可以 项目上绝对不会用

htjgdw 发表于 2018-1-9 10:38:11

Excellence 发表于 2018-1-9 06:26
恭喜。不支持最新uboot?

这个一直能用就没折腾最新的uboot。
最新的u-boot是什么版本?

Micro2008Chen 发表于 2018-1-9 10:48:04

你玩的这个的uboot,kernel源码在哪儿下载的?麻烦给个具体的地址可以么

Excellence 发表于 2018-1-9 10:52:24

htjgdw 发表于 2018-1-9 10:38
这个一直能用就没折腾最新的uboot。
最新的u-boot是什么版本?

2016年出来的和10年的有些地方不一样

htjgdw 发表于 2018-1-9 11:28:09

Micro2008Chen 发表于 2018-1-9 10:48
你玩的这个的uboot,kernel源码在哪儿下载的?麻烦给个具体的地址可以么

跟之前的一样,www.emcraft.com

haso2007 发表于 2018-1-9 14:07:25

太强大了,一直在门外看门内的大神

nyszx 发表于 2018-1-9 14:46:33

楼主厉害了,看样子L4+也可以跑,那么大内存和flash。

htjgdw 发表于 2018-1-9 15:05:21

nyszx 发表于 2018-1-9 14:46
楼主厉害了,看样子L4+也可以跑,那么大内存和flash。

跑linux是不够的。

eagles321 发表于 2018-1-9 15:30:08

哇塞,厉害啊

shian0551 发表于 2018-1-9 15:47:16

谁传个uboot,linux的软件资料.

wangzheyu 发表于 2018-1-9 16:15:41

请教楼主,746启动这个Linux要画多长时间?

htjgdw 发表于 2018-1-9 16:27:26

wangzheyu 发表于 2018-1-9 16:15
请教楼主,746启动这个Linux要画多长时间?

几秒钟。

ffbiao 发表于 2018-1-9 17:33:25

楼主,有教程共享一下不?我也学习下F7

casterbn 发表于 2018-1-9 21:40:40


老大太牛了,改天我也试试。

TIANYJ 发表于 2018-1-9 22:53:22

楼主真厉害,linux的uboot我都没碰过.

ffbiao 发表于 2018-1-24 18:35:39

是否支持CAN?

pengtaoABC 发表于 2018-1-24 22:54:22


哇塞,厉害啊

htjgdw 发表于 2018-1-25 11:06:42

ffbiao 发表于 2018-1-24 18:35
是否支持CAN?

老的kernel 2.6内核有CAN驱动。
页: [1]
查看完整版本: STM32F746开发板启动Linux4.2也成功了