F1C200S SDK

From ElectroDragon Wiki
Revision as of 16:46, 13 May 2020 by Chao (talk | contribs) (→‎Setup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Flash guide


Nano Usage

  • Debug Uart port 0:
PE0/RX -> TX 
PE1/TX -> RX
  • Default Debug UART is UART0, 115200
  • 账号:root. 密码:licheepi

Logs

System spi flash.png


Setting up a 800x480 lcd console (overscan 0x0)
In:    serial@1c25000
Out:   serial@1c25000
Err:   serial@1c25000
Net:   No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot:  2 ��� 1 ��� 0 
SF: Detected w25q128bv with page size 256 Bytes, erase size 64 KiB, total 16 MiB
device 0 offset 0x100000, size 0x4000
SF: 16384 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 80c00000
   Booting using the fdt blob at 0x80c00000
   Loading Device Tree to 80e4c000, end 80e51326 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.15.0-next-20180202-licheepi-nano+ (biglion@biglion-MRC-WX0) (gcc version 7.2.0 (Ubuntu/Linaro 7.2.0-6ubuntu1)) #107 Sat May 19 11:56:16 CST 2018
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Lichee Pi Nano
[    0.000000] Memory policy: Data cache writeback
[    0.000000] random: fast init done
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=jffs2
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Memory: 23752K/32768K available (5120K kernel code, 203K rwdata, 1148K rodata, 1024K init, 227K bss, 9016K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc2800000 - 0xff800000   ( 976 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc2000000   (  32 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0x(ptrval) - 0x(ptrval)   (6112 kB)
[    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
[    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   ( 204 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 228 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000050] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000116] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000722] Console: colour dummy device 80x30
[    0.000818] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
[    0.070232] pid_max: default: 32768 minimum: 301
[    0.070644] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.070685] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.071975] CPU: Testing write buffer coherency: ok
[    0.073852] Setting up static identity map for 0x80100000 - 0x80100058
[    0.076308] devtmpfs: initialized
[    0.082820] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.082883] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.083196] pinctrl core: initialized pinctrl subsystem
[    0.085365] NET: Registered protocol family 16
[    0.086573] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.088369] cpuidle: using governor menu
[    0.109092] SCSI subsystem initialized
[    0.109362] pps_core: LinuxPPS API ver. 1 registered
[    0.109388] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.109460] PTP clock support registered
[    0.111410] clocksource: Switched to clocksource timer
[    0.138937] NET: Registered protocol family 2
[    0.140414] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[    0.140493] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.140548] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.140594] TCP: Hash tables configured (established 1024 bind 1024)
[    0.140973] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.141055] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.141767] NET: Registered protocol family 1
[    0.143532] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.145289] Initialise system trusted keyrings
[    0.145831] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[    0.159794] jffs2: version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
[    0.173842] Key type asymmetric registered
[    0.173881] Asymmetric key parser 'x509' registered
[    0.174086] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.174116] io scheduler noop registered
[    0.174132] io scheduler deadline registered
[    0.174880] io scheduler cfq registered (default)
[    0.174917] io scheduler mq-deadline registered
[    0.174933] io scheduler kyber registered
[    0.186203] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.359033] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.366057] console [ttyS0] disabled
[    0.386357] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 25, base_baud = 6250000) is a 16550A
[    0.806473] console [ttyS0] enabled
[    0.817299] panel-simple panel: panel supply power not found, using dummy regulator
[    0.826737] SCSI Media Changer driver v0.25 
[    0.834588] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.839316] spi0.0: parsing partitions cmdlinepart
[    0.845289] spi0.0: got parser (null)
[    0.848979] spi0.0: parsing partitions ofpart
[    0.853437] spi0.0: got parser ofpart
[    0.857151] spi0.0: parser ofpart: 4
[    0.860723] 4 ofpart partitions found on MTD device spi0.0
[    0.866269] Creating 4 MTD partitions on "spi0.0":
[    0.871078] 0x000000000000-0x000000100000 : "u-boot"
[    0.878729] 0x000000100000-0x000000110000 : "dtb"
[    0.886079] 0x000000110000-0x000000510000 : "kernel"
[    0.893740] 0x000000510000-0x000001000000 : "rootfs"
[    0.901859] i2c /dev entries driver
[    0.936361] sunxi-mmc 1c0f000.mmc: base:0x007adfe2 irq:21
[    0.944963] NET: Registered protocol family 17
[    0.949522] Key type dns_resolver registered
[    0.956149] Loading compiled-in X.509 certificates
[    0.971575] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc0633630)
[    0.979484] sun4i-tcon 1c0c000.lcd-controller: Missing LVDS properties, Please upgrade your DT
[    0.988169] sun4i-tcon 1c0c000.lcd-controller: LVDS output disabled
[    0.995391] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc0632848)
[    1.003183] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.009786] [drm] No driver support for vblank timestamp query.
[    1.192289] Console: switching to colour frame buffer device 100x30
[    1.232105] sun4i-drm display-engine: fb0:  frame buffer device
[    1.239285] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    1.247832] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.264207] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.270983] vcc3v3: disabling
[    1.274971] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.283699] cfg80211: failed to load regulatory.db
[    1.361659] random: crng init done
[    2.664673] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[    2.672422] devtmpfs: mounted
[    2.680941] Freeing unused kernel memory: 1024K
Starting logging: OK
Initializing random number generator... done.
Starting network: OK

Welcome to Buildroot
nano login:

Software Usage

  • rz -> upload files
  • littlevgl_demo

Setup

  • Change params in build/env.sh and build\config\env-tf.sh
  • source env-tf.sh
  • _IMG_SIZE — 生成的镜像大小(越大,根文件系统剩余空间越多)
  • _P1_SIZE — 给第一分区划分的大小(以 M 为单位)

Pack

  • ./pack_tf_img.sh

Operationas

  • write_all.sh — 为tf卡创建全套内容
  • write_flash.sh — 为spi-flash写入全套内容
  • write_dd.sh — 以dd镜像的方式写入全套内容(规定了分区信息)(生成方式见下一节)
  • write_boot.sh — 向tf卡dd进Uboot
  • write_mkfs.sh — 单纯的为两个分区进行硬盘格式化
  • write_p1.sh — 单纯的向第一分区写入设备树内核等
  • write_p2.sh — 单纯的向第二分区写入rootfs
  • clear_partion.sh — 擦除分区表
  • write_partion.sh — 写入分区表
  • write_swap.sh — 增加swap

Test

# cd /
# ls
bin      lib      media    proc     sbin     usr
dev      lib32    mnt      root     sys      var
etc      linuxrc  opt      run      tmp
# uname -a
Linux nano 4.15.0-next-20180202-licheepi-nano+ #107 Sat May 19 11:56:16 CST 2018 armv5tejl GNU/Linux
# head -n 1 /etc/issue
Welcome to Buildroot
# cat /proc/cpuinfo
processor	: 0
model name	: ARM926EJ-S rev 5 (v5l)
BogoMIPS	: 239.61
Features	: swp half thumb fastmult edsp java 
CPU implementer	: 0x41
CPU architecture: 5TEJ
CPU variant	: 0x0
CPU part	: 0x926
CPU revision	: 5

Hardware	: Allwinner suniv Family
Revision	: 0000
Serial		: 0000000000000000
# lsmod
Module                  Size  Used by    Not tainted
# env
USER=root
SHLVL=1
OLDPWD=/root
HOME=/root
PAGER=/bin/more
PS1=# 
LOGNAME=root
TERM=vt100
PATH=/bin:/sbin:/usr/bin:/usr/sbin
SHELL=/bin/sh
PWD=/etc
EDITOR=/bin/vi
# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                10.9M      6.3M      4.6M  58% /
devtmpfs                 27.5M         0     27.5M   0% /dev
tmpfs                    28.0M         0     28.0M   0% /dev/shm
tmpfs                    28.0M     12.0K     27.9M   0% /tmp
tmpfs                    28.0M     16.0K     27.9M   0% /run

Compile

U-boot

  • Setup LCD

Linux Core

ROOTFS - Root File System

References

Nano F1C200S