禁用UART0进行控制台输出,并将其用于Pocketbeagle上的通用用途

问题描述 投票:0回答:1

我正在使用在Pocketbeagle(beaglebone的较小版本)上运行的debian图像。我似乎无法弄清楚如何禁用UART0进行控制台调试并将其用于我自己的目的。

输入时:

dmesg | grep tty

我得到以下内容:

[    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet
[    0.002567] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    1.446237] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250
[    1.459149] console [ttyS0] enabled
[    1.460177] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 159, base_baud = 3000000) is a 8250
[    1.461029] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 160, base_baud = 3000000) is a 8250
[    1.462034] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 161, base_baud = 3000000) is a 8250

我曾尝试查看/ boot中的uEnv.txt文件,但与UART0没有任何关系。这是我在uEnv.txt中找到的内容:

    #Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

    uname_r=4.9.82-ti-r102
    #uuid=
    #dtb=


    ###U-Boot Overlays###
    ###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
    ###Master Enable
    enable_uboot_overlays=1
    ###
    ###Overide capes with eeprom
    #uboot_overlay_addr0=/lib/firmware/<file0>.dtbo
    #uboot_overlay_addr1=/lib/firmware/<file1>.dtbo
    #uboot_overlay_addr2=/lib/firmware/<file2>.dtbo
    #uboot_overlay_addr3=/lib/firmware/<file3>.dtbo
    ###
    ###Additional custom capes
    #uboot_overlay_addr4=/lib/firmware/<file4>.dtbo
    #uboot_overlay_addr5=/lib/firmware/<file5>.dtbo
    #uboot_overlay_addr6=/lib/firmware/<file6>.dtbo
    #uboot_overlay_addr7=/lib/firmware/<file7>.dtbo
    ###
    ###Custom Cape
    #dtb_overlay=/lib/firmware/<file8>.dtbo
    ###
    ###Disable auto loading of virtual capes (emmc/video/wireless/adc)
    #disable_uboot_overlay_emmc=1
    #disable_uboot_overlay_video=1
    #disable_uboot_overlay_audio=1
    #disable_uboot_overlay_wireless=1
    #disable_uboot_overlay_adc=1
    ###
    ###PRUSS OPTIONS
    ###pru_rproc (4.4.x-ti kernel)
    #uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
    ###pru_uio (4.4.x-ti, 4.14.x-ti & mainline/bone kernel)
    #uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
    ###
    ###Cape Universal Enable
    enable_uboot_cape_universal=1
    ###
    ###Debug: disable uboot autoload of Cape
    #disable_uboot_overlay_addr0=1
    #disable_uboot_overlay_addr1=1
    #disable_uboot_overlay_addr2=1
    #disable_uboot_overlay_addr3=1
    ###
    ###U-Boot fdt tweaks... (60000 = 384KB)
    #uboot_fdt_buffer=0x60000
    ###U-Boot Overlays###
    cmdline=coherent_pool=1M net.ifnames=0 quiet

    #In the event of edid real failures, uncomment this next line:
    #cmdline=coherent_pool=1M net.ifnames=0 quiet video=HDMI-A-1:1024x768@60e

    ##enable Generic eMMC Flasher:
    ##make sure, these tools are installed: dosfstools rsync
    #cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

我该如何在Pocketbeagle上使用UART0?我似乎找不到任何关于它的文档。

beagleboneblack uart u-boot beagleboard
1个回答
0
投票

我认为通过引导加载程序,设备树或内核,您不会找到一个好的答案。我认为解决此问题的理想方法是配置操作系统。

我使用debian 9.9(使用systemd,这是一个Pocketbeagle来完成的。事实证明,两个systemd服务会干扰uart0:[email protected][email protected]。 systemd允许您使用掩码强制禁用服务。这只需要执行一次。因此,“ systemctl掩码[email protected]”和“ systemctl掩码[email protected]”应该执行此操作。请注意,在使用ttyO0之前,您可能必须手动配置一个串行端口。我使用c程序和一个名为termios的库来完成此操作,但是可能有一种在命令行上执行此操作的方法。

要验证我的答案,您可以调查/ etc / systemd / system目录并运行'systemctl list-units --type = service',以查看系统上正在运行什么。有关systemctl的更多信息,请参见:https://www.tecmint.com/list-all-running-services-under-systemd-in-linux/

© www.soinside.com 2019 - 2024. All rights reserved.