pcDuino3 Nano de NetBSD/evbarm
■ pcDuino3 Nano is a single board computer.
CPU | AllWinner A20 SoC, 1GHz ARM Cortex A7 Dual Core |
GPU | OpenGL ES2.0, OpenVG 1.1, Mali 400 Dual Core |
DRAM | 1GB |
Onboard Storage | 4GB Flash, microSD card (TF) slot for up to 32GB |
Video Output | HDMI 1.4 with HDCP support |
Network interface | Ethernet 10M/100M/1Gbps |
Audio out | 3.5mm analog audio interface |
IR | IR reciever |
SATA | SATA Host socket |
Camera | MIPI |
USB | 2 x USB host, 1x USB OTG |
Power | 5V, 2000mA |
■The pin of serial connector.
The setting of serial port is as below.
- baud rate : 112500
- data : 8bit
- parity : none
- stop bit : 1 bit
- flow control : none
http://learn.linksprite.com/pcduino/schematics/explanation-of-headers-of-pcduino3-nano/
■ u-boot menu
sunxi#help ? - alias for 'help' base - print or set address offset boot - boot default, i.e., run 'bootcmd' boota - boota - boot android bootimg from memory bootd - boot default, i.e., run 'bootcmd' bootm - boot application image from memory cmp - memory compare cp - memory copy crc32 - checksum calculation env - environment handling commands exit - exit script false - do nothing, unsuccessfully fastboot- fastboot- use USB Fastboot protocol fatdown - download data to a dos filesystem fatinfo - print information about filesystem fatload - load binary file from a dos filesystem fatls - list files in a directory (default /) go - start application at address 'addr' help - print command description/usage key_test- Test the key value and dump key registers loop - infinite loop on address range md - memory display mm - memory modify (auto-incrementing address) mmc - MMC sub system mmcinfo - display MMC info mtest - simple RAM read/write test mw - memory write (fill) nand - NAND sub-system nboot - boot from NAND device nm - memory modify (constant address) printenv- print environment variables reset - Perform RESET of the CPU run - run commands in an environment variable saveenv - save environment variables to persistent storage setenv - set environment variables showvar - print local hushshell variables sunxi_flash- sunxi_flash sub-system test - minimal test like /bin/sh true - do nothing, successfully version - print monitor, compiler and linker version
■ Can not access SDHC on u-boot
SDHC did not detected.I gave up that to load the kernel from SDHC.
sunxi#mmc list No MMC device available sunxi#mmc info No MMC device available sunxi#mmc dev 0 1 No MMC device available sunxi#fatls mmc 0:1 ** Unable to use mmc 0:1 for fatls ** sunxi#
■ Can access NAND flash on u-boot!
Fortunately, NAND flash is fine!I decided to load the kernel from NAND flash.
sunxi#fatls nand 0 124256 boot_signature.axf 344813 font24.sft os_show/ 6498840 uimage 121580 boot.axf 357443 font32.sft 222916 drv_de.drv 287936 sprite.axf 232872 drv_hdmi.drv 226316 prvt.axf 222900 drv_de_lvds.drv 50660 script.bin 121984 boot_lvds.axf linux/ 121 boot.ini 512 magic.bin 15 file(s), 2 dir(s)
■ But SDHC is not broken.
Because It works on Linux.So, I will copy the kernel from SDHC to NAND on Linux. And, I will load the kernel from NAND on u-boot.
I prepared a SDHC card of MS-DOS format on My PC. And, I copied the kernel of CUBIEBOARD2 to SDHC card.
The Name of kernel is netbsd.bin. I used to download the NetBSD-current of 201412190900Z from ftp.jaist.ac.jp.
root@ubuntu:~# mount -t msdos /dev/nanda /mnt root@ubuntu:~# ls /mnt boot.axf boot_s~1.axf drv_hdmi.drv linux prvt.axf uimage boot.ini drv_de.drv font24.sft magic.bin script.bin boot_l~1.axf drv_de~1.drv font32.sft os_show sprite.axf root@ubuntu:~# mount | grep mmcblk /dev/mmcblk0p1 on /media/3465-6634 type vfat (rw,nosuid,nodev,uid=1001,gid=1002,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks) root@ubuntu:~# cp /media/3465-6634/netbsd.bin /mnt/netbsd.bin root@ubuntu:~# sync;sync;sync; rebootOn u-boot, Load the kernel from NAND flash.
sunxi#fatls nand 0 124256 boot_signature.axf 344813 font24.sft os_show/ 6498840 uimage 121580 boot.axf 357443 font32.sft 222916 drv_de.drv 287936 sprite.axf 232872 drv_hdmi.drv 226316 prvt.axf 222900 drv_de_lvds.drv 50660 script.bin 121984 boot_lvds.axf linux/ 121 boot.ini 512 magic.bin 5286336 netbsd.bin 15 file(s), 2 dir(s) sunxi#fatload nand 0 0x40007800 netbsd.bin reading netbsd.bin 5286336 bytes readWhy address is0x40007800?
See evbarm/conf/std.awin.
26 makeoptions KERNEL_BASE_PHYS="0x40007800" 27 makeoptions KERNEL_BASE_VIRT="0x80007800"
■ Let's go!
sunxi#go 0x40007800 ## Starting application at 0x40007800 ... Early console started awin_bootstrap: warning: cpu1 failed to hatch [ Kernel symbol table missing! ] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The NetBSD Foundation, Inc. All rights reserved. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. NetBSD 7.99.3 (CUBIEBOARD.201412190900Z) #0: Fri Dec 19 10:33:36 UTC 2014 builds@b47.netbsd.org:/home/builds/ab/HEAD/evbarm-earm/201412190900Z-obj/home/source/ab/HEAD/src/sys/arch/evbarm/compile/CUBIEBOARD total memory = 1024 MB avail memory = 1008 MB sysctl_createv: sysctl_create(machine_arch) returned 17 mainbus0 (root) cpu0 at mainbus0 core 0: 912 MHz Cortex-A7 r0p4 (Cortex V7A core) cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled cpu0: 32KB/32B 2-way L1 VIPT Instruction cache cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache vfp0 at cpu0: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals cpu1 at mainbus0 core 1: disabled (unresponsive) armperiph0 at mainbus0 armgic0 at armperiph0: Generic Interrupt Controller, 160 sources (151 valid) armgic0: 32 Priorities, 128 SPIs, 7 PPIs, 16 SGIs armgtmr0 at armperiph0: ARMv7 Generic 64-bit Timer (24000 kHz) armgtmr0: interrupting on irq 27 awinio0 at mainbus0: A20 (0x1651) awingpio0 at awinio0 awindma0 at awinio0: DMA awindma0: interrupting on irq 59 awincnt0 at awinio0 com0 at awinio0 port : ns16550a, working fifo com0: console awindebe0 at awinio0 port 0: Display Engine Backend (BE0) awintcon0 at awinio0 port 0: LCD/TV timing controller (TCON0) awinhdmi0 at awinio0: HDMI 1.3 awinwdt0 at awinio0: default period is 10 seconds awinrtc0 at awinio0: RTC awinusb0 at awinio0 port 0 ohci0 at awinusb0: OHCI USB controller ohci0: OHCI version 1.0 usb0 at ohci0: USB revision 1.0 ohci0: interrupting on irq 96 ehci0 at awinusb0: EHCI USB controller ehci0: companion controller, 1 port each: ohci0 usb1 at ehci0: USB revision 2.0 ehci0: interrupting on irq 71 awinusb1 at awinio0 port 1 ohci1 at awinusb1: OHCI USB controller ohci1: OHCI version 1.0 usb2 at ohci1: USB revision 1.0 ohci1: interrupting on irq 97 ehci1 at awinusb1: EHCI USB controller ehci1: companion controller, 1 port each: ohci1 usb3 at ehci1: USB revision 2.0 ehci1: interrupting on irq 72 motg0 at awinio0: OTG motg0: interrupting at irq 70 motg0: no restrict gpio found motg0: Dynamic FIFO sizing detected, assuming 16Kbytes of FIFO RAM usb4 at motg0: USB revision 2.0 awinmmc0 at awinio0 port 0: SD3.0 (DMA) awinmmc0: interrupting at irq 64 ahcisata0 at awinio0: AHCI SATA controller ahcisata0: interrupting on irq 88 ahcisata0: AHCI revision 1.10, 1 port, 32 slots, CAP 0x6724ff80<CCCS,PSC,SSC,PMD,SAM,ISS=0x2=Gen2,SCLO,SAL,SALP,SSNTF,SNCQ> atabus0 at ahcisata0 channel 0 awiniic0 at awinio0 port 0: Marvell TWSI controller awiniic0: interrupting on irq 39 iic0 at awiniic0: I2C bus awge0 at awinio0: Gigabit Ethernet Controller awge0: interrupting on irq 117 awge0: reset timed out awinac0 at awinio0: CODEC audio0 at awinac0: full duplex, playback, capture, mmap, independent awinhdmiaudio0 at awinio0: HDMI 1.3 audio1 at awinhdmiaudio0: half duplex, playback, mmap awinnand0 at awinio0 awinir0 at awinio0 port 0: IR awinir0: interrupting on irq 37 cir0 at awinir0 gpio0 at awingpio0: 18 pins gpio1 at awingpio0: 1 pins gpio2 at awingpio0: 28 pins gpio3 at awingpio0: 12 pins gpio4 at awingpio0: 2 pins gpio5 at awingpio0: 12 pins gpio6 at awingpio0: 28 pins gpio7 at awingpio0: 22 pins sdmmc0 at awinmmc0 uhub0 at usb0: Allwinner OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1 at usb1: Allwinner EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub2 at usb2: Allwinner OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub3 at usb3: Allwinner EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub4 at usb4: Mentor Graphics MOTG root hub, class 9/0, rev 1.00/1.00, addr 1 boot device: <unknown> root device: use one of: awge0 ddb halt reboot root device:Awesome!
■ Very slow?
The cause is SDHC card.Should remove SDHC card.
If you insert SDHC card. will continue to display the following message.
awinmmc0: timeout updating clock sdmmc0: couldn't supply clock
■ Multi user mode
USB device is fine.On the USB memory to build a root file system, let's start with multi-user.
sunxi#go 0x40007800 ## Starting application at 0x40007800 ... Early console started awin_bootstrap: warning: cpu1 failed to hatch [ Kernel symbol table missing! ] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The NetBSD Foundation, Inc. All rights reserved. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. NetBSD 7.99.3 (CUBIEBOARD.201412190900Z) #0: Fri Dec 19 10:33:36 UTC 2014 builds@b47.netbsd.org:/home/builds/ab/HEAD/evbarm-earm/201412190900Z-obj/home/source/ab/HEAD/src/sys/arch/evbarm/compile/CUBIEBOARD total memory = 1024 MB avail memory = 1008 MB sysctl_createv: sysctl_create(machine_arch) returned 17 mainbus0 (root) cpu0 at mainbus0 core 0: 912 MHz Cortex-A7 r0p4 (Cortex V7A core) cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled cpu0: 32KB/32B 2-way L1 VIPT Instruction cache cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache vfp0 at cpu0: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals cpu1 at mainbus0 core 1: disabled (unresponsive) armperiph0 at mainbus0 armgic0 at armperiph0: Generic Interrupt Controller, 160 sources (151 valid) armgic0: 32 Priorities, 128 SPIs, 7 PPIs, 16 SGIs armgtmr0 at armperiph0: ARMv7 Generic 64-bit Timer (24000 kHz) armgtmr0: interrupting on irq 27 awinio0 at mainbus0: A20 (0x1651) awingpio0 at awinio0 awindma0 at awinio0: DMA awindma0: interrupting on irq 59 awincnt0 at awinio0 com0 at awinio0 port : ns16550a, working fifo com0: console awindebe0 at awinio0 port 0: Display Engine Backend (BE0) awintcon0 at awinio0 port 0: LCD/TV timing controller (TCON0) awinhdmi0 at awinio0: HDMI 1.3 awinwdt0 at awinio0: default period is 10 seconds awinrtc0 at awinio0: RTC awinusb0 at awinio0 port 0 ohci0 at awinusb0: OHCI USB controller ohci0: OHCI version 1.0 usb0 at ohci0: USB revision 1.0 ohci0: interrupting on irq 96 ehci0 at awinusb0: EHCI USB controller ehci0: companion controller, 1 port each: ohci0 usb1 at ehci0: USB revision 2.0 ehci0: interrupting on irq 71 awinusb1 at awinio0 port 1 ohci1 at awinusb1: OHCI USB controller ohci1: OHCI version 1.0 usb2 at ohci1: USB revision 1.0 ohci1: interrupting on irq 97 ehci1 at awinusb1: EHCI USB controller ehci1: companion controller, 1 port each: ohci1 usb3 at ehci1: USB revision 2.0 ehci1: interrupting on irq 72 motg0 at awinio0: OTG motg0: interrupting at irq 70 motg0: no restrict gpio found motg0: Dynamic FIFO sizing detected, assuming 16Kbytes of FIFO RAM usb4 at motg0: USB revision 2.0 awinmmc0 at awinio0 port 0: SD3.0 (DMA) awinmmc0: interrupting at irq 64 ahcisata0 at awinio0: AHCI SATA controller ahcisata0: interrupting on irq 88 ahcisata0: AHCI revision 1.10, 1 port, 32 slots, CAP 0x6724ff80<CCCS,PSC,SSC,PMD,SAM,ISS=0x2=Gen2,SCLO,SAL,SALP,SSNTF,SNCQ> atabus0 at ahcisata0 channel 0 awiniic0 at awinio0 port 0: Marvell TWSI controller awiniic0: interrupting on irq 39 iic0 at awiniic0: I2C bus awge0 at awinio0: Gigabit Ethernet Controller awge0: interrupting on irq 117 awge0: reset timed out awinac0 at awinio0: CODEC audio0 at awinac0: full duplex, playback, capture, mmap, independent awinhdmiaudio0 at awinio0: HDMI 1.3 audio1 at awinhdmiaudio0: half duplex, playback, mmap awinnand0 at awinio0 awinir0 at awinio0 port 0: IR awinir0: interrupting on irq 37 cir0 at awinir0 gpio0 at awingpio0: 18 pins gpio1 at awingpio0: 1 pins gpio2 at awingpio0: 28 pins gpio3 at awingpio0: 12 pins gpio4 at awingpio0: 2 pins gpio5 at awingpio0: 12 pins gpio6 at awingpio0: 28 pins gpio7 at awingpio0: 22 pins sdmmc0 at awinmmc0 uhub0 at usb0: Allwinner OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1 at usb1: Allwinner EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub2 at usb2: Allwinner OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub3 at usb3: Allwinner EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub4 at usb4: Mentor Graphics MOTG root hub, class 9/0, rev 1.00/1.00, addr 1 umass0 at uhub3 port 1 configuration 1 interface 0 umass0: JetFlash Mass Storage Device, rev 2.10/10.75, addr 2 scsibus0 at umass0: 2 targets, 1 lun per target sd0 at scsibus0 target 0 lun 0: <JetFlash, Transcend 8GB, 1.00> disk removable sd0: fabricating a geometry sd0: 7536 MB, 7536 cyl, 64 head, 32 sec, 512 bytes/sect x 15433728 sectors sd0: fabricating a geometry sd0: mbr partition exceeds disk size boot device: <unknown> root device: sd0a dump device (default sd0b): file system (default generic): ffs root on sd0a dumps on sd0b kern.module.path=/stand/evbarm/7.99.3/modules init path (default /sbin/init): init: trying /sbin/init Sun Dec 21 19:32:27 UTC 2014 Not checking /: fs_passno = 0 in /etc/fstab Starting file system checks: random_seed: /var/db/entropy-file: Not present Setting tty flags. Setting sysctl variables: ddb.onpanic: 1 -> 0 Starting network. Hostname: pcduino IPv6 mode: host Configuring network interfaces:. Adding interface aliases:. Waiting for DAD to complete for statically configured addresses... Building databases: dev, utmp, utmpx. Starting syslogd. Mounting all file systems... Clearing temporary files. Updating fontconfig cache: done. Creating a.out runtime link editor directory cache. Checking quotas: done. Setting securelevel: kern.securelevel: 0 -> 1 /etc/rc: WARNING: No swap space configured! /etc/rc.d/swap2 exited with code 1 Starting virecover. Checking for core dump... savecore: /dev/rsd0b: Device not configured Dec 21 19:32:37 pcduino savecore: /dev/rsd0b: Device not configured Starting local daemons:. Updating motd. Starting inetd. Starting cron. The following components reported failures: /etc/rc.d/swap2 See /var/run/rc.log for more information. Sun Dec 21 19:32:46 UTC 2014 NetBSD/evbarm (pcduino) (console) login: root Dec 21 19:32:50 pcduino login: ROOT LOGIN (root) on tty console Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The NetBSD Foundation, Inc. All rights reserved. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. NetBSD 7.99.3 (CUBIEBOARD.201412190900Z) #0: Fri Dec 19 10:33:36 UTC 2014 Welcome to NetBSD! This system is running a development snapshot of the NetBSD operating system, also known as NetBSD-current. It is very possible that it has serious bugs, regressions, broken features or other problems. Please bear this in mind and use the system with care. You are encouraged to test this version as thoroughly as possible. Should you encounter any problem, please report it back to the development team using the send-pr(1) utility (requires a working MTA). If yours is not properly set up, use the web interface at: http://www.NetBSD.org/support/send-pr.html Thank you for helping us test and improve NetBSD. Terminal type is vt100. We recommend that you create a non-root account and use su(1) for root access. pcduino# ls -l total 10 -rw------- 1 root wheel 0 Dec 21 18:59 .Xauthority -r--r--r-- 2 root wheel 1295 Dec 19 10:24 .cshrc -rw------- 1 root wheel 59 Dec 19 10:24 .klogin -rw-r--r-- 1 root wheel 244 Dec 19 10:24 .login -r--r--r-- 2 root wheel 847 Dec 19 10:24 .profile -rw-r--r-- 1 root wheel 221 Dec 19 10:24 .shrc pcduino# uname -a NetBSD pcduino 7.99.3 NetBSD 7.99.3 (CUBIEBOARD.201412190900Z) #0: Fri Dec 19 10:33:36 UTC 2014 builds@b47.netbsd.org:/home/builds/ab/HEAD/evbarm-earm/201412190900Z-obj/home/source/ab/HEAD/src/sys/arch/evbarm/compile/CUBIEBOARD evbarm pcduino# mount /dev/sd0a on / type ffs (local) kernfs on /kern type kernfs (local) ptyfs on /dev/pts type ptyfs (local) pcduino# ps auxww USER PID %CPU %MEM VSZ RSS TTY STAT STARTED TIME COMMAND root 0 0.0 0.8 0 8248 ? DKl 7:32PM 0:00.20 [system] root 1 0.0 0.1 4008 1344 ? Is 7:32PM 0:00.97 init root 502 0.0 0.2 6776 2032 ? Ss 7:32PM 0:00.03 /usr/sbin/syslogd -s root 1373 0.0 0.1 4120 1136 ? Is 7:32PM 0:00.00 /usr/sbin/inetd -l postfix 1470 0.0 0.3 9896 3312 ? I 7:32PM 0:00.05 pickup -l -t unix -u root 1540 0.0 0.1 3904 1480 ? Is 7:32PM 0:00.01 /usr/sbin/cron root 1550 0.0 0.2 9896 2360 ? Is 7:32PM 0:00.05 /usr/libexec/postfix/master -w postfix 1563 0.0 0.3 9896 3336 ? I 7:32PM 0:00.05 qmgr -l -t unix -u root 1515 0.0 0.3 8928 3152 tty00 Is 7:32PM 0:00.11 login root 1619 0.0 0.2 4104 1880 tty00 S 7:32PM 0:00.04 -sh root 1756 0.0 0.1 4112 1376 tty00 O+ 7:33PM 0:00.01 ps -auxww pcduino# shutdown -h now Shutdown NOW! shutdown: [pid 41] pcduino# wall: You have write permission turned off; no reply possible *** FINAL System shutdown message from root@pcduino *** System going down IMMEDIATELY Dec 21 19:33:53 pcduino shutdown: halt by root: System shutdown time has arrived About to run shutdown hooks... Stopping cron. Stopping inetd. Saved entropy to /var/db/entropy-file. Removing block-type swap devices Sun Dec 21 19:33:56 UTC 2014 Done running shutdown hooks. Dec 21 19:34:01 syncing disks... done unmounting file systems... unmounting done The operating system has halted. Please press any key to reboot. rebooting...
- TB-URL http://www.tokuda.net/diary/0853/tb/