RT1050(地上最强Cortex-M7) uclinux初体验

武, 军/ 十二月 7, 2017/ MCU

emcraft在今年十月份就已经做好了rt1050的uclinux bsp。速度真快。
emcraft对uclinux的支持力度很大,我觉得linux在进一步占领嵌入式领域,侵占MCU平台。
因为在官方linux的发布版本里面已经有了STM32的源代码。
十月初我们拿到了MIMXRT1050-EVK: i.MX RT1050 Evaluation Kit,下载了emcraft的官方img试了一下,感觉还不错。
这引起了我对uclinux的兴趣。因为目前rt1050的BSP是收费的,我就先从STM32下手,熟悉uclinux的整个开发过程。
下面是演示的rt1050的uclinux。

下载网址:
https://emcraft.com/products/819#demo

Installing Linux to the NXP i.MX RT1050 EVK in 2 Minutes
Step through the procedure described in the document below to install a Linux demo to the NXP i.MX RT1050 EVK board in 2 minutes.
You will be able to run a Crank Storyboard GUI demo on the LCD as well as securily connect to the Linux shell on the target over SSH.

根据手册操作,还是比较简单的。直接写到micro sd卡,并且用micro sd卡启动。

rt1050目前是地上最强的ARM cortex M7的核。

附开机log和图片

[plain] view plain copy

U-Boot 2017.09-rc1-cortexm-2.5.0 (Oct 17 2017 – 01:47:42 +0300)

CPU: i.MX RT105x at 600MHz
Model: NXP i.RT1050 EVK
DRAM:  32 MiB
MMC:   FSL_SDHC: 0
reading uboot.env
Video: 480x272x24
In:    serial@40184000
Out:   serial@40184000
Err:   serial@40184000
Net:   eth0: ethernet@402D8000
reading splash-rt1050-series_24.bmp
391736 bytes read in 108 ms (3.5 MiB/s)
reading mxrt105x-evk.ini
100 bytes read in 11 ms (8.8 KiB/s)
fatexec: ‘setenv ipaddr 172.17.44.111’
fatexec: ‘setenv netmask 255.255.0.0’
Hit any key to stop autoboot:  0
reading rootfs.uImage
7684098 bytes read in 1771 ms (4.1 MiB/s)
## Booting kernel from Legacy Image at 80007fc0 …
Image Name:   Linux-4.5.0-00417-g1e71634a15d7-
Image Type:   ARM Linux Multi-File Image (uncompressed)
Data Size:    7684034 Bytes = 7.3 MiB
Load Address: 80008000
Entry Point:  80008001
Contents:
Image 0: 7674368 Bytes = 7.3 MiB
Image 1: 9654 Bytes = 9.4 KiB
Verifying Checksum … OK
## Flattened Device Tree from multi component Image at 80007FC0
Booting using the fdt at 0x80759a0c
Loading Multi-File Image … OK
Loading Device Tree to 81e77000, end 81e7c5b5 … OK

Starting kernel …

Booting Linux on physical CPU 0x0
Linux version 4.5.0-00417-g1e71634a15d7-dirty (yur@linux-7d45) (gcc version 4.7.4 20130508 (prerelease) (20170818-165657- build on build.emcraft by build) ) #151 Sun Oct 15 15:50:07 MSK 2017
CPU: ARMv7-M [411fc271] revision 1 (ARMv7M), cr=00000000
CPU: WBA data cache, WBA instruction cache
Machine model: NXP IMXRT1050 board
debug: ignoring loglevel setting.
On node 0 totalpages: 8192
free_area_init_node: node 0, pgdat 80759320, node_mem_map 81ec0000
Normal zone: 64 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 8192 pages, LIFO batch:0
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 8128
Kernel command line: console=ttyLP0,115200 consoleblank=0 ignore_loglevel ip=172.17.44.111:172.17.0.1::255.255.0.0::eth0:off
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 23792K/32768K available (2188K kernel code, 118K rwdata, 360K rodata, 4824K init, 95K bss, 8976K reserved, 0K cma-reserved)
Virtual kernel memory layout:
vector  : 0x00000000 – 0x00001000   (   4 kB)
fixmap  : 0xffc00000 – 0xfff00000   (3072 kB)
vmalloc : 0x00000000 – 0xffffffff   (4095 MB)
lowmem  : 0x80000000 – 0x82000000   (  32 MB)
.text : 0x80008000 – 0x8028531c   (2549 kB)
.init : 0x80286000 – 0x8073c000   (4824 kB)
.data : 0x8073c000 – 0x80759a00   ( 119 kB)
.bss : 0x80759a00 – 0x807719f8   (  96 kB)
NR_IRQS:16 nr_irqs:16 16
sched_clock: 32 bits at 75MHz, resolution 13ns, wraps every 28633115129ns
clocksource: vf-pit: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 25483472618 ns
Calibrating delay loop… 1196.85 BogoMIPS (lpj=5984256)
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: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
mxs_phy 400d9000.usbphy: Invalid GPIO: -2
mxs_phy 400da000.usbphy: Invalid GPIO: -2
imxrt105x-pinctrl 401f8000.iomuxc: initialized IMX pinctrl driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
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
clocksource: Switched to clocksource vf-pit
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)
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.
futex hash table entries: 16 (order: -5, 192 bytes)
fuse init (API version 7.24)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler noop registered
io scheduler cfq registered (default)
mxsfb 402b8000.lcdif: initialized
40184000.serial: ttyLP0 at MMIO 0x40184000 (irq = 44, base_baud = 375000) is a FSL_LPUART
console [ttyLP0] enabled
Serial: VF610 driver
libphy: fec_enet_mii_bus: probed
ehci_hcd: USB 2.0 ‘Enhanced’ Host Controller (EHCI) Driver
ehci-mxc: Freescale On-Chip EHCI Host driver
usbcore: registered new interface driver uas
usbcore: registered new interface driver usb-storage
ci_hdrc ci_hdrc.1: EHCI Host Controller
ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
i2c /dev entries driver
ft5x0x_ts 0-0038: resolution: 479×271
ft5x0x_ts 0-0038: Operating withoug nReset pin (-2)
input: ft5x0x_ts as /devices/virtual/input/input0
ft5x0x_ts 0-0038: fft5x0x_i2c_Read: i2c read error.
[FTS] Firmware version = 0x1b
ft5x0x_ts 0-0038: fft5x0x_i2c_Read: i2c read error.
[FTS] report rate is 270Hz.
ft5x0x_ts 0-0038: fft5x0x_i2c_Read: i2c read error.
[FTS] touch threshold is 108.
i2c i2c-0: LPI2C adapter registered
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-esdhc-imx 402c0000.esdhc: could not get default state
/soc/aips-bus@40000000/esdhc@402c0000: voltage-ranges unspecified
mmc0: SDHCI controller on 402c0000.esdhc [402c0000.esdhc] using DMA
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
input: gpio-keys as /devices/platform/gpio-keys/input/input1
Freeing unused kernel memory: 4824K (80286000 – 8073c000)
init started: BusyBox v1.24.2 (2017-10-12 12:11:53 MSK)
mmc0: host does not support reading read-only switch, assuming write-enable
mmc0: new high speed SD card at address b368
mmcblk0: mmc0:b368 SD512 478 MiB
mmcblk0: p1
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
random: dropbear urandom read with 5 bits of entropy available
/ # Micrel KSZ8081 or KSZ8091 402d8000.etherne:02: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=402d8000.etherne:02, irq=-1)
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

/ #
/ #
/ # ls /dev
bus                 i2c-0               null                ttyGS0
cache               input               ptmx                ttyLP0
console             kmsg                pts                 ttyp0
cpu_dma_latency     mem                 ptyp0               ttyp1
cuse                memory_bandwidth    ptyp1               ttyp2
fb0                 mmcblk0             ptyp2               ttyp3
ft_rw_iic_drv       mmcblk0p1           ptyp3               urandom
full                network_latency     random              zero
fuse                network_throughput  tty
/ # random: nonblocking pool is initialized

/ # cat /proc/cpuinfo
processor : 0
model name : ARMv7-M rev 1 (v7ml)
BogoMIPS : 1196.85
Features : half thumb fastmult idivt
CPU implementer : 0x41
CPU architecture: 7M
CPU variant : 0x1
CPU part : 0xc27
CPU revision : 1

Hardware : IMXRT105X (Device Tree Support)
Revision : 0000
Serial : 0000000000000000
/ # cat /proc/version
Linux version 4.5.0-00417-g1e71634a15d7-dirty (yur@linux-7d45) (gcc version 4.7.4 20130508 (prerelease) (20170818-165657- build on build.emcraft by build) ) #151 Sun Oct 15 15:50:07 MSK 2017
/ # ls /usr/bin/
[              free           nslookup       scp            top
[[             ftpget         obexftp        sdptool        traceroute
basename       ftpput         obexftpd       seq            ts_calibrate
dbclient       gdbserver      pgrep          ssh            ts_test
dirname        head           pkill          tail           uudecode
dropbearmulti  hexdump        poff           tee            uuencode
du             killall        pon            telnet         wc
env            md5sum         readlink       test           wget
expr           mesg           rfcomm         time
/ # ls /usr/sbin/
chat            httpd           killall5        telnetd         wpa_supplicant
dropbear        i2cdetect       lcdtest         ubiattach
flash_eraseall  i2cdump         ntpd            ubidetach
flashcp         i2cget          pppd            ubimkvol
hcid            i2cset          sdpd            wpa_cli
/ # ls /bin/
bash           dmesg          kill           nice           stty
busybox        dnsdomainname  ln             pidof          sync
cat            echo           login          ping           true
chmod          false          ls             ps             umount
chown          fw_printenv    mkdir          pwd            uname
cp             fw_setenv      mknod          rm             usleep
cttyhack       grep           more           run-parts      vi
date           hostname       mount          sed
dd             hush           mv             sh
df             init           netstat        sleep
/ # ls /sbin/
fdisk     hwclock   init      poweroff  route     udhcpc
halt      ifconfig  mdev      reboot    sysctl
/ # telnetd
/ # telnetd -h
telnetd: invalid option — h
BusyBox v1.24.2 (2017-10-12 12:11:53 MSK) multi-call binary.

Usage: telnetd [OPTIONS]
/ # ps | grep telnet
102 root       388 S    {busybox} telnetd
105 root       388 S    grep telnet
/ # fec 402d8000.ethernet eth0: Link is Up – 100Mbps/Full – flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

/ # ifconfig eth0 192.168.56.4
/ # ping 192.168.56.1
PING 192.168.56.1 (192.168.56.1): 56 data bytes
64 bytes from 192.168.56.1: seq=0 ttl=64 time=1.264 ms
64 bytes from 192.168.56.1: seq=1 ttl=64 time=0.462 ms
^C
— 192.168.56.1 ping statistics —
2 packets transmitted, 2 packets received, 0% packet loss
/ # df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/mmcblk0p1            8.0M      7.7M    252.0K  97% /mnt/sdcard
/ # top
Mem: 16900K used, 11716K free, 0K shrd, 28K buff, 8884K cached
CPU:   0% usr   0% sys   0% nic 100% idle   0% io   0% irq   0% sirq
Load average: 0.00 0.02 0.02 1/33 114
PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
114    76 root     R      404   1%   0% top
67     1 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
79    67 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
93    79 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
81    79 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
92    79 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
76     1 root     S      440   2%   0% -/bin/hush
74     1 root     S      404   1%   0% dropbear
1     0 root     S      396   1%   0% init
102     1 root     S      396   1%   0% {busybox} telnetd
13     2 root     SW       0   0%   0% [kworker/0:1]
39     2 root     SW       0   0%   0% [kworker/u2:1]
3     2 root     SW       0   0%   0% [ksoftirqd/0]
12     2 root     SW<      0   0%   0% [rpciod]
11     2 root     SW<      0   0%   0% [kblockd]
2     0 root     SW       0   0%   0% [kthreadd]
10     2 root     SW<      0   0%   0% [bioset]
6     2 root     SW       0   0%   0% [kworker/u2:0]
7     2 root     SW       0   0%   0% [kdevtmpfs]
8     2 root     SW<      0   0%   0% [writeback]
Mem: 16904K used, 11712K free, 0K shrd, 28K buff, 8884K cached
CPU:   0% usr   0% sys   0% nic  99% idle   0% io   0% irq   0% sirq
Load average: 0.00 0.02 0.02 1/33 114
PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
114    76 root     R      412   1%   0% top
13     2 root     SW       0   0%   0% [kworker/0:1]
67     1 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
79    67 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
93    79 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
81    79 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
92    79 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
76     1 root     S      440   2%   0% -/bin/hush
74     1 root     S      404   1%   0% dropbear
1     0 root     S      396   1%   0% init
102     1 root     S      396   1%   0% {busybox} telnetd
39     2 root     SW       0   0%   0% [kworker/u2:1]
3     2 root     SW       0   0%   0% [ksoftirqd/0]
12     2 root     SW<      0   0%   0% [rpciod]
11     2 root     SW<      0   0%   0% [kblockd]
2     0 root     SW       0   0%   0% [kthreadd]
10     2 root     SW<      0   0%   0% [bioset]
6     2 root     SW       0   0%   0% [kworker/u2:0]
7     2 root     SW       0   0%   0% [kdevtmpfs]
8     2 root     SW<      0   0%   0% [writeback]
Mem: 16904K used, 11712K free, 0K shrd, 28K buff, 8884K cached
CPU:   0% usr   0% sys   0% nic  99% idle   0% io   0% irq   0% sirq
Load average: 0.00 0.02 0.02 1/33 114
PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
114    76 root     R      412   1%   0% top
67     1 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
79    67 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
93    79 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
81    79 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
92    79 root     S     3276  11%   0% {sbengine} /crankdemo/uclinux-stm32f7-
76     1 root     S      440   2%   0% -/bin/hush
74     1 root     S      404   1%   0% dropbear
1     0 root     S      396   1%   0% init
102     1 root     S      396   1%   0% {busybox} telnetd
13     2 root     SW       0   0%   0% [kworker/0:1]
39     2 root     SW       0   0%   0% [kworker/u2:1]
3     2 root     SW       0   0%   0% [ksoftirqd/0]
12     2 root     SW<      0   0%   0% [rpciod]
11     2 root     SW<      0   0%   0% [kblockd]
2     0 root     SW       0   0%   0% [kthreadd]
10     2 root     SW<      0   0%   0% [bioset]
6     2 root     SW       0   0%   0% [kworker/u2:0]
7     2 root     SW       0   0%   0% [kdevtmpfs]
8     2 root     SW<      0   0%   0% [writeback]
/ # ls
bin        etc        lib        root       tmp
crankdemo  httpd      mnt        sbin       usr
dev        init       proc       sys        var
/ # ls /dev/
bus                 i2c-0               null                ttyGS0
cache               input               ptmx                ttyLP0
console             kmsg                pts                 ttyp0
cpu_dma_latency     mem                 ptyp0               ttyp1
cuse                memory_bandwidth    ptyp1               ttyp2
fb0                 mmcblk0             ptyp2               ttyp3
ft_rw_iic_drv       mmcblk0p1           ptyp3               urandom
full                network_latency     random              zero
fuse                network_throughput  tty
/ # ls
bin        etc        lib        root       tmp
crankdemo  httpd      mnt        sbin       usr
dev        init       proc       sys        var
/ # cd root/
/root # cd ..
/ # ls -l
drwxr-xr-x    2 root     root             0 Jan  1 00:00 bin
drwxr-xr-x    5 root     root             0 Oct 15  2017 crankdemo
drwxr-xr-x    5 root     root             0 Jan  1 00:00 dev
drwxr-xr-x    5 root     root             0 Oct 15  2017 etc
drwxr-xr-x    3 root     root             0 Oct 15  2017 httpd
lrwxrwxrwx    1 root     root             9 Oct 15  2017 init -> /bin/init
drwxrwxrwx    3 root     root             0 Oct 15  2017 lib
drwxrwxrwx    8 root     root             0 Oct 15  2017 mnt
dr-xr-xr-x   43 root     root             0 Jan  1 00:00 proc
drwx——    2 root     root             0 Oct 15  2017 root
drwxr-xr-x    2 root     root             0 Jan  1 00:00 sbin
dr-xr-xr-x   12 root     root             0 Jan  1 00:00 sys
drwxrwxrwx    2 root     root             0 Oct 15  2017 tmp
drwxr-xr-x    6 root     root             0 Oct 15  2017 usr
drwxr-xr-x    7 root     root             0 Oct 15  2017 var
/ # cd root/
/root # ls
/root # cd ..
/ # ls mnt/
flash      nfs        qspi       sdcard     stm_flash  usbflash
/ # cd mnt/
/mnt # ls
flash      nfs        qspi       sdcard     stm_flash  usbflash
/mnt # ls flash/
/mnt # ls -l
drwxrwxrwx    2 root     root             0 Oct 15  2017 flash
drwxrwxrwx    2 root     root             0 Oct 15  2017 nfs
drwxrwxrwx    2 root     root             0 Oct 15  2017 qspi
drwxr-xr-x    3 root     root         16384 Jan  1 00:00 sdcard
drwxrwxrwx    2 root     root             0 Oct 15  2017 stm_flash
drwxrwxrwx    2 root     root             0 Oct 15  2017 usbflash
/mnt # ls qspi/
/mnt # ls sdcard/
System Volume Information    splash-rt1050-series_24.bmp
mxrt105x-evk.ini             uboot.env
rootfs.uImage
/mnt # ls -l  sdcard/
drwxr-xr-x    2 root     root          4096 Nov 10  2017 System Volume Information
-rwxr-xr-x    1 root     root           100 Oct 17  2017 mxrt105x-evk.ini
-rwxr-xr-x    1 root     root       7684098 Oct 17  2017 rootfs.uImage
-rwxr-xr-x    1 root     root        391736 Oct 17  2017 splash-rt1050-series_24.bmp
-rwxr-xr-x    1 root     root          8192 Oct 17  2017 uboot.env