You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Yocto Jethro 2.0+meta-altera:Cyclone V SOC设备树与文件系统配置求助

解决Yocto Jethro中Cyclone V SOC设备树修改不生效及波特率问题

Hey there, let's work through your issues step by step—this is a super common pitfall when getting started with Yocto's kernel and device tree workflow!

为什么修改./tmp/work-shared/cyclone5/kernel-source/.../socfpga_cyclone5_sockit.dts没效果?

The tmp/work-shared directory is a temporary build artifact—Yocto extracts kernel sources here during builds, but any changes you make here will either get overwritten on the next bitbake run, or won't be picked up by the build system at all. Yocto relies on its layer-based recipe system to track persistent modifications to kernel sources (including device trees), so you need to make changes through the proper channels.

正确的设备树修改方法

You have two solid options to customize the device tree permanently:

  1. Add a patch via your custom meta-layer

    • First, use devtool to create a persistent workspace for kernel modifications:
      devtool modify linux-altera
      
      This clones the kernel source into build/workspace/sources/linux-altera—this is where you'll make your changes.
    • Edit the socfpga_cyclone5_sockit.dts file in this workspace directory.
    • Generate a patch from your changes:
      cd workspace/sources/linux-altera
      git diff > 0001-custom-cyclone5-sockit-dts.patch
      
    • Move this patch to your custom meta-layer's kernel recipe folder (e.g., meta-custom/recipes-kernel/linux/linux-altera/).
    • Create a linux-altera_%.bbappend file in the same folder with this content:
      FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
      SRC_URI += "file://0001-custom-cyclone5-sockit-dts.patch"
      
    • Rebuild the kernel with bitbake linux-altera to apply your changes.
  2. Replace the entire DTS file

    • Copy your modified socfpga_cyclone5_sockit.dts to your custom meta-layer's kernel recipe directory.
    • Update your linux-altera_%.bbappend to override the original file:
      FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
      SRC_URI += "file://socfpga_cyclone5_sockit.dts"
      do_configure_append() {
          cp ${WORKDIR}/socfpga_cyclone5_sockit.dts ${S}/arch/arm/boot/dts/
      }
      
    • Rebuild the kernel with bitbake linux-altera.

关于bootargs中的波特率问题

The console baud rate in bootargs is usually set in one of three places:

  1. U-Boot configuration: If your board uses U-Boot, the bootargs might be hardcoded in the U-Boot environment or config. You can customize U-Boot using the same bbappend approach for your meta-layer.
  2. Device tree chosen node: Add or modify this node in your DTS to set the baud rate directly:
    chosen {
        bootargs = "console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait";
    };
    
  3. Yocto local.conf: Override the default bootargs globally by adding this line to build/conf/local.conf:
    KERNEL_BOOTARGS = "console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait"
    
    Adjust the root device path to match your board's storage setup.

Don't forget to rebuild the relevant components (kernel or U-Boot) after making changes, then reflash your image to the board.

内容的提问来源于stack exchange,提问作者Paddler

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 04:24:58