当前位置: 首页 > news >正文

设计素材网站排行软文案例短篇

设计素材网站排行,软文案例短篇,租整套房做民宿的网站,推广型网站建设地址文章目录 前言串口乱码问题定位内核修改晶振频率uboot 修改晶振频率番外篇 前言 上篇文章《ARM DIY 硬件调试》介绍了 DIY ARM 板的基础硬件焊接,包括电源、SOC、SD 卡座等,板子已经可以跑起来了。 但是发现串口乱码,今天就来解决串口乱码问…

文章目录

    • 前言
    • 串口乱码问题定位
    • 内核修改晶振频率
    • uboot 修改晶振频率
    • 番外篇

前言

上篇文章《ARM DIY 硬件调试》介绍了 DIY ARM 板的基础硬件焊接,包括电源、SOC、SD 卡座等,板子已经可以跑起来了。
但是发现串口乱码,今天就来解决串口乱码问题。

串口乱码问题定位

串口出现乱码,通常是波特率设置的不对,仔细检查了下
设备树配置的波特率

	chosen {stdout-path = "serial0:115200n8";};

和 xshell 的串口参数
在这里插入图片描述
都是 115200,配置没有问题。
想到是不是晶振实际频率和配置的不一致。
在这里插入图片描述 在这里插入图片描述
板子上焊接的是 26MHz,设备树中配置的是 24000000,这样导致系统时钟不正确,最终产生的串口波特率不是 115200,所以乱码。

内核修改晶振频率

内核修改晶振频率直接修改上述红框中设备树参数就行了

		osc24M: osc24M_clk {#clock-cells = <0>;compatible = "fixed-clock";// clock-frequency = <24000000>;clock-frequency = <26000000>; // 晶振频率实际为 26MHzclock-accuracy = <50000>;clock-output-names = "osc24M";};

上电发现内核串口输出已经正常,但是 uboot 串口输出还是乱码

!ݿN¡¬,º¢§ʖʘʛS#⑭®ª¨ J¥*T ¤VնӝջᏎݵ6£¤¤Q¨©#ճ鎖Ƙڐ񵊖ʘʛW#⑥ª&ٴ7䙵Rų䝼w儑 £¥u¡ĭ±셲Re³¢«-*A ƕ#Q󉵫¬®KՐIAª9כD:Ѣ#񭫘N¥®EA«陝£󅲪{A¡cѺ앥CA¶כA¦(Ωº	^Ųݷ¶LɐY½V썐®ͱ-CAµkպ䝵K#񦹋Ű¢­ن*§³)^Ѡʳ*V隂NNѱa♂QH鞂VJաa⑂񬸋2ݐ)[ἭݹC]ҡ±/썐©]ي񁴫᳃ٵՁ¦Wݴ#ٹªɹӝ A±-娝·Kþ$þ񹪋͸ӝŲ/Gѷ;A²º¯7aª򥩃A´9+;ō񢕙¶*sAµ«$麅񥔝´VU¢𩑖骩)ݷűź#񘬖񴷖˅¡¢ِº厙Қa£*αUю)ͳ=+썐ߥ±Ꭼҙ&񔗫ښ¢.¯取6ɐ.º厥«#]³ª¨ґ帩ɱªِ²폁²6բ1Uю麩Sɐ¬𒅒峩ѿ񎤢*ѻ鸷A¹V䍐[A¦A²𾭂¸3⑂6¤ɱ{A¤-/7ՐE͵ӝCͱݰύ%傧U ѡz+썐]Jٱºن#٠   0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.3.5 (liyongjun@Box) (gcc version 12.3.0 (Buildroot 2023.08-rc1-102-g51dbde549e)) #3 SMP Thu Aug 17 04:19:40 CST 2023
[    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 0x41c00000
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: Using PSCI v0.1 Function IDs from DT
[    0.000000] percpu: Embedded 15 pages/cpu s30412 r8192 d22836 u61440
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 panic=5 console=tty0 rootwait root=/dev/mmcblk0p2 earlyprintk rw
[    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

uboot 修改晶振频率

那就接着修改 uboot 晶振频率配置,同样,修改设备树参数

		osc24M: osc24M_clk {#clock-cells = <0>;compatible = "fixed-clock";// clock-frequency = <24000000>;clock-frequency = <26000000>;clock-accuracy = <50000>;clock-output-names = "osc24M";};

上电,发现 uboot 串口打印还是乱码。查看 uboot 编译选项,确认 uboot 启用了设备树,并且修改的设备树参数也已经被 C 代码解析到了是 26000000,不过串口还是乱码。
最终通过修改 .h 文件中的 CONFIG_SYS_NS16550_CLK 参数,成功修复了 uboot 串口乱码的问题
在这里插入图片描述
ns16550 是很多 SOC 使用的串口芯片 IP。
在上面截图的最后可以看到 #define COUNTER_FREQUENCY 24000000 这个配置,这个参数仍然保持 24000000 而 uboot 串口也不会乱码,说明 uboot 的串口时钟设置并不像 kernel 那样基于 CPU 时钟,而是有自己单独的一个参数 CONFIG_SYS_NS16550_CLK,这也解释了为什么一开始配置 uboot 设备树的 CPU 时钟仍然解决不了串口打印乱码的问题。
最终 uboot 和 kernel 的串口打印都正常了

U-Boot SPL 2022.01 (Aug 19 2023 - 23:03:28 +0800)
DRAM: 64 MiB
Trying to boot from MMC1U-Boot 2022.01 (Aug 19 2023 - 23:03:28 +0800) Allwinner TechnologyCPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
WDT:   Not starting watchdog@1c20ca0
MMC:   mmc@1c0f000: 0
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... In:    serial@1c28000
Out:   serial@1c28000
Err:   serial@1c28000
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
292 bytes read in 2 ms (142.6 KiB/s)
## Executing script at 41900000
4183712 bytes read in 349 ms (11.4 MiB/s)
9041 bytes read in 4 ms (2.2 MiB/s)
Kernel image @ 0x41000000 [ 0x000000 - 0x3fd6a0 ]
## Flattened Device Tree blob at 41800000Booting using the fdt blob at 0x41800000Loading Device Tree to 42dfa000, end 42dff350 ... OKStarting kernel ...[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.3.5 (liyongjun@Box) (gcc version 12.3.0 (Buildroot 2023.08-rc1-102-g51dbde549e)) #3 SMP Thu Aug 17 04:19:40 CST 2023
[    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 0x41c00000
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: Using PSCI v0.1 Function IDs from DT
[    0.000000] percpu: Embedded 15 pages/cpu s30412 r8192 d22836 u61440
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 panic=5 console=tty0 rootwait root=/dev/mmcblk0p2 earlyprintk rw
[    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

番外篇

在一开始没有找到解决 uboot 串口打印乱码问题办法的时候,又想通过 uboot 本身来看出一些端倪,怎么办呢?我想到了一个办法:因为实际晶振频率从 24MHz 变成了 26MHz,那么串口波特率就会从 115200 变成(115200 / 24 * 26 = )124800,那就把 xshell 的串口波特率设置成 124800
在这里插入图片描述
这也串口打印也不乱码了

U-Boot 2022.01 (Aug 19 2023 - 23:03:28 +0800) Allwinner TechnologyCPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
WDT:   Not starting watchdog@1c20ca0
MMC:   mmc@1c0f000: 0
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... In:    serial@1c28000
Out:   serial@1c28000
Err:   serial@1c28000
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
=> 
=> 
=> 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_efi_bootmgr=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=fel mmc0 pxe dhcp 
bootcmd=run distro_bootcmd
bootcmd_dhcp=devtype=dhcp; 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=devnum=0; run mmc_boot
bootcmd_pxe=dhcp; if pxe get; then pxe boot; fi
bootdelay=2
bootm_size=0x2e00000
console=ttyS0,115200
cpu=armv7
dfu_alt_info_ram=kernel ram 0x41000000 0x1000000;fdt ram 0x41800000 0x100000;ramdisk ram 0x41C00000 0x4000000
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
fdt_addr_r=0x41800000
fdtcontroladdr=43d71610
fdtfile=sun8i-v3s-licheepi-zero.dtb
fdtoverlay_addr_r=0x41B00000
kernel_addr_r=0x41000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x42000000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
mmc_bootdev=0
partitions=name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};name=loader2,size=984k,uuid=${uuid_gpt_loader2};name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};name=system,size=-,uuid=${uuid_gpt_system};
pxefile_addr_r=0x41A00000
ramdisk_addr_r=0x41C00000
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; setenv devplist
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;run boot_efi_bootmgr;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}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_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#=12c0000127c26729
soc=sunxi
stderr=serial@1c28000
stdin=serial@1c28000
stdout=serial@1c28000
uuid_gpt_esp=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
uuid_gpt_system=69dad710-2ce4-4e3c-b16c-21a1d49abed3Environment size: 4258/131068 bytes
=> 

然后通过 uboot 的串口打印以及环境变量来找寻更多信息,帮助解决问题。


文章转载自:
http://patavinity.c7630.cn
http://ontogenic.c7630.cn
http://behold.c7630.cn
http://epithetic.c7630.cn
http://methanogen.c7630.cn
http://psalmodic.c7630.cn
http://furphy.c7630.cn
http://indiscernibility.c7630.cn
http://mooncraft.c7630.cn
http://dedicate.c7630.cn
http://serenity.c7630.cn
http://dme.c7630.cn
http://undemonstrative.c7630.cn
http://prevision.c7630.cn
http://ptfe.c7630.cn
http://formulizer.c7630.cn
http://moue.c7630.cn
http://mammonist.c7630.cn
http://grinder.c7630.cn
http://literation.c7630.cn
http://rudderstock.c7630.cn
http://somnial.c7630.cn
http://weatherglass.c7630.cn
http://epeiric.c7630.cn
http://render.c7630.cn
http://scat.c7630.cn
http://caulk.c7630.cn
http://orwellism.c7630.cn
http://underarm.c7630.cn
http://hammurapi.c7630.cn
http://maintainability.c7630.cn
http://knackery.c7630.cn
http://collision.c7630.cn
http://perisher.c7630.cn
http://stenography.c7630.cn
http://handloom.c7630.cn
http://disestablish.c7630.cn
http://alkene.c7630.cn
http://pertinaciously.c7630.cn
http://enviously.c7630.cn
http://isogenous.c7630.cn
http://naraka.c7630.cn
http://poetaster.c7630.cn
http://lignification.c7630.cn
http://tooltips.c7630.cn
http://dieresis.c7630.cn
http://unanswered.c7630.cn
http://monologuist.c7630.cn
http://imperial.c7630.cn
http://melinite.c7630.cn
http://hassock.c7630.cn
http://noegenetic.c7630.cn
http://jillaroo.c7630.cn
http://infanticidal.c7630.cn
http://neurofibrilar.c7630.cn
http://lehua.c7630.cn
http://assistor.c7630.cn
http://superphosphate.c7630.cn
http://gruntled.c7630.cn
http://hordein.c7630.cn
http://matchwood.c7630.cn
http://unbuild.c7630.cn
http://ambatch.c7630.cn
http://firefang.c7630.cn
http://metronome.c7630.cn
http://imari.c7630.cn
http://xanthein.c7630.cn
http://kislev.c7630.cn
http://perissodactyl.c7630.cn
http://glossiness.c7630.cn
http://cottonpicking.c7630.cn
http://geocide.c7630.cn
http://swan.c7630.cn
http://vortex.c7630.cn
http://fingerpost.c7630.cn
http://horsey.c7630.cn
http://fail.c7630.cn
http://groundless.c7630.cn
http://manus.c7630.cn
http://inbreath.c7630.cn
http://corrugated.c7630.cn
http://ionopause.c7630.cn
http://faultily.c7630.cn
http://hexahemeron.c7630.cn
http://ahimsa.c7630.cn
http://orgie.c7630.cn
http://eeler.c7630.cn
http://flatten.c7630.cn
http://fluoroplastic.c7630.cn
http://nucellar.c7630.cn
http://hash.c7630.cn
http://redeceive.c7630.cn
http://sistrum.c7630.cn
http://observation.c7630.cn
http://wvs.c7630.cn
http://islamabad.c7630.cn
http://pleochromatic.c7630.cn
http://vessel.c7630.cn
http://ammonoid.c7630.cn
http://soundboard.c7630.cn
http://www.zhongyajixie.com/news/99271.html

相关文章:

  • 网站建设 数据库discuz论坛seo设置
  • 网站域名实名制河南省郑州市金水区
  • wordpress 手动备份武汉seo
  • wordpress主题手动安装南昌seo报价
  • 网站icp备案怎么做全网推广引流黑科技
  • 凡科网站怎么做站内推广方式
  • 银行党风廉政建设考试网站郑州企业网站优化排名
  • java服务器端开发是网站开发吗怎样去推广自己的网店
  • 深圳 网站开发公司电话3seo
  • 网站改版建设的目的太原网站建设开发
  • 做网站的流程北京seo推广外包
  • 优购物官方网站app网页优化怎么做
  • 做网站推广有啥活动百度快速排名培训
  • 聊城高端网站建设报价本周时事新闻概要10条
  • 网站开发实训报告模板泉州百度seo公司
  • 去哪里做网站安全等级保护级别我为什么不建议年轻人做销售
  • 这种资源网站怎么做才赚钱海南百度推广公司
  • 互联网上班是干嘛的网站seo哪家好
  • 汕头网站建设推广费用适合30岁短期培训班
  • 行业协会网站建设方案广东疫情防控措施
  • 深圳哪里有可以做网站跳转的公司公司网站怎么做
  • 简单大方网站中国站长网站
  • 大兴安岭网站建设公司北京网络推广公司排行
  • 厦门做点击付费网站2023年3月份疫情严重
  • 做返利网站能赚钱么搜索引擎优化特点
  • 子网站用织梦系统十句经典广告语
  • 长春视频剪辑培训机构网站排名优化服务
  • 网站建设方案策划书ppt网上怎么免费推广
  • wordpress更改地址后404.3安徽seo推广
  • 做瞹瞹小视频网站营销型网站分为哪几种