您尚未登录。

#1 Cortex M0/M3/M4/M7 » FatFs移植到STM32F103上的问题,SPI连接SD卡 » 2022-07-19 12:02:56

linux-xc
回复: 3

SD卡:
32GB
FAT32
扇区512byte

MCU:
STM32F103C8T6

SD卡与MCU连接方式:SPI

移植FatFs前:
能够初始化SD卡,能够写入/读出,正常。

移植FatFs后:
无法挂载(提示未格式化FR_NO_FILESYSTEM)
挂载成功时,始终无法使用 open、read、write 等函数(提示FR_DISK_ERR)

官方版本:FatFs R0.14b

#2 全志 SOC » 荔枝派zero 的printk 无法打印到终端。 » 2022-07-07 18:59:49

linux-xc
回复: 0

打印等级如下:

root@LicheePi:/# cat /proc/sys/kernel/printk
7       4       1       7

但在驱动模块不论是多高等级的信息,都打印在了dmesg去了

#3 Re: 全志 SOC » 驱动模块加载到/dev无法进行读写操作 » 2022-07-05 01:12:24

很不巧,又是自己解决了。

发现应用程序所访问的设备文件差了一个字母。。。。。

然后用read/write正常了

但是,使用 cat 和 echo 还是会有问题,我想应该是后面学到的东西才能解决。

#4 Re: 全志 SOC » 驱动模块加载到/dev无法进行读写操作 » 2022-07-04 23:14:13

使用dmesg发现,使用echo写入内容后,会不断打印收到的数据,像是write不断被执行。

使用了两次 cat 打开,dmesg打印如下:

[131910.069992] ------------[ cut here ]------------
[131910.075935] WARNING: CPU: 0 PID: 27183 at ./include/linux/thread_info.h:134 usr_read+0xac/0xc8 [main]
[131910.087880] Buffer overflow detected (50 < 131072)!
[131910.094329] Modules linked in: main(O) mousedev [last unloaded: main]
[131910.102468] CPU: 0 PID: 27183 Comm: cat Tainted: G           O      5.2.0-licheepi-zero #4
[131910.112530] Hardware name: Allwinner sun8i Family
[131910.119097] [<c010ed14>] (unwind_backtrace) from [<c010b72c>] (show_stack+0x10/0x14)
[131910.128868] [<c010b72c>] (show_stack) from [<c0735810>] (dump_stack+0x84/0x98)
[131910.138215] [<c0735810>] (dump_stack) from [<c011db98>] (__warn+0xfc/0x114)
[131910.147355] [<c011db98>] (__warn) from [<c011dbf4>] (warn_slowpath_fmt+0x44/0x68)
[131910.157141] [<c011dbf4>] (warn_slowpath_fmt) from [<bf0061bc>] (usr_read+0xac/0xc8 [main])
[131910.167846] [<bf0061bc>] (usr_read [main]) from [<c0215d18>] (__vfs_read+0x2c/0x1c0)
[131910.178121] [<c0215d18>] (__vfs_read) from [<c0215f38>] (vfs_read+0x8c/0x118)
[131910.187884] [<c0215f38>] (vfs_read) from [<c0216230>] (ksys_read+0x58/0xd0)
[131910.197567] [<c0216230>] (ksys_read) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[131910.207956] Exception stack(0xc3175fa8 to 0xc3175ff0)
[131910.215903] 5fa0:                   00020000 00020000 00000003 b6e61000 00020000 000271c4
[131910.227167] 5fc0: 00020000 00020000 b6e61000 00000003 7fffe000 00000000 00000000 00020000
[131910.238513] 5fe0: 00000000 bee52b44 00013835 b6f0cea6
[131910.246969] ---[ end trace 8651e93d3c6eace7 ]---
[131910.254936] read ok
[131943.150461] ------------[ cut here ]------------
[131943.164150] WARNING: CPU: 0 PID: 27434 at ./include/linux/thread_info.h:134 usr_read+0xac/0xc8 [main]
[131943.180628] Buffer overflow detected (50 < 131072)!
[131943.189413] Modules linked in: main(O) mousedev [last unloaded: main]
[131943.199901] CPU: 0 PID: 27434 Comm: cat Tainted: G        W  O      5.2.0-licheepi-zero #4
[131943.212265] Hardware name: Allwinner sun8i Family
[131943.221124] [<c010ed14>] (unwind_backtrace) from [<c010b72c>] (show_stack+0x10/0x14)
[131943.233136] [<c010b72c>] (show_stack) from [<c0735810>] (dump_stack+0x84/0x98)
[131943.244569] [<c0735810>] (dump_stack) from [<c011db98>] (__warn+0xfc/0x114)
[131943.255633] [<c011db98>] (__warn) from [<c011dbf4>] (warn_slowpath_fmt+0x44/0x68)
[131943.267254] [<c011dbf4>] (warn_slowpath_fmt) from [<bf0061bc>] (usr_read+0xac/0xc8 [main])
[131943.279704] [<bf0061bc>] (usr_read [main]) from [<c0215d18>] (__vfs_read+0x2c/0x1c0)
[131943.291586] [<c0215d18>] (__vfs_read) from [<c0215f38>] (vfs_read+0x8c/0x118)
[131943.302852] [<c0215f38>] (vfs_read) from [<c0216230>] (ksys_read+0x58/0xd0)
[131943.313907] [<c0216230>] (ksys_read) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[131943.325563] Exception stack(0xc3845fa8 to 0xc3845ff0)
[131943.334711] 5fa0:                   00020000 00020000 00000003 b6eb6000 00020000 000271c4
[131943.347078] 5fc0: 00020000 00020000 b6eb6000 00000003 7fffe000 00000000 00000000 00020000
[131943.359400] 5fe0: 00000000 beaf3b44 00013835 b6f61ea6
[131943.368877] ---[ end trace 8651e93d3c6eace8 ]---

#5 全志 SOC » 驱动模块加载到/dev无法进行读写操作 » 2022-07-04 22:56:27

linux-xc
回复: 2
// devfs模板

#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/uaccess.h>


static unsigned char read_buf[50] = {"ABCD"};
static unsigned char write_buf[50] = {0};

static int usr_open(struct inode *inode, struct file *file)
{
    return 0;
}


static int usr_close(struct inode *inode, struct file *file)
{
    return 0;
}


static ssize_t usr_read(struct file *file, char __user *buf,
                        size_t count, loff_t *offset)
{
    int ret = copy_to_user(buf, read_buf, count);
    if (ret < 0)
    {
        return -1;
    }
    return 0;
}


static ssize_t usr_write(struct file *file, const char __user *buf,
                         size_t count, loff_t *offset)
{
    memset(write_buf, 0, sizeof(write_buf));        
    int ret = copy_from_user(write_buf, buf, count);
    if (ret < 0)
    {
        return -1;
    }
    printk("re_data:%s\r\n", write_buf);
    return 0;
}

#define module_major 200      
#define module_name "usr_dev"

/* 注册结构体 */
static const struct file_operations usr_fops = {

    .owner = THIS_MODULE, 
    .open = usr_open,     
    .release = usr_close, 
    .read = usr_read,    
    .write = usr_write,   
};


static int __init usr_init(void)
{
    printk("init\r\");
    register_chrdev(module_major, module_name, &usr_fops); //注册驱动模块
    return 0;
}


static void __exit usr_exit(void)
{
    printk("exit\r\");    
    unregister_chrdev(module_major, module_name); //卸载驱动模块
}

module_init(usr_init);
module_exit(usr_exit);


MODULE_LICENSE("GPL");                     
MODULE_AUTHOR("Author");                  
MODULE_DESCRIPTION("Module is introduced"); 
MODULE_ALIAS("The alias");               

代码如上,在荔枝派zero核心板上的shell操作:

insmod usr_dev.ko
mknod /dev/usr_dev c 200 0

已经确保 lsmod 和 cat /proc/devices 能够找到这个驱动模块
且 dmesg 也有打印 init 和 exit

但使用应用程序 open 打开字符设备后,read 和 write 均没有反应,这可能是什么原因导致的?

#6 Re: 全志 SOC » linux-4.19启动报错 全志kernel » 2022-07-04 11:56:45

提供一些思路,你的打印信息有Bug

BUG: Bad page state in process swapper

https://bugzilla.redhat.com/show_bug.cgi?id=1048442

#8 Re: 全志 SOC » linux-zero-5.2.y 启动后没有usb0 » 2022-07-01 20:00:22

最后,开机自动联网,无需任何设置,打印如下:

root@LicheePi:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:e0:4c:36:8c:02
          inet addr:192.168.2.140  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2041 errors:0 dropped:0 overruns:0 frame:0
          TX packets:604 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:177681 (173.5 KiB)  TX bytes:49013 (47.8 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
root@LicheePi:~# dmesg | grep eth
[    0.751291] usbcore: registered new interface driver kaweth
[    0.798710] usbcore: registered new interface driver cdc_ether
[    0.821952] usbcore: registered new interface driver ipheth
[    1.021969] udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers
[    1.274370] using random self ethernet address
[    1.282887] using random host ethernet address
[    1.307668] using random self ethernet address
[    1.315749] using random host ethernet address
[    1.323768] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[    1.333902] g_ether gadget: g_ether ready
[    2.931592] r8152 1-1.4:1.0 eth0: v1.09.10
[    7.666881] r8152 1-1.4:1.0 eth0: carrier on
root@LicheePi:~# ping www.baidu.com
PING www.a.shifen.com (183.232.231.174) 56(84) bytes of data.
64 bytes from 183.232.231.174: icmp_seq=1 ttl=57 time=10.4 ms
64 bytes from 183.232.231.174: icmp_seq=2 ttl=57 time=11.4 ms
64 bytes from 183.232.231.174: icmp_seq=3 ttl=57 time=11.3 ms
64 bytes from 183.232.231.174: icmp_seq=4 ttl=57 time=11.8 ms
64 bytes from 183.232.231.174: icmp_seq=5 ttl=57 time=11.6 ms
64 bytes from 183.232.231.174: icmp_seq=6 ttl=57 time=11.5 ms
64 bytes from 183.232.231.174: icmp_seq=7 ttl=57 time=10.6 ms
64 bytes from 183.232.231.174: icmp_seq=8 ttl=57 time=11.3 ms
^C
--- www.a.shifen.com ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7010ms
rtt min/avg/max/mdev = 10.438/11.279/11.805/0.472 ms

#9 Re: 全志 SOC » linux-zero-5.2.y 启动后没有usb0 » 2022-07-01 19:57:23

找到办法了,完全查看内核配置的各个选项后,发现内核配置没有勾选USB的网络相关驱动。
不知道官方为什么没有默认选择这部分驱动?

因此,我直接将所有相关驱动都加载进去了
应该是某个驱动实现了,但暂时并不清楚,有待前辈指点。

具体方法,在内核源码目录输入 make ARCH=arm menuconfig   

Device Drivers  --->  
    [*] Network device support  ---> 
         <*>   USB Network Adapters  --->
                子选项全部勾选,子选项的子选项默认即可

此外,还可以自行搜索以下配置打勾(根据自身需要打勾)(按键盘 / 键可以搜索)

DNS Resolver support

Generic failover module

Network block device support

USB CATC NetMate-based Ethernet device support

#10 Re: 全志 SOC » linux-zero-5.2.y 启动后没有usb0 » 2022-07-01 15:45:53

查到一种办法:设置网关
来源:https://blog.csdn.net/yanhe156/article/details/79664166

route add default gw 192.168.2.1

成功设置网关,但依然无法ping通

新现象,OTG所连USB转网口闪灯

#11 Re: 全志 SOC » linux-zero-5.2.y 启动后没有usb0 » 2022-07-01 14:57:52

在内核编译阶段,通过编译模块/安装模块操作,成功在zero上打印出usb0
来源:https://wiki.sipeed.com/soft/Lichee/zh/Zero-Doc/System_Development/kernel_build.html

root@LicheePi:~# ifconfig -a
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

usb0      Link encap:Ethernet  HWaddr 36:e4:4c:4f:16:e0
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

尝试 ifconfig usb0 192.168.2.140
成功设置ip,但无法ping通任何地址

尝试 dhclient usb0
终端阻塞,无法进行操作,只能退出

下面是dmseg

root@LicheePi:~# dmesg | grep usb
[    0.035933] usbcore: registered new interface driver usbfs
[    0.036024] usbcore: registered new interface driver hub
[    0.036144] usbcore: registered new device driver usb
[    0.094043] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[    0.748340] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.753989] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.762007] ehci-platform 1c1a000.usb: irq 25, io mem 0x01c1a000
[    0.798038] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    0.825835] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    0.832579] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    0.840560] ohci-platform 1c1a400.usb: irq 26, io mem 0x01c1a400
[    0.924383] usbcore: registered new interface driver usb-storage
[    1.029700] usbcore: registered new interface driver usbhid
[    1.035302] usbhid: USB HID core driver
[    1.123599] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.142955] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.152849] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    1.200877] usb0: HOST MAC 86:5c:88:05:1e:fc
[    1.209109] usb0: MAC ce:80:1a:f9:af:7c
[    1.648097] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    2.296028] usb 1-1.4: new high-speed USB device number 3 using ehci-platform

#12 全志 SOC » linux-zero-5.2.y 启动后没有usb0 » 2022-07-01 14:31:59

linux-xc
回复: 4

烧录网友提供的.dd镜像可以找到usb0设备,联网,但是自己重新编译的内核更换原来的内核后,就无法找到usb0了。

原镜像:lichee_zero-mindb_alpha.dd

下面是内核启动信息:

root@LicheePi:~# dmesg | grep Failed
[    1.714166] systemd[1]: Failed to insert module 'autofs4'
[    1.723517] systemd[1]: Failed to insert module 'ipv6'
root@LicheePi:~# dmesg | grep fail
[    2.199104] systemd[1]: Cannot add dependency job for unit dbus.socket, ignoring: Unit dbus.socket failed to load: No such file or directory.
[    2.219032] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.
root@LicheePi:~# dmesg | grep usb
[    0.036043] usbcore: registered new interface driver usbfs
[    0.036117] usbcore: registered new interface driver hub
[    0.036236] usbcore: registered new device driver usb
[    0.092828] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[    0.744784] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.750494] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.758493] ehci-platform 1c1a000.usb: irq 25, io mem 0x01c1a000
[    0.788124] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    0.815898] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    0.822649] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    0.830627] ohci-platform 1c1a400.usb: irq 26, io mem 0x01c1a400
[    0.914410] usbcore: registered new interface driver usb-storage
[    1.009743] usbcore: registered new interface driver usbhid
[    1.015344] usbhid: USB HID core driver
[    1.103476] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.122653] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.132421] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    1.648878] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    2.241261] usb 1-1.4: new high-speed USB device number 3 using ehci-platform

dmesg打印表明无法加载autofs4、ipv6模块,应该是找不到usb0导致的


以下的ifconfig打印信息:

root@LicheePi:~# ifconfig -a
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

然后根据网上办法配置内核,仍无法找到 usb0

来源:https://wiki.sipeed.com/soft/Lichee/zh/Zero-Doc/application/otg2PC.html

Location:
-> Device Drivers
    -> USB support (USB_SUPPORT [=y])
        -> USB Gadget Support (USB_GADGET [=y])
            <*>   USB Gadget precomposed configurations (Ethernet Gadget (with CDC Ethernet support))

#13 Re: 全志 SOC » 荔枝派zero 如何使用OTG联网 » 2022-07-01 13:44:26

varzhou 说:

@linux-xc

first get ip address from dhcp server,then ping ip could fine

并不能使用dhcp获取ip,但路由器已经开启dhcp

#14 全志 SOC » 荔枝派zero 如何使用OTG联网 » 2022-06-30 23:13:11

linux-xc
回复: 2

如果是使用网友分享的 .dd 文件直接烧录,是可以直接联网的,但自己烧录的内核则有点问题。

根据官方提示查询是否存在 usb0

# ifconfig -a
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

usb0      Link encap:Ethernet  HWaddr 0E:AA:27:FC:E3:CF
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

# ifconfig usb0 192.168.2.140
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: usb0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 0e:aa:27:fc:e3:cf brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.140/24 brd 192.168.2.255 scope global usb0
       valid_lft forever preferred_lft forever
# ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1): 56 data bytes
^C
--- 192.168.2.1 ping statistics ---
69 packets transmitted, 0 packets received, 100% packet loss

但是经过以上操作,并不能ping通,已经确保OTG链接到路由器,能上网

#15 Re: 全志 SOC » 我的Linux入坑日记,顺便求解其中的问题。 » 2022-06-30 20:48:25

自己瞎搞,根据网上的配置,修改了环境变量

来源: https://blog.csdn.net/xxxx123041/article/details/119938816

setenv bootargs 'console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw  vt.global_cursor_default=0'
setenv bootcmd 'mmc dev 0;fatload mmc 0:1 0x41000000 zImage;fatload mmc 0:1 0x41800000 sun8i-v3s-licheepi-zero.dtb;bootz 0x41000000 - 0x41800000;'
saveenv
boot

最后打印

[    0.969581] usb0: MAC 4a:bd:36:93:df:fc
[    0.973456] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[    0.981046] g_cdc gadget: g_cdc ready
[    0.985080] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 03:04:35 UTC (11075)
[    0.993642] vcc3v0: disabling
[    0.996622] vcc5v0: disabling
[    0.999586] ALSA device list:
[    1.002547]   No soundcards found.
[    1.008083] Waiting for root device /dev/mmcblk0p2...
[    1.054746] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.068584] mmc0: new high speed SDHC card at address aaaa
[    1.074942] mmcblk0: mmc0:aaaa SL16G 14.8 GiB
[    1.085024]  mmcblk0: p1 p2
[    1.097902] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[    1.110153] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[    1.158120] random: fast init done
[    1.167507] EXT4-fs (mmcblk0p2): recovery complete
[    1.173242] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.181489] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.192331] devtmpfs: mounted
[    1.196687] Freeing unused kernel memory: 1024K
[    1.304943] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
Starting logging: OK
Initializing random number generator... done.
Starting network: OK
[    1.603608] usb 1-1: new high-speed USB device number 2 using musb-hdrc

Welcome to Buildroot
buildroot login: [    1.784603] hub 1-1:1.0: USB hub found
[    1.788990] hub 1-1:1.0: 4 ports detected
[    2.113594] usb 1-1.4: new high-speed USB device number 3 using musb-hdrc
[  210.163635] random: crng init done


可以看到最后打印得超级慢,也不知道是什么原因导致的

但是但是但是但是但是但是但是但是但是但是但是但是

成功了!

输入 cd /
输入 ls

看到了久违的文件列表打印



以上

#16 Re: 全志 SOC » 我的Linux入坑日记,顺便求解其中的问题。 » 2022-06-30 20:33:29

查看Linux内核配置:

Boot options --->
     Kernel command line type (Use bootloader kernel arguments if available)  --->   

这说明使用的就是Uboot的参数,但是貌似无法获取

来源:https://blog.csdn.net/kangear/article/details/51985548

#17 Re: 全志 SOC » 我的Linux入坑日记,顺便求解其中的问题。 » 2022-06-30 20:27:25

哇酷小二 说:

@linux-xc


看日志, 确实没有设置 root 参数


[    1.214197] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.225148] Please append a correct "root=" boot option; here are the available partitions:


网上搜索得知,有可能是内核不接受uboot的参数导致的:

问题来源:https://www.cnblogs.com/quanyun-linuxdriver/p/7595800.html

可能的办法:https://blog.csdn.net/weixin_29183637/article/details/116689007

#18 Re: 全志 SOC » 我的Linux入坑日记,顺便求解其中的问题。 » 2022-06-30 20:03:26

unturned3 说:

其实Linux还好,感觉主要是嵌入式这一块坑比较多

再加上是全志的东西,资料少之又少,坑不多才怪呢 big_smile

因为是单片机过渡来的,想玩Linux,就从最简单的荔枝派开始,以为会有个好开始。。。。

#19 Re: 全志 SOC » 我的Linux入坑日记,顺便求解其中的问题。 » 2022-06-30 20:01:57

哇酷小二 说:

@linux-xc


看日志, 确实没有设置 root 参数


[    1.214197] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.225148] Please append a correct "root=" boot option; here are the available partitions:

这段错误我也注意到了,但是并不知道该如何更改环境变量。

我以为 ttyS0,115200=panic=5 rootwait root=/dev/mmcblk0p2 就是该部分选项

#20 Re: 全志 SOC » 我的Linux入坑日记,顺便求解其中的问题。 » 2022-06-30 18:53:54

哇酷小二 说:

楼主这是高手必经之路啊,是不是没设置 bootargs 的 root 参数,linux没找到根文件系统。

查了一下,你说的应该是“ root=/dev/mmcblk0p2 ”

分区时,32M/FAT16、剩余空间/EXT4

这是uboot的环境变量:

=> printenv
arch=arm
baudrate=115200
board=sunxi
board_name=sunxi
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=fel mmc0 usb0 pxe dhcp
bootcmd=run distro_bootcmd
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_fel=if test -n ${fel_booted} && test -n ${fel_scriptaddr}; then echo '(FEL boot)'; source ${fel_scriptaddr}; fi
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=2
bootfstype=fat
bootm_boot_mode=sec
bootm_size=0x2e00000
bootz=0x41000000 - 0x41800000
console=ttyS0,115200
cpu=armv7
devnum=0
devplist=1
devtype=mmc
dfu_alt_info_ram=kernel ram 0x41000000 0x800000;fdt ram 0x41800000 0x100000;ramdisk ram 0x41B00000 0x1000000
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
ethact=ethernet@1c30000
ethaddr=02:01:b0:b3:d6:51
fdt_addr_r=0x41800000
fdtcontroladdr=43b42228
fdtfile=sun8i-v3s-licheepi-zero.dtb
fileaddr=41800000
filesize=2189
gatewayip=192.168.1.1
ipaddr=192.168.2.140
kernel_addr_r=0x41000000
load=mmc 0:1 0x41000000 zImage
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
machid=1029
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
netmask=255.255.255.0
preboot=usb start
pxefile_addr_r=0x41A00000
ramdisk_addr_r=0x41B00000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x41900000
serial#=12c00001b0b3d651
serverip=192.168.1.152
soc=sunxi
stderr=serial@01c28000
stdin=serial@01c28000
stdout=serial@01c28000
ttyS0,115200=panic=5 rootwait root=/dev/mmcblk0p2
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi

Environment size: 4433/131068 bytes

此外,这是sd卡内容

=> ls mmc 0:1
     8585   sun8i-v3s-licheepi-zero.dtb
  3860984   zimage

2 file(s), 0 dir(s)

=> ls mmc 0:2
<DIR>       4096 .
<DIR>       4096 ..
<DIR>      16384 lost+found
         5109760 rootfs.tar
<DIR>       4096 bin
<DIR>       4096 dev
<DIR>       4096 etc
<DIR>       4096 lib
<SYM>          3 lib32
<SYM>         11 linuxrc
<DIR>       4096 media
<DIR>       4096 mnt
<DIR>       4096 opt
<DIR>       4096 proc
<DIR>       4096 root
<DIR>       4096 run
<DIR>       4096 sbin
<DIR>       4096 sys
<DIR>       4096 tmp
<DIR>       4096 usr
<DIR>       4096 var
=>

#21 Re: 全志 SOC » 我的Linux入坑日记,顺便求解其中的问题。 » 2022-06-30 18:30:05

附上最后遇到的问题:

U-Boot SPL 2017.01-rc2 (Jun 30 2022 - 17:36:33)
DRAM: 64 MiB
Trying to boot from MMC1

U-Boot 2017.01-rc2 (Jun 30 2022 - 17:36:33 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000


U-Boot 2017.01-rc2 (Jun 30 2022 - 17:36:33 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000
Net:   phy interface0
eth0: ethernet@1c30000
starting USB...
No controllers found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Unknown command 'part' - try 'help'
Scanning mmc 0:1...
reading /sun8i-v3s-licheepi-zero.dtb
8585 bytes read in 25 ms (335 KiB/s)
starting USB...
No controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No controllers found
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17

Abort
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-02-01-b0-b3-d6-51
_sun8i_emac_eth_init: Timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-sunxi
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
*** ERROR: `ipaddr' not set
Config file not found
=> load mmc 0:1 0x41000000 zImage
reading zImage
3860984 bytes read in 199 ms (18.5 MiB/s)
=> bootz 0x41000000 - 0x41800000
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Device Tree to 42dfa000, end 42dff188 ... OK
Using machid 0x1029 from environment

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.10.15-licheepi-zero (root@linux) (gcc version 6.3.1 20170109 (Linaro GCC 6.3-2017.02) ) #1 SMP Thu Jun 30 10:31:52 CST 2022
[    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: Lichee Pi Zero
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] percpu: Embedded 14 pages/cpu @c3dea000 s24716 r8192 d24436 u57344
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 15883
[    0.000000] Kernel command line:
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 53648K/64036K available (6144K kernel code, 199K rwdata, 1420K rodata, 1024K init, 259K bss, 10388K 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 : 0xc4000000 - 0xff800000   ( 952 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc3e89000   (  62 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0700000   (7136 kB)
[    0.000000]       .init : 0xc0900000 - 0xc0a00000   (1024 kB)
[    0.000000]       .data : 0xc0a00000 - 0xc0a31e00   ( 200 kB)
[    0.000000]        .bss : 0xc0a33000 - 0xc0a73f0c   ( 260 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 24.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000007] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000018] Switching to timer-based delay loop, resolution 41ns
[    0.000129] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000339] Console: colour dummy device 80x30
[    0.000753] console [tty0] enabled
[    0.000790] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000828] pid_max: default: 32768 minimum: 301
[    0.000975] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001001] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001754] CPU: Testing write buffer coherency: ok
[    0.002195] /cpus/cpu@0 missing clock-frequency property
[    0.002239] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002617] Setting up static identity map for 0x40100000 - 0x40100058
[    0.003399] smp: Bringing up secondary CPUs ...
[    0.003439] smp: Brought up 1 node, 1 CPU
[    0.003458] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.003477] CPU: All CPU(s) started in SVC mode.
[    0.004207] devtmpfs: initialized
[    0.006771] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.007095] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.007153] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.007324] pinctrl core: initialized pinctrl subsystem
[    0.008326] NET: Registered protocol family 16
[    0.008717] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.009865] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.009998] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.021076] SCSI subsystem initialized
[    0.021407] usbcore: registered new interface driver usbfs
[    0.021495] usbcore: registered new interface driver hub
[    0.021603] usbcore: registered new device driver usb
[    0.021842] pps_core: LinuxPPS API ver. 1 registered
[    0.021868] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.021915] PTP clock support registered
[    0.022148] Advanced Linux Sound Architecture Driver Initialized.
[    0.023859] clocksource: Switched to clocksource arch_sys_counter
[    0.024717] simple-framebuffer 43e89000.framebuffer: framebuffer at 0x43e89000, 0x177000 bytes, mapped to 0xc4080000
[    0.024771] simple-framebuffer 43e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[    0.031634] Console: switching to colour frame buffer device 100x30
[    0.041452] simple-framebuffer 43e89000.framebuffer: fb0: simplefb registered!
[    0.055215] NET: Registered protocol family 2
[    0.059623] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.063486] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    0.067373] TCP: Hash tables configured (established 1024 bind 1024)
[    0.071207] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.074985] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.078884] NET: Registered protocol family 1
[    0.083126] RPC: Registered named UNIX socket transport module.
[    0.086888] RPC: Registered udp transport module.
[    0.090464] RPC: Registered tcp transport module.
[    0.093951] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.099513] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.111980] NFS: Registering the id_resolver key type
[    0.115630] Key type id_resolver registered
[    0.118999] Key type id_legacy registered
[    0.126548] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.130129] io scheduler noop registered
[    0.133629] io scheduler deadline registered
[    0.137456] io scheduler cfq registered (default)
[    0.145341] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.215736] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.242841] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 31, base_baud = 1500000) is a U6_16550A
[    0.828193] console [ttyS0] enabled
[    0.835956] [drm] Initialized
[    0.844292] libphy: Fixed MDIO Bus: probed
[    0.851995] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.861952] ehci-platform: EHCI generic platform driver
[    0.870639] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.880176] ohci-platform: OHCI generic platform driver
[    0.889142] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[    0.902203] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0
[    0.912466] sun6i-rtc 1c20400.rtc: RTC enabled
[    0.920309] i2c /dev entries driver
[    0.928395] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input0
[    0.941431] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.013905] sunxi-mmc 1c0f000.mmc: base:0xc405d000 irq:23
[    1.023700] usbcore: registered new interface driver usbhid
[    1.032829] usbhid: USB HID core driver
[    1.041954] NET: Registered protocol family 17
[    1.050209] Key type dns_resolver registered
[    1.058009] Registering SWP/SWPB emulation handler
[    1.072588] usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.084291] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.093685] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[    1.108601] hub 1-0:1.0: USB hub found
[    1.116177] hub 1-0:1.0: 1 port detected
[    1.124595] using random self ethernet address
[    1.132603] using random host ethernet address
[    1.141630] usb0: HOST MAC 42:40:ea:bc:b4:1e
[    1.149450] usb0: MAC 1e:56:c4:8d:cd:ae
[    1.156628] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[    1.167412] g_cdc gadget: g_cdc ready
[    1.174652] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 00:00:55 UTC (55)
[    1.186407] vcc3v0: disabling
[    1.192786] vcc5v0: disabling
[    1.199086] ALSA device list:
[    1.205283]   No soundcards found.
[    1.214197] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.225148] Please append a correct "root=" boot option; here are the available partitions:
[    1.236874] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.248438] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.10.15-licheepi-zero #1
[    1.258996] Hardware name: Allwinner sun8i Family
[    1.267089] [<c010e2fc>] (unwind_backtrace) from [<c010b098>] (show_stack+0x10/0x14)
[    1.278254] [<c010b098>] (show_stack) from [<c0336824>] (dump_stack+0x84/0x98)
[    1.288849] [<c0336824>] (dump_stack) from [<c01a6e54>] (panic+0xdc/0x248)
[    1.299032] [<c01a6e54>] (panic) from [<c09011f0>] (mount_block_root+0x188/0x260)
[    1.309846] [<c09011f0>] (mount_block_root) from [<c09013e8>] (mount_root+0x120/0x128)
[    1.321155] [<c09013e8>] (mount_root) from [<c0901540>] (prepare_namespace+0x150/0x194)
[    1.332598] [<c0901540>] (prepare_namespace) from [<c0900e40>] (kernel_init_freeable+0x1d4/0x1e4)
[    1.345012] [<c0900e40>] (kernel_init_freeable) from [<c06495f8>] (kernel_init+0x8/0x10c)
[    1.356791] [<c06495f8>] (kernel_init) from [<c0107638>] (ret_from_fork+0x14/0x3c)
[    1.367938] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.384212] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #1, port1 00000100
[    1.536639] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #2, port1 00000100
[    1.689066] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #3, port1 00000100
[    1.841492] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (80, <SessEnd), retry #3, port1 00080108

#22 全志 SOC » 我的Linux入坑日记,顺便求解其中的问题。 » 2022-06-30 18:26:25

linux-xc
回复: 16

刚入坑,但感觉到处是坑。 mad

写驱动代码,说要内核源码,准备内核源码去了。

驱动编译发现不通过,说是要先编译内核源码,就先编译内核源码。

其中遇到各种编译问题,交叉编译问题,gcc版本过高问题。

完了终于编译得到 .ko 文件,拉去开发板说版本不对,无法加载,完蛋

查了半天,说可以改个头文件,改完 modinfo 后的确和开发板一样了,但还是提示加载失败

以上

最后决定从 uboot-->内核--->根文件系统 开始整个流程走一遍,心想,这下版本对了吧。

然后编译uboot遇到各种错误,很久很久才解决

然后编译内核遇到各种错误,很久很久才解决,甚至重装了 ubuntu 两次 。。。。。

最后编译根文件,又是各种错误。。。。

以上,都是根据教程来的,为啥自己就那么多错误,是官方给的东西玩我还是人品问题,这条路走不通。。。。

最后 uboot 烧录成功了,串口输出又是一堆错误,忽略!

然后拷贝镜像、设备树、根文件系统那个压缩文件解压

万事俱备,启动-------》

结果没有看到应该有的打印信息  reading zImage
反而设备树给打印出来了。。。。。

说是环境变量问题,看着也有 load mmc 0:1 0x41000000 zImage
没毛病啊。。。。

不信邪,再来几遍,再去搜

终于,既然环境变量没问题,我直接执行uboot指令可以吧
于是直接执行了  load mmc 0:1 0x41000000 zImage

好家伙,真的打印 reading zImage

然后执行 bootz 0x41000000 - 0x41800000,尝试进入Linux系统!

结果又打脸,显示根文件无法加载!

我感觉Linux就是个大坑。
mad mad mad mad mad

#23 Re: 全志 SOC » 荔枝派zero如何从uboot启动Linux » 2022-06-30 14:25:10

@哇酷小二

感谢回答,的确是bootcmd脚本问题,但我好奇的是官方给的配置为什么不加入启动内核的脚本?

我在uboot命令行输入以下两条指令成功引导镜像:

=> <INTERRUPT>
=> load mmc 0:1 0x41000000 zImage
reading zImage
3860984 bytes read in 633 ms (5.8 MiB/s)
=> bootz 0x41000000 - 0x41800000
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Device Tree to 42dfa000, end 42dff188 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.10.15-licheepi-zero (root@linux) (gcc version 6.3.1 20170109 (Linaro GCC 6.3-2017.02) ) #1 SMP Thu Jun 30 10:31:52 CST 2022
[    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: Lichee Pi Zero
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] percpu: Embedded 14 pages/cpu @c3dea000 s24716 r8192 d24436 u57344
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 15883
[    0.000000] Kernel command line:
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 53648K/64036K available (6144K kernel code, 199K rwdata, 1420K rodata, 1024K init, 259K bss, 10388K 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 : 0xc4000000 - 0xff800000   ( 952 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc3e89000   (  62 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0700000   (7136 kB)
[    0.000000]       .init : 0xc0900000 - 0xc0a00000   (1024 kB)
[    0.000000]       .data : 0xc0a00000 - 0xc0a31e00   ( 200 kB)
[    0.000000]        .bss : 0xc0a33000 - 0xc0a73f0c   ( 260 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 24.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000006] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000017] Switching to timer-based delay loop, resolution 41ns
[    0.000137] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000343] Console: colour dummy device 80x30
[    0.000755] console [tty0] enabled
[    0.000792] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000829] pid_max: default: 32768 minimum: 301
[    0.000980] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001007] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001769] CPU: Testing write buffer coherency: ok
[    0.002222] /cpus/cpu@0 missing clock-frequency property
[    0.002269] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002654] Setting up static identity map for 0x40100000 - 0x40100058
[    0.003422] smp: Bringing up secondary CPUs ...
[    0.003465] smp: Brought up 1 node, 1 CPU
[    0.003485] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.003504] CPU: All CPU(s) started in SVC mode.
[    0.004226] devtmpfs: initialized
[    0.006813] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.007145] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.007201] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.007374] pinctrl core: initialized pinctrl subsystem
[    0.008388] NET: Registered protocol family 16
[    0.008775] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.009981] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.010031] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.021085] SCSI subsystem initialized
[    0.021405] usbcore: registered new interface driver usbfs
[    0.021492] usbcore: registered new interface driver hub
[    0.021602] usbcore: registered new device driver usb
[    0.021842] pps_core: LinuxPPS API ver. 1 registered
[    0.021869] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.021913] PTP clock support registered
[    0.022144] Advanced Linux Sound Architecture Driver Initialized.
[    0.023845] clocksource: Switched to clocksource arch_sys_counter
[    0.024693] simple-framebuffer 43e89000.framebuffer: framebuffer at 0x43e89000, 0x177000 bytes, mapped to 0xc4080000
[    0.024747] simple-framebuffer 43e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[    0.031608] Console: switching to colour frame buffer device 100x30
[    0.041423] simple-framebuffer 43e89000.framebuffer: fb0: simplefb registered!
[    0.055151] NET: Registered protocol family 2
[    0.059552] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.063404] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    0.067295] TCP: Hash tables configured (established 1024 bind 1024)
[    0.071122] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.074894] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.078778] NET: Registered protocol family 1
[    0.083037] RPC: Registered named UNIX socket transport module.
[    0.086796] RPC: Registered udp transport module.
[    0.090362] RPC: Registered tcp transport module.
[    0.093836] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.099389] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.111856] NFS: Registering the id_resolver key type
[    0.115497] Key type id_resolver registered
[    0.118859] Key type id_legacy registered
[    0.126443] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.130019] io scheduler noop registered
[    0.133516] io scheduler deadline registered
[    0.137353] io scheduler cfq registered (default)
[    0.145273] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.215756] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.242905] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 31, base_baud = 1500000) is a U6_16550A
[    0.828234] console [ttyS0] enabled
[    0.835991] [drm] Initialized
[    0.844314] libphy: Fixed MDIO Bus: probed
[    0.852011] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.861965] ehci-platform: EHCI generic platform driver
[    0.870665] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.880206] ohci-platform: OHCI generic platform driver
[    0.889181] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[    0.902240] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0
[    0.912511] sun6i-rtc 1c20400.rtc: RTC enabled
[    0.920358] i2c /dev entries driver
[    0.928463] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input0
[    0.941516] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.013891] sunxi-mmc 1c0f000.mmc: base:0xc405d000 irq:23
[    1.023694] usbcore: registered new interface driver usbhid
[    1.032831] usbhid: USB HID core driver
[    1.041939] NET: Registered protocol family 17
[    1.050184] Key type dns_resolver registered
[    1.057987] Registering SWP/SWPB emulation handler
[    1.072559] usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.084263] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.093657] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[    1.108566] hub 1-0:1.0: USB hub found
[    1.116159] hub 1-0:1.0: 1 port detected
[    1.124600] using random self ethernet address
[    1.132617] using random host ethernet address
[    1.141649] usb0: HOST MAC 5a:d7:ae:2e:0b:f8
[    1.149474] usb0: MAC e6:b2:10:79:28:3f
[    1.156656] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[    1.167447] g_cdc gadget: g_cdc ready
[    1.174687] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 02:58:39 UTC (10719)
[    1.186709] vcc3v0: disabling
[    1.193115] vcc5v0: disabling
[    1.199430] ALSA device list:
[    1.205635]   No soundcards found.
[    1.214483] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.225466] Please append a correct "root=" boot option; here are the available partitions:
[    1.237208] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.248790] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.10.15-licheepi-zero #1
[    1.259370] Hardware name: Allwinner sun8i Family
[    1.267484] [<c010e2fc>] (unwind_backtrace) from [<c010b098>] (show_stack+0x10/0x14)
[    1.278669] [<c010b098>] (show_stack) from [<c0336824>] (dump_stack+0x84/0x98)
[    1.289287] [<c0336824>] (dump_stack) from [<c01a6e54>] (panic+0xdc/0x248)
[    1.299491] [<c01a6e54>] (panic) from [<c09011f0>] (mount_block_root+0x188/0x260)
[    1.310335] [<c09011f0>] (mount_block_root) from [<c09013e8>] (mount_root+0x120/0x128)
[    1.321666] [<c09013e8>] (mount_root) from [<c0901540>] (prepare_namespace+0x150/0x194)
[    1.333132] [<c0901540>] (prepare_namespace) from [<c0900e40>] (kernel_init_freeable+0x1d4/0x1e4)
[    1.345573] [<c0900e40>] (kernel_init_freeable) from [<c06495f8>] (kernel_init+0x8/0x10c)
[    1.357379] [<c06495f8>] (kernel_init) from [<c0107638>] (ret_from_fork+0x14/0x3c)
[    1.368541] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

现在出现了两个问题:
这个脚本应该在那里固化?
最后我将跟文件系统的结果解压到了SD卡上,但Linux内核最后提示无法加载跟文件系统。

#24 Re: 全志 SOC » 荔枝派zero如何从uboot启动Linux » 2022-06-30 13:01:21

哇酷小二 说:

(V3s/V3x/S3/S3L/R11通吃)小智V3x开发板smallwitpi lite u-boot/linux/buildroot测试
https://whycan.com/t_7248.html

对比了以下,是没有打印 reading zImage
但是已经有了这个文件,reading 了设备树

#25 全志 SOC » 荔枝派zero如何从uboot启动Linux » 2022-06-30 11:43:05

linux-xc
回复: 5

打印信息如下:

switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
reading /sun8i-v3s-licheepi-zero.dtb
8585 bytes read in 26 ms (322.3 KiB/s)
starting USB...
No controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No controllers found
No ethernet found.
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-sunxi
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
starting USB...
No controllers found
No ethernet found.
No ethernet found.
=>

查看分区文件:

=> ls mmc 0
  3860984   zimage
     8585   sun8i-v3s-licheepi-zero.dtb

2 file(s), 0 dir(s)

=>

已经烧录uboot
已经将 zimage、sun8i-v3s-licheepi-zero.dtb拷贝到FAT16主分区
未拷贝根文件系统

前辈们,这是需要烧录跟文件系统才可以自动加载Linux吗?
已经看到uboot读取了设备树。

#26 Re: 全志 SOC » 荔枝派zero烧录u-boot后打印错误如何解决? » 2022-06-29 23:21:21

找到了部分解决办法,来自网上:
https://blog.csdn.net/loveshipting/article/details/106005875

最后打印信息如下:

=> env default -a
## Resetting to default environment
himport_r: can't insert "stdin=serial,usbkbd" into hash table
himport_r: can't insert "stdout=serial,vga" into hash table
himport_r: can't insert "stderr=serial,vga" into hash table
=> saveenv
Saving Environment to MMC...
Writing to MMC(0)... done
=>

小白虽然不知道为何,但看打印信息vga,应该是关于屏幕的问题,没有接入屏幕导致的?
但是后面的驱动依然没有解决

#27 全志 SOC » 荔枝派zero烧录u-boot后打印错误如何解决? » 2022-06-29 23:09:35

linux-xc
回复: 1

根据官方办法编译成功得到:u-boot-sunxi-with-spl.bin
并烧录:if=u-boot-sunxi-with-spl.bin of=/dev/sdb1 bs=1024 seek=8

方法来源:http://zero.lichee.pro/%E7%B3%BB%E7%BB%9F%E5%BC%80%E5%8F%91/uboot_build.html



最后启动荔枝派,但是串口打印各种错误信息,是否正常?如何解决?我还没烧录Linux

U-Boot SPL 2017.01-rc2-00055-gc41fbfe7b5 (Jan 20 2017 - 00:39:08)
DRAM: 64 MiB
Trying to boot from MMC1

U-Boot 2017.01-rc2-00055-gc41fbfe7b5 (Jan 20 2017 - 00:39:08 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000


U-Boot 2017.01-rc2-00055-gc41fbfe7b5 (Jan 20 2017 - 00:39:08 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000
Net:   No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
starting USB...
No controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No controllers found
No ethernet found.
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-sunxi
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
starting USB...
No controllers found
No ethernet found.
No ethernet found.
=>

挑出错误打印:
*** Warning - bad CRC, using default environment
xxxxx
No controllers found

#28 Re: 全志 SOC » 荔枝派zero内核编译错误显示不支持汇编指令。 » 2022-06-28 21:14:40

已自行解决。
问题的原因是Ubuntu 安装了多个版本的arm-linux-gnueabihf,手动卸载/删除关于arm-linux-gnueabihf的文件后重新安装即可

#29 全志 SOC » 荔枝派zero内核编译错误显示不支持汇编指令。 » 2022-06-28 19:12:25

linux-xc
回复: 2

根据荔枝派zero文档要求:
安装交叉编译器:gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf
下载Linux源码: git clone https://github.com/Lichee-Pi/linux.git
下载的是 4.10.y 版本。

然后使用以下步骤时出现错误:

root@linux:/home/linux-zero-4.10.y# make ARCH=arm licheepi_zero_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:2468:
scripts/kconfig/confdata.c: In function ‘conf_write’:
scripts/kconfig/confdata.c:773:19: warning: ‘%s’ directive writing likely 7 or more bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
  773 |  sprintf(newname, "%s%s", dirname, basename);
      |                   ^~~~~~
scripts/kconfig/confdata.c:773:19: note: assuming directive output of 7 bytes
In file included from /usr/include/stdio.h:894,
                 from scripts/kconfig/zconf.tab.c:82:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: ‘__builtin___sprintf_chk’ output 1 or more bytes (assuming 4104) into a destination of size 4097
   38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 |       __glibc_objsize (__s), __fmt,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   40 |       __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~
In file included from scripts/kconfig/zconf.tab.c:2468:
scripts/kconfig/confdata.c:776:20: warning: ‘.tmpconfig.’ directive writing 11 bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
  776 |   sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
      |                    ^~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:894,
                 from scripts/kconfig/zconf.tab.c:82:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: ‘__builtin___sprintf_chk’ output between 13 and 4119 bytes into a destination of size 4097
   38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 |       __glibc_objsize (__s), __fmt,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   40 |       __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#



root@linux:/home/linux-zero-4.10.y# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CC      init/main.o
  CHK     include/generated/compile.h
  CC      arch/arm/vfp/vfpmodule.o
  CC      init/do_mounts.o
  CC      arch/arm/vdso/vgettimeofday.o
/tmp/cczqJHNG.s: Assembler messages:
/tmp/cczqJHNG.s:69: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:97: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:356: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1036: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1049: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1064: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1087: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1102: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1121: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1136: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1159: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1174: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1197: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1248: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1261: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1275: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1299: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1317: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1337: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1357: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1381: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1396: 错误: selected processor does not support `isb ' in ARM mode
/tmp/cczqJHNG.s:1420: 错误: selected processor does not support `isb ' in ARM mode
make[1]: *** [scripts/Makefile.build:295:arch/arm/vfp/vfpmodule.o] 错误 1
make: *** [Makefile:988:arch/arm/vfp] 错误 2
make: *** 正在等待未完成的任务....
/tmp/ccj2gZFh.s: Assembler messages:
/tmp/ccj2gZFh.s:65: 错误: selected processor does not support `dmb ish' in ARM mode
/tmp/ccj2gZFh.s:79: 错误: selected processor does not support `isb ' in ARM mode
/tmp/ccj2gZFh.s:82: 错误: selected processor does not support `mrrc p15,1,r4,r5,c14' in ARM mode
/tmp/ccj2gZFh.s:98: 错误: selected processor does not support `dmb ish' in ARM mode
/tmp/ccj2gZFh.s:113: 错误: selected processor does not support `dmb ish' in ARM mode
/tmp/ccj2gZFh.s:206: 错误: selected processor does not support `dmb ish' in ARM mode
/tmp/ccj2gZFh.s:216: 错误: selected processor does not support `dmb ish' in ARM mode
/tmp/ccj2gZFh.s:235: 错误: selected processor does not support `dmb ish' in ARM mode
/tmp/ccj2gZFh.s:247: 错误: selected processor does not support `dmb ish' in ARM mode
/tmp/ccj2gZFh.s:316: 错误: selected processor does not support `dmb ish' in ARM mode
/tmp/ccj2gZFh.s:327: 错误: selected processor does not support `isb ' in ARM mode
/tmp/ccj2gZFh.s:330: 错误: selected processor does not support `mrrc p15,1,r6,r7,c14' in ARM mode
/tmp/ccj2gZFh.s:349: 错误: selected processor does not support `dmb ish' in ARM mode
make[1]: *** [scripts/Makefile.build:295:arch/arm/vdso/vgettimeofday.o] 错误 1
make: *** [Makefile:988:arch/arm/vdso] 错误 2
/tmp/ccdtSPkT.s: Assembler messages:
/tmp/ccdtSPkT.s:933: 错误: selected processor does not support `cpsid i' in ARM mode
/tmp/ccdtSPkT.s:1054: 错误: selected processor does not support `cpsid i' in ARM mode
/tmp/ccdtSPkT.s:1092: 错误: selected processor does not support `cpsie i' in ARM mode
/tmp/ccdtSPkT.s:1274: 错误: selected processor does not support `cpsie i' in ARM mode
make[1]: *** [scripts/Makefile.build:294:init/main.o] 错误 1
make[1]: *** 正在等待未完成的任务....
/tmp/ccqH5JuW.s: Assembler messages:
/tmp/ccqH5JuW.s:852: 错误: selected processor does not support `dmb ish' in ARM mode
/tmp/ccqH5JuW.s:859: 错误: architectural extension `mp' is not allowed for the current base architecture
/tmp/ccqH5JuW.s:860: 错误: selected processor does not support `pldw [r3]' in ARM mode
/tmp/ccqH5JuW.s:863: 错误: selected processor does not support `pld [r3]' in ARM mode
/tmp/ccqH5JuW.s:869: 错误: selected processor does not support `ldrex r2,[r3]' in ARM mode
/tmp/ccqH5JuW.s:871: 错误: selected processor does not support `strex r1,r2,[r3]' in ARM mode
/tmp/ccqH5JuW.s:876: 错误: selected processor does not support `dmb ish' in ARM mode
make[1]: *** [scripts/Makefile.build:294:init/do_mounts.o] 错误 1
make: *** [Makefile:988:init] 错误 2




以上
查阅了各大网站解释,
说是gcc版本过高,因此降为GCC-9.4.0,无效

页脚

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

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