您尚未登录。

楼主 # 2025-02-10 16:27:26

wdawd
会员
注册时间: 2023-12-19
已发帖子: 11
积分: 21

串口波特率修改以后出现这个问题该如何解决

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.2.0-200563-g338e6aaa6f28-dirty (linux@linux) (gcc version 7.5.0 (Linaro GCC 7.5-2019.12)) #18 SMP Mon Feb 10 16:02:44 CST 2025
[    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 with Dock
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 16 MiB at 0x43000000
[    0.000000] percpu: Embedded 16 pages/cpu s34508 r8192 d22836 u65536
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw  vt.global_cursor_default=0
[    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: 38512K/65536K available (6144K kernel code, 429K rwdata, 1640K rodata, 1024K init, 244K bss, 10640K reserved, 16384K 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 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/0x484 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.000019] Switching to timer-based delay loop, resolution 41ns
[    0.000231] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000492] Console: colour dummy device 80x30
[    0.000547] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000560] pid_max: default: 32768 minimum: 301
[    0.000721] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000740] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001541] CPU: Testing write buffer coherency: ok
[    0.002068] /cpus/cpu@0 missing clock-frequency property
[    0.002096] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002871] Setting up static identity map for 0x40100000 - 0x40100060
[    0.003072] rcu: Hierarchical SRCU implementation.
[    0.003577] smp: Bringing up secondary CPUs ...
[    0.003596] smp: Brought up 1 node, 1 CPU
[    0.003606] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.003613] CPU: All CPU(s) started in SVC mode.
[    0.004604] devtmpfs: initialized
[    0.008062] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.008366] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.008397] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.009194] pinctrl core: initialized pinctrl subsystem
[    0.010599] NET: Registered protocol family 16
[    0.011741] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.012977] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.012994] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.029574] SCSI subsystem initialized
[    0.030394] usbcore: registered new interface driver usbfs
[    0.030454] usbcore: registered new interface driver hub
[    0.030542] usbcore: registered new device driver usb
[    0.030863] pps_core: LinuxPPS API ver. 1 registered
[    0.030874] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.030896] PTP clock support registered
[    0.032364] clocksource: Switched to clocksource arch_sys_counter
[    0.043307] NET: Registered protocol family 2
[    0.043937] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.043978] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.044004] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.044026] TCP: Hash tables configured (established 1024 bind 1024)
[    0.044174] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.044224] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.044461] NET: Registered protocol family 1
[    0.045470] RPC: Registered named UNIX socket transport module.
[    0.045490] RPC: Registered udp transport module.
[    0.045496] RPC: Registered tcp transport module.
[    0.045502] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.047584] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.055587] NFS: Registering the id_resolver key type
[    0.055644] Key type id_resolver registered
[    0.055653] Key type id_legacy registered
[    0.055774] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[    0.055786] io scheduler mq-deadline registered
[    0.055794] io scheduler kyber registered
[    0.056719] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[    0.060685] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.126889] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.129229] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[    0.130364] printk: console [ttyS0] disabled
[    0.150653] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 36, base_baud = 7500000) is a U6_16550A
[    0.684643] printk: console [ttyS0] enabled
[    0.689391] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[    0.720632] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 37, base_baud = 7500000) is a U6_16550A
[    0.751419] 1c28800.serial: ttyS2 at MMIO 0x1c28800 (irq = 38, base_baud = 7500000) is a U6_16550A
[    0.785980] libphy: Fixed MDIO Bus: probed
[    0.790095] CAN device driver interface
[    0.794753] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[    0.800557] dwmac-sun8i 1c30000.ethernet: No regulator found
[    0.806874] dwmac-sun8i 1c30000.ethernet: Current syscon value is not the default 148000 (expect 58000)
[    0.816359] dwmac-sun8i 1c30000.ethernet: No HW DMA feature register supported
[    0.823596] dwmac-sun8i 1c30000.ethernet: RX Checksum Offload Engine supported
[    0.830810] dwmac-sun8i 1c30000.ethernet: COE Type 2
[    0.835784] dwmac-sun8i 1c30000.ethernet: TX Checksum insertion supported
[    0.842575] dwmac-sun8i 1c30000.ethernet: Normal descriptors
[    0.848228] dwmac-sun8i 1c30000.ethernet: Chain mode enabled
[    0.854135] libphy: stmmac: probed
[    0.858246] dwmac-sun8i 1c30000.ethernet: Found internal PHY node
[    0.864627] libphy: mdio_mux: probed
[    0.868229] dwmac-sun8i 1c30000.ethernet: Switch mux to internal PHY
[    0.874634] dwmac-sun8i 1c30000.ethernet: Powering internal PHY
[    0.881724] libphy: mdio_mux: probed
[    0.885759] PPP generic driver version 2.4.2
[    0.890405] PPP BSD Compression module registered
[    0.895208] PPP Deflate Compression module registered
[    0.900267] PPP MPPE Compression module registered
[    0.905081] NET: Registered protocol family 24
[    0.909653] usbcore: registered new interface driver asix
[    0.915141] usbcore: registered new interface driver ax88179_178a
[    0.921260] usbcore: registered new interface driver cdc_ether
[    0.927149] usbcore: registered new interface driver net1080
[    0.932852] usbcore: registered new interface driver rndis_host
[    0.938819] usbcore: registered new interface driver cdc_subset
[    0.944794] usbcore: registered new interface driver zaurus
[    0.950416] usbcore: registered new interface driver cdc_ncm
[    0.956094] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.962626] ehci-platform: EHCI generic platform driver
[    0.968156] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.973827] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.981985] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[    1.012354] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    1.019559] hub 1-0:1.0: USB hub found
[    1.023510] hub 1-0:1.0: 1 port detected
[    1.028076] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.034392] ohci-platform: OHCI generic platform driver
[    1.039942] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    1.046664] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    1.054790] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[    1.127465] hub 2-0:1.0: USB hub found
[    1.131291] hub 2-0:1.0: 1 port detected
[    1.138630] usbcore: registered new interface driver option
[    1.144391] usbserial: USB Serial support registered for GSM modem (1-port)
[    1.152717] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input0
[    1.161882] sun6i-rtc 1c20400.rtc: registered as rtc0
[    1.167056] sun6i-rtc 1c20400.rtc: RTC enabled
[    1.171794] i2c /dev entries driver
[    1.178031] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.186725] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    1.223369] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.230650] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[    1.265396] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB
[    1.273533] usbcore: registered new interface driver usbhid
[    1.279110] usbhid: USB HID core driver
[    1.283659] NET: Registered protocol family 17
[    1.288139] can: controller area network core (rev 20170425 abi 9)
[    1.294497] NET: Registered protocol family 29
[    1.298947] can: raw protocol (rev 20170425)
[    1.303247] can: broadcast manager protocol (rev 20170425 t)
[    1.308906] can: netlink gateway (rev 20170425) max_hops=1
[    1.314698] Key type dns_resolver registered
[    1.319098] Registering SWP/SWPB emulation handler
[    1.332073] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.343569] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.349334] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    1.359501] hub 3-0:1.0: USB hub found
[    1.363567] hub 3-0:1.0: 1 port detected
[    1.368753] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T00:12:02 UTC (722)
[    1.377256] vcc5v0: disabling
[    1.381259] Waiting for root device /dev/mmcblk0p2...
[    1.386522] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.396462] mmc0: new high speed SDHC card at address 59b4
[    1.403944] mmcblk0: mmc0:59b4 SDU1  14.8 GiB
[    1.410725]  mmcblk0: p1 p2
[    1.454002] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.462209] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.470502] devtmpfs: mounted
[    1.475293] Freeing unused kernel memory: 1024K
[    1.480000] Run /sbin/init as init process
[    1.601952] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    1.622540] usb 1-1: new high-speed USB device number 2 using ehci-platform
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Initializing random number generator: OK
Saving random seed: [    1.841692] random: dd: uninitialized urandom read (512 bytes read)
[    1.850812] cdc_ncm 1-1:1.0: MAC-Address: 00:1e:10:1f:00:00
[    1.856570] cdc_ncm 1-1:1.0: setting rx_max = 16384
OK
Starting haveged: [    1.872565] cdc_ncm 1-1:1.0 wwan0: register 'cdc_ncm' at usb-1c1a000.usb-1, Mobile Broadband Network Device, 00:1e:10:1f:00:00
[    1.894135] option 1-1:1.1: GSM modem (1-port) converter detected
[    1.901979] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[    1.912110] option 1-1:1.2: GSM modem (1-port) converter detected
[    1.919619] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
haveged: listening socket at 3[    1.932920] option 1-1:1.3: GSM modem (1-port) converter detected

[    1.952533] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[    1.963189] option 1-1:1.4: GSM modem (1-port) converter detected
[    1.982726] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3

日志的头直接成这样了,串口0的波特率为115200,修改了如下部分
为了串口通信稳定,一般要求波特率误差在2.5%以内。

V3S的uart是挂在APB2下,而APB2时钟是24M,所以对一些高速率的波特率,难以分频到合适的频率。

以921600为例,下面进行修改:

进入 uboot的arch/arm/mach-sunxi/clock_sun6i.c,修改uart时钟:

void clock_init_uart(void)
{
#if CONFIG_CONS_INDEX < 5
        struct sunxi_ccm_reg *const ccm =
                (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;

        /* uart clock source is apb2 */
        writel(APB2_CLK_SRC_OSC24M|      //这里改为APB2_CLK_SRC_PLL6,从内部pll6时钟分频
            APB2_CLK_RATE_N_1|               //这里预分频不变
            APB2_CLK_RATE_M(1),
            &ccm->apb2_div);

pll6时钟默认为600MHz,可以分出比较高的串口波特率。

600/0.9216/16=40.69, 舍入为41,相对误差为0.75%

/* ns16550 reg in the low bits of cpu reg */
#define CONFIG_SYS_NS16550_CLK          24000000    //这里改为600000000
#ifndef CONFIG_DM_SERIAL

剩余的就是按照原有方法修改波特率了。

离线

页脚

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

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