我喜欢使用RPi2的GPIO 6作为输出。此GPIO为mapped to pin 31。使用以下命令,我可以崩溃我的RPi:
cd /sys/class/gpio/
echo 31 > export
cd gpio31
echo out > direction
抱歉,我没有崩溃转储。但是启动日志:
root@raspberrypi2:~# dmesg
[ 0.000000] Booting Linux on physical CPU 0xf00
[ 0.000000] Linux version 4.9.27 (oe-user@oe-host) (gcc version 6.3.0 (GCC) ) #2 SMP Tue Jun 20 14:46:25 CEST 2017
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt:Machine model: Raspberry Pi 2 Model B Rev 1.1
[ 0.000000] cma: Reserved 8 MiB at 0x3d800000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 253952
[ 0.000000] free_area_init_node: node 0, pgdat 80c6ed00, node_mem_map bcf3e000
[ 0.000000] Normal zone: 2232 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 253952 pages, LIFO batch:31
[ 0.000000] percpu: Embedded 14 pages/cpu @bcef9000 s25548 r8192 d23604 u57344
[ 0.000000] pcpu-alloc: s25548 r8192 d23604 u57344 alloc=14*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 251720
[ 0.000000] Kernel command line: bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ea00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 985024K/1015808K available (7168K kernel code, 483K rwdata, 2068K rodata, 1024K init, 778K bss, 22592K reserved, 8192K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xbe800000 - 0xff800000 (1040 MB)
[ 0.000000] lowmem : 0x80000000 - 0xbe000000 ( 992 MB)
[ 0.000000] modules : 0x7f000000 - 0x80000000 ( 16 MB)
[ 0.000000] .text : 0x80008000 - 0x80800000 (8160 kB)
[ 0.000000] .init : 0x80b00000 - 0x80c00000 (1024 kB)
[ 0.000000] .data : 0x80c00000 - 0x80c78f04 ( 484 kB)
[ 0.000000] .bss : 0x80c7a000 - 0x80d3c8d4 ( 779 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] arm_arch_timer: Architected cp15 timer(s) running at 19.20MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[ 0.000010] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[ 0.000031] Switching to timer-based delay loop, resolution 52ns
[ 0.000383] Console: colour dummy device 80x30
[ 0.000425] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[ 0.000453] pid_max: default: 32768 minimum: 301
[ 0.000863] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000883] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.002172] Disabling cpuset control group subsystem
[ 0.002406] CPU: Testing write buffer coherency: ok
[ 0.002477] ftrace: allocating 22293 entries in 66 pages
[ 0.057129] CPU0: update cpu_capacity 1024
[ 0.057168] CPU0: thread -1, cpu 0, socket 15, mpidr 80000f00
[ 0.057240] Setting up static identity map for 0x100000 - 0x100034
[ 0.060324] CPU1: update cpu_capacity 1024
[ 0.060336] CPU1: thread -1, cpu 1, socket 15, mpidr 80000f01
[ 0.061343] CPU2: update cpu_capacity 1024
[ 0.061351] CPU2: thread -1, cpu 2, socket 15, mpidr 80000f02
[ 0.062283] CPU3: update cpu_capacity 1024
[ 0.062292] CPU3: thread -1, cpu 3, socket 15, mpidr 80000f03
[ 0.062403] Brought up 4 CPUs
[ 0.062451] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[ 0.062461] CPU: All CPU(s) started in HYP mode.
[ 0.062469] CPU: Virtualization extensions available.
[ 0.063605] devtmpfs: initialized
[ 0.076304] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.076761] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.076793] futex hash table entries: 1024 (order: 4, 65536 bytes)
[ 0.077596] pinctrl core: initialized pinctrl subsystem
[ 0.078886] NET: Registered protocol family 16
[ 0.081283] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[ 0.091387] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.091405] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.091600] Serial: AMBA PL011 UART driver
[ 0.093932] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[ 0.168294] bcm2835-dma 3f007000.dma: DMA legacy API manager at be80f000, dmachans=0x1
[ 0.170732] SCSI subsystem initialized
[ 0.170943] usbcore: registered new interface driver usbfs
[ 0.171058] usbcore: registered new interface driver hub
[ 0.171217] usbcore: registered new device driver usb
[ 0.176743] raspberrypi-firmware soc:firmware: Attached to firmware from 2017-04-05 11:51
[ 0.178359] clocksource: Switched to clocksource arch_sys_counter
[ 0.234017] VFS: Disk quotas dquot_6.6.0
[ 0.234138] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.234438] FS-Cache: Loaded
[ 0.234790] CacheFiles: Loaded
[ 0.251112] NET: Registered protocol family 2
[ 0.252387] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.252524] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.252717] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.252839] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 0.252902] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 0.253219] NET: Registered protocol family 1
[ 0.253872] RPC: Registered named UNIX socket transport module.
[ 0.253890] RPC: Registered udp transport module.
[ 0.253900] RPC: Registered tcp transport module.
[ 0.253909] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.254881] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[ 0.257874] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[ 0.276615] FS-Cache: Netfs 'nfs' registered for caching
[ 0.277897] NFS: Registering the id_resolver key type
[ 0.277962] Key type id_resolver registered
[ 0.277973] Key type id_legacy registered
[ 0.281229] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.281412] io scheduler noop registered
[ 0.281427] io scheduler deadline registered
[ 0.281791] io scheduler cfq registered (default)
[ 0.287404] BCM2708FB: allocated DMA memory fd900000
[ 0.287450] BCM2708FB: allocated DMA channel 0 @ be80f000
[ 0.294443] Console: switching to colour frame buffer device 90x30
[ 0.402417] bcm2835-rng 3f104000.rng: hwrng registered
[ 0.402556] vc-cma: Videocore CMA driver
[ 0.402570] vc-cma: vc_cma_base = 0x00000000
[ 0.402581] vc-cma: vc_cma_size = 0x00000000 (0 MiB)
[ 0.402591] vc-cma: vc_cma_initial = 0x00000000 (0 MiB)
[ 0.402868] vc-mem: phys_addr:0x00000000 mem_base=0x3ea00000 mem_size:0x3f000000(1008 MiB)
[ 0.423800] brd: module loaded
[ 0.435156] loop: module loaded
[ 0.435182] Loading iSCSI transport class v2.0-870.
[ 0.435921] usbcore: registered new interface driver smsc95xx
[ 0.435950] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 0.662143] Core Release: 2.80a
[ 0.662165] Setting default values for core params
[ 0.662207] Finished setting default values for core params
[ 0.862677] Using Buffer DMA mode
[ 0.862692] Periodic Transfer Interrupt Enhancement - disabled
[ 0.862702] Multiprocessor Interrupt Enhancement - disabled
[ 0.862713] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 0.862739] Dedicated Tx FIFOs mode
[ 0.863226] WARN::dwc_otg_hcd_init:1060: FIQ DMA bounce buffers: virt = 0xbd914000 dma = 0xfd914000 len=9024
[ 0.863263] FIQ FSM acceleration enabled for :
[ 0.863263] Non-periodic Split Transactions
[ 0.863263] Periodic Split Transactions
[ 0.863263] High-Speed Isochronous Endpoints
[ 0.863263] Interrupt/Control Split Transaction hack enabled
[ 0.863290] dwc_otg: Microframe scheduler enabled
[ 0.863348] WARN::hcd_init_fiq:459: FIQ on core 1 at 0x805917a8
[ 0.863365] WARN::hcd_init_fiq:460: FIQ ASM at 0x80591b08 length 36
[ 0.863384] WARN::hcd_init_fiq:486: MPHI regs_base at 0xbe87a000
[ 0.863459] dwc_otg 3f980000.usb: DWC OTG Controller
[ 0.863514] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[ 0.863563] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000
[ 0.863619] Init: Port Power? op_state=1
[ 0.863629] Init: Power Port (0)
[ 0.863934] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 0.863952] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.863967] usb usb1: Product: DWC OTG Controller
[ 0.863981] usb usb1: Manufacturer: Linux 4.9.27 dwc_otg_hcd
[ 0.863995] usb usb1: SerialNumber: 3f980000.usb
[ 0.865058] hub 1-0:1.0: USB hub found
[ 0.865121] hub 1-0:1.0: 1 port detected
[ 0.866016] dwc_otg: FIQ enabled
[ 0.866023] dwc_otg: NAK holdoff enabled
[ 0.866027] dwc_otg: FIQ split-transaction FSM enabled
[ 0.866045] Module dwc_common_port init
[ 0.866384] usbcore: registered new interface driver usb-storage
[ 0.866703] mousedev: PS/2 mouse device common for all mice
[ 0.867970] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[ 0.868302] bcm2835-cpufreq: min=600000 max=900000
[ 0.868811] sdhci: Secure Digital Host Controller Interface driver
[ 0.868823] sdhci: Copyright(c) Pierre Ossman
[ 0.869169] sdhost-bcm2835 3f202000.sdhost: could not get clk, deferring probe
[ 0.869407] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.870146] ledtrig-cpu: registered to indicate activity on CPUs
[ 0.870311] hidraw: raw HID events driver (C) Jiri Kosina
[ 0.870583] usbcore: registered new interface driver usbhid
[ 0.870595] usbhid: USB HID core driver
[ 0.871575] vchiq: vchiq_init_state: slot_zero = 0xbd980000, is_master = 0
[ 0.873585] Initializing XFRM netlink socket
[ 0.873629] NET: Registered protocol family 17
[ 0.873808] Key type dns_resolver registered
[ 0.874111] Registering SWP/SWPB emulation handler
[ 0.875084] registered taskstats version 1
[ 0.875560] vc-sm: Videocore shared memory driver
[ 0.875579] [vc_sm_connected_init]: start
[ 0.876690] vc_vchi_sm_init: failed to open VCHI service (-1)
[ 0.876706] [vc_sm_connected_init]: failed to initialize shared memory service
[ 0.876719] [vc_sm_connected_init]: end - returning -1
[ 0.883140] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[ 1.820716] console [ttyAMA0] enabled
[ 1.826544] sdhost: log_buf @ bd913000 (fd913000)
[ 1.908396] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[ 1.914036] of_cfs_init
[ 1.916660] of_cfs_init: OK
[ 1.920392] uart-pl011 3f201000.serial: no DMA platform data
[ 1.926389] Waiting for root device /dev/mmcblk0p2...
[ 1.938588] Indeed it is in host mode hprt0 = 00021501
[ 2.033009] random: fast init done
[ 2.106671] mmc0: host does not support reading read-only switch, assuming write-enable
[ 2.117554] mmc0: new high speed SDHC card at address aaaa
[ 2.124115] mmcblk0: mmc0:aaaa SL08G 7.40 GiB
[ 2.130503] mmcblk0: p1 p2
[ 2.138449] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 2.145073] Indeed it is in host mode hprt0 = 00001101
[ 2.163751] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 2.171954] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 2.182199] devtmpfs: mounted
[ 2.212112] Freeing unused kernel memory: 1024K (80b00000 - 80c00000)
[ 2.378824] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[ 2.385572] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.393201] hub 1-1:1.0: USB hub found
[ 2.397115] hub 1-1:1.0: 5 ports detected
[ 2.718445] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[ 2.730744] udevd[132]: starting version 3.2.1
[ 2.801059] udevd[133]: starting eudev-3.2.1
[ 2.848973] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[ 2.855875] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.882028] smsc95xx v1.0.5
[ 2.975346] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:2d:30:c7
[ 3.060096] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[ 3.408609] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
[ 4.531363] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 6.094941] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[ 13.414294] NET: Registered protocol family 10
[ 34.428710] random: crng init done
如果我使用6作为GPIO,我也会收到错误:
cd /sys/class/gpio/
echo 6 > export
sh: write error: Device or resource busy
我正在使用yocto + meta-raspberry来构建自定义SD卡。标准没有变化。组态。 RPi禁用了SPI,I2C,GPU和显示器。我正在使用bcm2836-rpi-2-b.dts device tree。我不知道为什么它会崩溃或者引脚很忙。
任何想法/解决方案?