您尚未登录。

#4 Re: 全志 SOC » 全志V831芯片移植4G模块,发现无法生成ttyUSB节点,请教各位 » 2022-11-21 21:20:05

rtqq 说:

看了一下启动脚本,好像在 /etc/init.d/S550usb  中,将USB0 设置成了OTG 模式,不知道怎么取消

https://whycan.com/viewtopic.php?id=6021
参考下?

#6 Re: 全志 SOC » 全志V3S移植移远EC200S » 2022-11-15 22:24:48

编辑不了了,补一下上面的内核配置
87010a4d134aa39f42f3f47dc107204.png8ee817b1f9e4750f8d382cfbad459d2.pngdda5ec0ff8ecc3b2f872eb3a9e82e39.png

#7 Re: 全志 SOC » 主线Linux用shell命令切换 OTG(分享)tiny200/licheepi nano|zero均可以使用 » 2022-11-15 10:13:15

v3s 需要改下目录

echo host > /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode 
echo peripheral > /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode 

#9 Re: 全志 SOC » zero spi flash启动时卡在了Starting kernel ...,大神们帮我看下 » 2022-11-13 10:10:20

楼主搞定了吗,我也是5.2想从flash启动一直卡在Starting kernel

#10 Re: 全志 SOC » 求助,v3s使用5.2内核从nano spi启动的时候报错 » 2022-11-12 23:50:59

uboot 启动参数配置

#define CONFIG_BOOTCOMMAND   "sf probe 0; "                           \
                             "sf read 0x41800000 0x100000 0x10000; "  \
                             "sf read 0x41000000 0x110000 0x400000; " \
                             "bootz 0x41000000 - 0x41800000"

 #define CONFIG_BOOTARGS      "console=ttyS0,115200 earlyprintk panic=5 rootwait " \
                             "mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,6M(kernel)ro,-(rootfs) root=31:03 rw rootfstype=jffs2"

#11 Re: 全志 SOC » 求助,v3s使用5.2内核从nano spi启动的时候报错 » 2022-11-12 23:47:48

测试直接写入内存启动可以正常启动到内核

./sunxi-fel.exe -p uboot u-boot-sunxi-with-spl.bin write 0x41000000 zImage write 0x41800000 sun8i-v3s-licheepi-zero.dtb

启动日志

U-Boot 2017.01-rc2-00073-gdd6e8740dc-dirty (Nov 06 2022 - 02:17:41 -0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** 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:  2  1  0 
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x100000, size 0x10000
SF: 65536 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Device Tree to 42dfa000, end 42dffbf8 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.2.0-licheepi-zero+ (root@ubuntu) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)) #5 SMP Fri Nov 11 22:41:33 PST 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] printk: bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] percpu: Embedded 16 pages/cpu s34508 r8192 d22836 u65536
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 15883
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk panic=5 rootwait mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,-(rootfs) root=31:03 rw rootfstype=jffs2
[    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: 53544K/64036K available (6144K kernel code, 302K rwdata, 1716K rodata, 1024K init, 253K bss, 10492K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x2f8/0x498 with crng_init=0
[    0.000000] arch_timer: 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.008001] Switching to timer-based delay loop, resolution 41ns
[    0.014174] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.023585] Console: colour dummy device 80x30
[    0.028076] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.038442] pid_max: default: 32768 minimum: 301
[    0.043208] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.050541] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.059090] CPU: Testing write buffer coherency: ok
[    0.064564] /cpus/cpu@0 missing clock-frequency property
[    0.069890] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.076441] Setting up static identity map for 0x40100000 - 0x40100060
[    0.083194] rcu: Hierarchical SRCU implementation.
[    0.088618] smp: Bringing up secondary CPUs ...
[    0.093161] smp: Brought up 1 node, 1 CPU
[    0.097166] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.103387] CPU: All CPU(s) started in SVC mode.
[    0.109094] devtmpfs: initialized
[    0.115947] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.124001] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.133882] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.140910] pinctrl core: initialized pinctrl subsystem
[    0.147261] NET: Registered protocol family 16
[    0.152339] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.160522] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.168524] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.197858] SCSI subsystem initialized
[    0.201783] usbcore: registered new interface driver usbfs
[    0.207530] usbcore: registered new interface driver hub
[    0.212902] usbcore: registered new device driver usb
[    0.218246] mc: Linux media interface: v0.10
[    0.222567] videodev: Linux video capture interface: v2.00
[    0.228301] Advanced Linux Sound Architecture Driver Initialized.
[    0.236325] clocksource: Switched to clocksource arch_sys_counter
[    0.254317] NET: Registered protocol family 2
[    0.259652] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.268107] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.275772] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.282853] TCP: Hash tables configured (established 1024 bind 1024)
[    0.289377] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.295943] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.303269] NET: Registered protocol family 1
[    0.309620] Initialise system trusted keyrings
[    0.314430] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.328213] jffs2: version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
[    0.371492] Key type asymmetric registered
[    0.375601] Asymmetric key parser 'x509' registered
[    0.380670] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.388115] io scheduler mq-deadline registered
[    0.392643] io scheduler kyber registered
[    0.397749] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[    0.407614] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.485240] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.494091] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[    0.505196] printk: console [ttyS0] disabled
[    0.529793] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 33, base_baud = 1500000) is a U6_16550A
[    0.538833] printk: console [ttyS0] enabled
[    0.538833] printk: console [ttyS0] enabled
[    0.547211] printk: bootconsole [earlycon0] disabled
[    0.547211] printk: bootconsole [earlycon0] disabled
[    0.583727] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    0.595259] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.601153] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.607769] ehci-platform: EHCI generic platform driver
[    0.613312] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.618989] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.626963] ehci-platform 1c1a000.usb: irq 25, io mem 0x01c1a000
[    0.656351] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    0.663609] hub 1-0:1.0: USB hub found
[    0.667574] hub 1-0:1.0: 1 port detected
[    0.672164] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.678496] ohci-platform: OHCI generic platform driver
[    0.684092] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    0.690831] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    0.698837] ohci-platform 1c1a400.usb: irq 26, io mem 0x01c1a400
[    0.771439] hub 2-0:1.0: USB hub found
[    0.775286] hub 2-0:1.0: 1 port detected
[    0.780765] usbcore: registered new interface driver usb-storage
[    0.788366] sun6i-rtc 1c20400.rtc: registered as rtc0
[    0.793433] sun6i-rtc 1c20400.rtc: RTC enabled
[    0.798150] i2c /dev entries driver
[    0.803098] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input0
[    0.812804] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.821453] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    0.857918] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    0.865405] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[    0.876929] usbcore: registered new interface driver usbhid
[    0.882507] usbhid: USB HID core driver
[    0.889055] Initializing XFRM netlink socket
[    0.893366] NET: Registered protocol family 17
[    0.898537] Registering SWP/SWPB emulation handler
[    0.904461] Loading compiled-in X.509 certificates
[    0.914592] simple-framebuffer 43e89000.framebuffer: framebuffer at 0x43e89000, 0x177000 bytes, mapped to 0x(ptrval)
[    0.925259] simple-framebuffer 43e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[    0.941172] Console: switching to colour frame buffer device 100x30
[    0.953295] simple-framebuffer 43e89000.framebuffer: fb0: simplefb registered!
[    0.962097] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    0.973638] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    0.979493] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    0.988907] hub 3-0:1.0: USB hub found
[    0.992791] hub 3-0:1.0: 1 port detected
[    0.998286] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T00:02:55 UTC (175)
[    1.006751] vcc3v0: disabling
[    1.009733] vcc5v0: disabling
[    1.012697] ALSA device list:
[    1.015662]   No soundcards found.
[    1.020336] VFS: Cannot open root device "31:03" or unknown-block(31,3): error -19
[    1.028050] Please append a correct "root=" boot option; here are the available partitions:
[    1.036445] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,3)
[    1.044795] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.2.0-licheepi-zero+ #5
[    1.051918] Hardware name: Allwinner sun8i Family
[    1.056652] [<c010eeb8>] (unwind_backtrace) from [<c010b6e0>] (show_stack+0x10/0x14)
[    1.064393] [<c010b6e0>] (show_stack) from [<c06b8bb0>] (dump_stack+0x84/0x98)
[    1.071613] [<c06b8bb0>] (dump_stack) from [<c011ded0>] (panic+0x110/0x2fc)
[    1.078572] [<c011ded0>] (panic) from [<c09013ac>] (mount_block_root+0x250/0x304)
[    1.086049] [<c09013ac>] (mount_block_root) from [<c090163c>] (prepare_namespace+0x154/0x198)
[    1.094568] [<c090163c>] (prepare_namespace) from [<c06cf1e8>] (kernel_init+0x8/0x110)
[    1.102479] [<c06cf1e8>] (kernel_init) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[    1.110037] Exception stack(0xc3833fb0 to 0xc3833ff8)
[    1.115084] 3fa0:                                     00000000 00000000 00000000 00000000
[    1.123252] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.131418] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    1.138039] Rebooting in 5 seconds..

#12 全志 SOC » 求助,v3s使用5.2内核从nano spi启动的时候报错 » 2022-11-12 15:38:51

tocurd
回复: 3
U-Boot 2017.01-rc2-00073-gdd6e8740dc-dirty (Nov 12 2022 - 01:22:45 -0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** 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-00073-gdd6e8740dc-dirty (Nov 12 2022 - 01:22:45 -0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** 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:  2  1  0 
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x100000, size 0x10000
SF: 65536 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Device Tree to 42dfa000, end 42dffbf8 ... OK

Starting kernel ...

prefetch abort
pc : [<6c98190c>]	   lr : [<4100024c>]
sp : 6cd86028  ip : 410006e4	 fp : e0400001
r10: 00000000  r9 : 410fc075	 r8 : 42dfa000
r7 : 00000000  r6 : 2b981840	 r5 : 410000c0  r4 : 40008000
r3 : 00000010  r2 : 000f0000	 r1 : 4100c075  r0 : 6c981908
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

用的是nano flash启动,5.2内核

#13 Re: 全志 SOC » 全志V3S移植移远EC200S » 2022-11-08 13:10:38

sven1234 说:

USB还是串口?

usb

#14 全志 SOC » 全志V3S移植移远EC200S » 2022-11-07 17:37:53

tocurd
回复: 6

附文档
Quectel_EC200S_Linux_USB_Driver_User_Guide_V1.0.pdf

828c89038ca49ada9b7d6f7064a2195.jpg


1. 添加 VID 和 PID
在文件[KERNEL]/drivers/usb/serial/option.c 中添加模块的 VID 和 PID 信息,如下所示:

static const struct usb_device_id option_ids[] = {
#if 1 //Added by Quectel
{ USB_DEVICE(0x2C7C, 0x6002) }, /* Quectel EC200S */
#endif

_20221107203010.png

2.添加USB零包

[KERNEL]/drivers/usb/serial/usb_wwan.c.

static struct urb *usb_wwan_setup_urb(struct usb_serial *serial, int endpoint,
 int dir, void *ctx, char *buf, int len,void (*callback) (struct urb *))
{
……
usb_fill_bulk_urb(urb, serial->dev,
 usb_sndbulkpipe(serial->dev, endpoint) | dir,
 buf, len, callback, ctx);
#if 1 //Added by Quectel for zero packet
if (dir == USB_DIR_OUT) {
struct usb_device_descriptor *desc = &serial->dev->descriptor;
if (desc->idVendor == cpu_to_le16(0x2C7C))
urb->transfer_flags |= URB_ZERO_PACKET;
}
#endif
return urb;
}

_20221107204036.png


3.增加复位恢复机制
[KERNEL]/drivers/usb/serial/option.c。

static struct usb_serial_driver option_1port_device = {
……
#ifdef CONFIG_PM
.suspend = usb_wwan_suspend,
.resume = usb_wwan_resume,
#if 1 //Added by Quectel
.reset_resume = usb_wwan_resume,
#endif
#endif
};

3.png


接下来使能一些内核配置项


TODO......



烧录内核成功后
1.烧录完成后使用指令

ls /dev/ttyUSB* 

可以看到下面的3个模拟的usb设备
_20221108110226.png

2.之后执行获取到IP地址

ifconfig usb1 up
udhcpc -i usb1

_20221108110343.png

3.使用AT指令使模块拨号

cat /dev/ttyUSB2 &
# 设置为RNDIS模式
echo -e "AT+QCFG=\"usbnet\",3\r\n" > /dev/ttyUSB2 
# 查询指令是否生效
echo -e "AT+QCFG=\"usbnet\"\r\n" > /dev/ttyUSB2 
# 发送 AT 指令拨号上网指令
echo -e "AT+qnetdevctl=1,1\r\n" > /dev/ttyUSB2

_20221108111929.png

4.执行ping指令测试拨号是否成功
_20221108111956.png



附一些常用的AT指令

echo -e "AT+QCCID\r\n" >/dev/ttyUSB2    //查询SIM卡
echo -e "AT+CFUN=1,1\r\n" >/dev/ttyUSB2   //重启模块
echo -e "AT+QSIMDET=1\r\n" >/dev/ttyUSB2   //开启SIM卡热插拔状态报告
echo -e "AT+QSIMDET=1,1\r\n" >/dev/ttyUSB2  //开启SIM卡检测功能
echo -e "AT+CSQ\r\n" >/dev/ttyUSB2  //查询信号强度
echo -e "AT+QNWINFO\r\n" >/dev/ttyUSB2 //查询网络状态
echo -e "AT+QCFG=\"NWSCANMODE\",3,1\r\n" >/dev/ttyUSB2 //设置4G LTE only
echo -e "AT+QCFG=\"NWSCANMODE\",2,1\r\n" >/dev/ttyUSB2 //设置3G WCDMA only
echo -e "AT+QCFG=\"NWSCANMODE\",1,1\r\n" >/dev/ttyUSB2 //设置2G GSM only
echo -e "AT+QCFG=\"NWSCANMODE\",0,1\r\n" >/dev/ttyUSB2 //设置自动搜索网络

# AT+QSIMDET=1,1或AT+QSIMDET=1,0开启     可以设置高电平  或者低电平有效//SIM卡热拔插,同一个电路 肯定不可以设置两种sim卡检测状态   要么高电平有效  要么低电平有效
# AT+QSIMDET=0  关闭热拔插功能
# 通过AT命令开启SIM卡检查功能

# 举例:
# AT+QSIMSTAT=1          //开启SIM卡热拔插状态报告
# AT+QSIMDET=1,1或AT+QSIMDET=1,0//开启 SIM卡检测功能
# 当SIM卡拔出或者插上的时候,模块会有相应的提示:
# +CPIN:NOT READY
# AT+QSIMSTAT=1,1或AT+QSIMSTAT=1,0
# Call Ready

页脚

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

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