您尚未登录。

#2 Re: 全志 SOC » 自定义驱动程序写入错误:“没有这样的设备” » 2023-01-19 04:54:25

shaoxi2010 说:

这个pwm的用法不对,建议去看看内核的文档,pwm不像spi他并没有实现类bus方法,
节点写这里是没有设备的,把它放到根路径下去就行了

谢谢! 那是作品!

我的设备树:
        ws2812b {
                compatible = "ws2812b";
                pwms = <&pwm 1 1000000 1>;
                status = "okay";
        };

#3 全志 SOC » F1C200S timer irq_request error -22 » 2023-01-19 04:52:46

in_text
回复: 1

你好! 我尝试附加到 timer1 irq (14)。 代码示例:

int ret = request_irq(14, (irq_handler_t)timer_handler, 0, "f1c100s_timer1_irq", NULL);
    if (ret < 0) {
        print_message(KERN_ERR, "timer irq request failure");
        return ret;
    }

irq_request 返回错误 -22 (EINVAL),但 irq 未被其他驱动程序/设备附加:
# cat /proc/interrupts
           CPU0
16:      18675  sun4i_irq  13 Edge      timer@1c20c00
17:          0  sun4i_irq  18 Edge      1c02000.dma-controller
18:     453768  sun4i_irq  10 Edge      sun6i-spi
19:          0  sun4i_irq  11 Edge      sun6i-spi
20:      48727  sun4i_irq  23 Edge      sunxi-mmc
21:          0  sun4i_irq  26 Edge      musb-hdrc.1.auto
25:       1086  sun4i_irq   2 Edge      ttyS0
Err:          0

我可能在哪里失败?

#4 全志 SOC » 自定义驱动程序写入错误:“没有这样的设备” » 2023-01-17 21:03:36

in_text
回复: 3

我尝试制作 WS2812B led 设备驱动程序。 在驱动程序加载时,我从 platform_driver_probe 函数中得到错误 -19(没有这样的设备)。
我的代码:
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>

static int ws2812b_probe(struct platform_device *pdev) {
    printk("Probed");
    return 0;
}

static int ws2812b_remove(struct platform_device *dev) {
    printk("Removed");
    return 0;
}

static struct of_device_id my_match_table[] = {
        {
                .compatible = "worldsemi,ws2812b",
        },
        {},
};

MODULE_DEVICE_TABLE(of, my_match_table);

static struct platform_driver my_platform_driver = {
        .probe = ws2812b_probe,
        .remove = ws2812b_remove,
        .driver = {
                .name = "ws2812b",
                .of_match_table = my_match_table,
        },
};

static int __init ws2812b_init(void) {
    printk("ws2812b init\n");

    int ret;

    printk (KERN_ALERT "%s\n", __FUNCTION__);

    ret = platform_driver_probe(&my_platform_driver, ws2812b_probe);
    printk(KERN_ALERT "ret = %d\n", ret);
    pr_info("ret = %d\n", ret);

    return ret;
}

static void ws2812b_exit(void) {
    printk("ws2812b exit\n");
    platform_driver_unregister(&my_platform_driver);
}

module_init(ws2812b_init);
module_exit(ws2812b_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("123");
MODULE_DESCRIPTION("WS2812b linux driver");
MODULE_VERSION("0.01");
MODULE_ALIAS("platform:ws2812");

生成文件:
ARCH := arm
MODULE_NAME=ws2812b

CROSS_COMPILE=/home/user/buildroot-mangopi-r/output/host/bin/arm-buildroot-linux-gnueabi-
KERNEL=/home/user/buildroot-mangopi-r/output/build/linux-5.4.99/

PWD := $(shell pwd)

obj-m += $(MODULE_NAME).o

all:
    make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL) M=$(PWD) modules

clean:
    rm -rf *.o *.ko
    make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL) M=$(PWD) clean

DeviceTree驱动节点:
&pwm {
        pinctrl-names = "default";
        pinctrl-0 = <&pwm1_pe_pins>;
        status = "okay";

        ws2812b {
                compatible = "worldsemi,ws2812b";
                status = "okay";
        };
};

#5 全志 SOC » f1c200s boot error: mount: you must be root » 2023-01-08 18:37:28

in_text
回复: 1

你好,我从这个 repo https://github.com/mangopi-sbc/buildroot-mangopi-r 使用 widora_mangopi_r3_defconfig 构建图像。 在我将 sysimage-nand.img 刻录到调试控制台中的目标后,preinit 脚本出现错误:mount: you must be root

开机日志:
MMC:   mmc@1c0f000: 0, mmc@1c10000: 1
Setting up a 800x480 lcd console (overscan 0x0)
In:    serial
Out:   serial
Err:   serial
Allwinner mUSB OTG (Peripheral)
Hit any key to stop autoboot:  0
Card did not respond to voltage select!
Card did not respond to voltage select!
unrecognized JEDEC id bytes: ff, c8, f1
Failed to initialize SPI flash at 0:0 (error -2)
List of MTD devices:
* spi-nand0
  - device: spi-nand@1
  - parent: spi@1c05000
  - driver: spi_nand
  - type: NAND flash
  - block size: 0x20000 bytes
  - min I/O: 0x800 bytes
  - OOB size: 64 bytes
  - OOB available: 31 bytes
  - 0x000000000000-0x000008000000 : "spi-nand0"
=========================
Boot Device: spi
Boot Slot 0: empty
Boot Slot 1: spi-nand
=========================
Reading 524288 byte(s) (256 page(s)) at offset 0x00080000
Unknown command 'bmp' - try 'help'
gpio: pin 134 (gpio 134) value is 1
DFU waiting on SPI-NAND...
Booting from SPI-NAND...
Reading 5242880 byte(s) (2560 page(s)) at offset 0x00100000
## Loading kernel from FIT Image at 81000000 ...
   Using 'conf@0' configuration
   Trying 'kernel@0' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x810000cc
     Data Size:    4309808 Bytes = 4.1 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x80000000
     Entry Point:  0x80000000
     Hash algo:    crc32
     Hash value:   90d91352
   Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at 81000000 ...
   Using 'conf@0' configuration
   Trying 'fdt@0' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x8141c4e0
     Data Size:    14252 Bytes = 13.9 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   8d44506e
   Verifying Hash Integrity ... crc32+ OK
   Booting using the fdt blob at 0x8141c4e0
   Loading Kernel Image
   Loading Device Tree to 817f9000, end 817ff7ab ... OK
Cannot setup simplefb: node not found

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.99 (alexey@alexey-PC) (gcc version 8.4.0 (Buildroot -g4a14fb0-dirty)) #1 Sun Jan 8 14:44:35 +05 2023
[    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: Widora MangoPi R3
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 16 MiB at 0x83000000
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 rootwait init=/preinit root=/dev/mtdblock2 rw rootfstype=squashfs overlayfs0
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 38740K/65536K available (6144K kernel code, 248K rwdata, 1676K rodata, 1024K init, 225K bss, 10412K reserved,)
[    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.000000] random: get_random_bytes called from start_kernel+0x254/0x444 with crng_init=0
[    0.000051] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000144] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000849] Console: colour dummy device 80x30
[    0.000951] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[    0.070270] pid_max: default: 32768 minimum: 301
[    0.070793] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.070840] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.072799] CPU: Testing write buffer coherency: ok
[    0.074940] Setting up static identity map for 0x80100000 - 0x80100058
[    0.076238] devtmpfs: initialized
[    0.087189] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.087260] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.091584] pinctrl core: initialized pinctrl subsystem
[    0.094282] NET: Registered protocol family 16
[    0.097931] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.100138] cpuidle: using governor menu
[    0.139659] SCSI subsystem initialized
[    0.140068] usbcore: registered new interface driver usbfs
[    0.140363] usbcore: registered new interface driver hub
[    0.140547] usbcore: registered new device driver usb
[    0.140993] mc: Linux media interface: v0.10
[    0.141132] videodev: Linux video capture interface: v2.00
[    0.141274] pps_core: LinuxPPS API ver. 1 registered
[    0.141295] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.141359] PTP clock support registered
[    0.142432] ion_parse_dt_heap_common: id 4 type 4 name cma align 1000
[    0.143410] Advanced Linux Sound Architecture Driver Initialized.
[    0.145882] clocksource: Switched to clocksource timer
[    0.177553] thermal_sys: Registered thermal governor 'step_wise'
[    0.178328] NET: Registered protocol family 2
[    0.179870] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.179955] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.180015] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.180064] TCP: Hash tables configured (established 1024 bind 1024)
[    0.180401] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.180472] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.181022] NET: Registered protocol family 1
[    0.183781] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.185591] Initialise system trusted keyrings
[    0.186368] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.208388] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.208987] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.325377] Key type asymmetric registered
[    0.325420] Asymmetric key parser 'x509' registered
[    0.325602] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.325633] io scheduler mq-deadline registered
[    0.325651] io scheduler kyber registered
[    0.340691] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.363784] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.370018] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pa not found, using dummy regulator
[    0.371359] printk: console [ttyS0] disabled
[    0.391670] 1c25400.serial: ttyS0 at MMIO 0x1c25400 (irq = 26, base_baud = 6250000) is a 16550A
[    0.825541] printk: console [ttyS0] enabled
[    0.839450] SCSI Media Changer driver v0.25
[    0.845296] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    0.858412] spi-nand spi0.0: GigaDevice SPI NAND was found.
[    0.864016] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    0.873777] 5 fixed-partitions partitions found on MTD device spi0.0
[    0.880265] Creating 5 MTD partitions on "spi0.0":
[    0.885110] 0x000000000000-0x000000100000 : "u-boot"
[    0.897977] 0x000000100000-0x000000600000 : "kernel"
[    0.904990] random: fast init done
[    0.929128] 0x000000600000-0x000003000000 : "rom"
[    1.095295] 0x000003000000-0x000004000000 : "vendor"
[    1.164818] 0x000004000000-0x000007000000 : "overlay"
[    1.354588] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[    1.368566] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.375106] ehci-platform: EHCI generic platform driver
[    1.380809] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.387139] ohci-platform: OHCI generic platform driver
[    1.392837] usbcore: registered new interface driver usb-storage
[    1.400069] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.413766] i2c /dev entries driver
[    1.419728] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.429721] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    1.468019] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.477494] usbcore: registered new interface driver usbhid
[    1.483074] usbhid: USB HID core driver
[    1.487364] sunxi-cedar 1c0e000.video-codec: sunxi cedar version 0.01alpha
[    1.494632] sunxi-cedar 1c0e000.video-codec: cedar-ve the get irq is 20
[    1.507293] NET: Registered protocol family 17
[    1.511857] Key type dns_resolver registered
[    1.517565] Loading compiled-in X.509 certificates
[    1.535653] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.553746] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.560604] ALSA device list:
[    1.563586]   No soundcards found.
[    1.567605] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.576343] cfg80211: failed to load regulatory.db
[    1.582200] /dev/root: Can't open blockdev
[    1.595517] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    1.614999] devtmpfs: mounted
[    1.622572] Freeing unused kernel memory: 1024K
[    1.627295] Run /preinit as init process
[    1.633192] random: crng init done
mount: you must be root
cat: can't open '/proc/cmdline': No such file or directory
umount: can't unmount /proc: Operation not permitted
mount: you must be root
mount: you must be root
mkdir: can't create directory '/dev/pts': Permission denied
mkdir: can't create directory '/dev/shm': Permission denied
mount: you must be root
hostname: sethostname: Operation not permitted
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Populating /dev using udev: failed to parse kernel command line, ignoring: No such file or directory
could not create /run/udev: Read-only file system
done
Saving random seed: SKIP (read-only file system detected)
Starting haveged: haveged: listening socket at 3
haveged: Couldn't get poolsize
FAIL
mkdir: can't create directory '/run/network': Read-only file system
Starting network: ip: RTNETLINK answers: Operation not permitted
ip: SIOCSIFFLAGS: Operation not permitted
ifup: can't open '/var/run/ifstate.new': Read-only file system
FAIL
Starting uMTPrd: mount: you must be root
mkdir: can't create directory '/sys/kernel/config/usb_gadget/g1': No such file or directory
/etc/init.d/S98uMTPrd: cd: line 10: can't cd to /sys/kernel/config/usb_gadget/g1: No such file or directory
mkdir: can't create directory 'configs/c.1': No such file or directory
mkdir: can't create directory 'functions/ffs.mtp': No such file or directory
mkdir: can't create directory 'strings/0x409': No such file or directory
mkdir: can't create directory 'configs/c.1/strings/0x409': No such file or directory
/etc/init.d/S98uMTPrd: line 16: can't create idProduct: Read-only file system
/etc/init.d/S98uMTPrd: line 17: can't create idVendor: Read-only file system
/etc/init.d/S98uMTPrd: line 19: can't create strings/0x409/manufacturer: nonexistent directory
/etc/init.d/S98uMTPrd: line 20: can't create strings/0x409/product: nonexistent directory
/etc/init.d/S98uMTPrd: line 22: can't create configs/c.1/strings/0x409/configuration: nonexistent directory
/etc/init.d/S98uMTPrd: line 23: can't create configs/c.1/MaxPower: nonexistent directory
ln: configs/c.1: No such file or directory
mkdir: can't create directory '/dev/ffs-mtp': Permission denied
mount: you must be root
/etc/init.d/S98uMTPrd: line 29: can't create /sys/kernel/config/usb_gadget/g1/UDC: nonexistent directory
FAIL
[   31.845965] vcc3v0: disabling
[   31.848963] vcc3v3: disabling
[   31.851929] vcc5v0: disabling

#6 全志 SOC » F1C200s & ESP32 Wi-Fi over SPI » 2023-01-07 05:11:33

in_text
回复: 2

你好! 有人尝试通过 SPI 通过 ESP32 使用 Wi-Fi 吗? 我想同时使用 ESP32 开发板和 Lctech Pi F1C200S。
我找到了这个 github 存储库,其中包含 ESP32 内核模块代码 - https://github.com/boundarydevices/esp32-linux - 但我不明白如何将 ESP32 开发板正确连接到 Lctech Pi F1C200s。

我有这样的 ESP32 开发板:
ESP32-Pinout.png

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn