From patchwork Mon Aug 11 14:59:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandeep Gundlupet Raju X-Patchwork-Id: 68363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D9E1C87FD2 for ; Mon, 11 Aug 2025 15:00:17 +0000 (UTC) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (NAM04-MW2-obe.outbound.protection.outlook.com [40.107.101.59]) by mx.groups.io with SMTP id smtpd.web10.50427.1754924394922555325 for ; Mon, 11 Aug 2025 07:59:55 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@amd.com header.s=selector1 header.b=naoY1XZ7; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.101.59, mailfrom: sandeep.gundlupet-raju@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XNfWGoiUQMB0Ae+lEvCxHCfxmJDf5QZCj4vuE/ztbYsEGu+/MaLQs1oqq/LgJdtn7JQOOu+eTmRiVsj45h62Su2KsO3nJ4urPrOyAZYpUxY7iQXGCHEj6DvvRSaj1t5Ry1s1jlP2wWZ5fby5QRE6KakbDy8wToGqIinJ39m0Up62z0N+CGfYuXf97Za0c2dJTUDGQBDpBcGPZwg563Ey0jTCebRBdZV1o3PvrUAq0pVkdvlyLzNKGGh//BhtoCl2aCPoRrtLx+YILOVxL/4k9vd1IuHBlEE7iPwFA1jNb8wEWLKErW+4Ptq9M3RLP/uQbuw0VdWXzbip8nFZhszU4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ISs6cuvTFdN7VCuELhR8XI1pTHN8m0TeLRCYXAYPsKk=; b=qohDZNsPX+3ar+GemRdOPDPClxW2dCCo7XyTmkGMKifVqHNvCxPHlXa9tyz63aI10gO/1bSfkWd2vmkN1e9E7UOwAECTrCAWCWzo83qeFPdJOq0GmkNxftglHW06hMOi4XGPftcqfVr6JyQfVqfReK35gE/iJkVR7x0VXSDPQnxG921Uz+VPYqc46SS2No+MDf+VOHwbGx6BVdGfqJyJLnPMSaqh3noGiAQAXwPpmcXkCvzyqu09lRgY+GyHM0QHmrVdvVXNsrRgCCi7smzM3CSAOKTv975glhTJRDPnPqQSL77W2YvZdO/wW6oMMDCvD30+ai5aH7xboEgoGWt4tA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.yoctoproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ISs6cuvTFdN7VCuELhR8XI1pTHN8m0TeLRCYXAYPsKk=; b=naoY1XZ70jE6S+P7xClnE0klTBliNaNGA76iTFuUHkC4QKlRKcMvHLRqEyN4HWDpsbLdov9EFMk51H/iJ/+thxn1feNpxjrwmFuruCQhdqORpP7svhcl1Ugzvjr/ox5tX/N+sadymobQgEMQ2lwMLQVOSA5pHPl/VdUya6rmb7E= Received: from BLAPR05CA0011.namprd05.prod.outlook.com (2603:10b6:208:36e::26) by MN2PR12MB4472.namprd12.prod.outlook.com (2603:10b6:208:267::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9009.22; Mon, 11 Aug 2025 14:59:52 +0000 Received: from MN1PEPF0000ECD7.namprd02.prod.outlook.com (2603:10b6:208:36e:cafe::ae) by BLAPR05CA0011.outlook.office365.com (2603:10b6:208:36e::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9031.13 via Frontend Transport; Mon, 11 Aug 2025 14:59:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MN1PEPF0000ECD7.mail.protection.outlook.com (10.167.242.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9031.11 via Frontend Transport; Mon, 11 Aug 2025 14:59:52 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 11 Aug 2025 09:59:49 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 11 Aug 2025 09:59:49 -0500 Received: from xcosswyocto01.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Mon, 11 Aug 2025 09:59:49 -0500 From: Sandeep Gundlupet Raju To: , Subject: [meta-zephyr][scarthgap][PATCH v3 9/13] meta-zephyr: Update README files Date: Mon, 11 Aug 2025 08:59:37 -0600 Message-ID: <20250811145941.2553838-10-sandeep.gundlupet-raju@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250811145941.2553838-1-sandeep.gundlupet-raju@amd.com> References: <20250811145941.2553838-1-sandeep.gundlupet-raju@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD7:EE_|MN2PR12MB4472:EE_ X-MS-Office365-Filtering-Correlation-Id: b6040790-586a-46d3-0ff3-08ddd8e7b9ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026|13003099007; X-Microsoft-Antispam-Message-Info: jQh+XjWeXQ5mPeMuxIhZq9l18TlFqKflvBu4yFIwYtqFSliG1ibNqouIRZBD/nqunvzCK36Tp1tvQlz9rmu4FONTLBbQznWC4Uwk4riDOCJr+B/SM8rOyuF8IxKCLlkvvfnld/Z+ncwIcKBmeMW4nwtOcc3fL/kY+VEgKe2cEkRNbOf5neJEJ9CcNxQgk3Op+p/EFrL8a+QjO3CnTp5OgcybrgDCV2cYSYDtRoXjNVupxbcpWmDbGiXmYjD3ThhvokAUwQ7vyyUeMvB/wjlLI5Bg8p9B2W6erNvHHoyqidhM9wRSIRcpnvcP16zyMrvMBTeCFN3erPoIdcyXLCi5Q5GQhrZJatOGDlHUwbRp0d3f+urluy9eLHjWZXvjNpjhJLxWUduPHj2f5Zn66nHSvg5g6ZP9miQKzTxEybK744yWNNmPEOTqBkCFc789Wn6JSeSbG+1NWdgvdgyR7VN1UgxQsraZCPrKST6FbhPXlVZbuOu8hX75/VpYIPHWxqmHgQ5YgXN4H/SfDvD1R5cK8+Bo3/wPZTUjMw6d+NG3jsj3bwZsxrdWrkX2rIBTf8sEXl7tEI2Blfc4dUOuv8R7jhm2rRBQ/yJcFfBWgoOv/s6EgA8nsmBcPfnGggsHQWoenc01heov/lytf0csezi1zpYuRBaNHa6tTYZI+BHuz2iRIIY1/kXyVQGRoM8Met601/lJbcLhFjJEAoaE1Z9MG96yoUidnkgrAG73ZJ0IFX6fgFi9ANvTjAKjkF6/7s/j1TXoBywEgCXojLS3a/Tv1rgB9T8cKi96URSsFbUoQKC4D6UC5+cXJYzEzq6O47Gx4s1PcmNRjfOUWTtuh/2wNKcFhfknwbKEUeqfIzKVPKVBdJxfCHoCRc3ApdKP8yJS7gsREZDf7MgzLZaOX6gaprw7vaRLpiUq4SW9OnVKZK20NpjQE2Qck+QhJDIkOZyP7S19XVynAbCXglJudMQxGXSj49/VJg6+J/BiqbbLOGjX37tXfpZSB/VQChDgWUaFdOxc9ak7iYUEvmBIVJA75/skjpUdIf54tsBD+EybeRE4xDxjmbGpRcLYb7+gA8N1LoLGCQHmx2nqhIYXe8mxasamTZybdfPzIv+i+x60eWnyyFU/hBEHyslgeEx7PKwBSJt3KmMNzGhzTB152wN1oeX9KxY2CFgC6TKYagnLRp1p6vNkVQc+VAu/T5xgDHKL6MuqnJwMllfX0nsTEdJgWcprJ+2LkqrZugoWKBvkpIAN74ldvdIlgDHG85LTbhgIiwuVBB8QquA+6OdsQGc39htH0Vf8R12lTLPsqklyPYDsCT8D/4Jo7JuA13zAwmCsnasTzeG1wvZ0I/CeYsL4arF2o0tHkDzLqpQ5sruh0Ov++Z34XnODYwU4hsov3/ri1S9dVCPijQoQo2PrDlV2+xkhUKnUzvLT+TEXl4oV7+h4qHkAXUFCHSDLQ3SUK+vGxbJJrx7waVISXhXHlzzpXg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026)(13003099007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2025 14:59:52.1067 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6040790-586a-46d3-0ff3-08ddd8e7b9ba X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECD7.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4472 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 11 Aug 2025 15:00:17 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/1937 Update README files with following. - Build instructions - Maintainers lists and patch submission Signed-off-by: Sandeep Gundlupet Raju --- README.txt => README.md | 163 ++++++++++++++++++++++++------------ meta-zephyr-bsp/README.md | 5 ++ meta-zephyr-bsp/README.txt | 1 - meta-zephyr-core/README.md | 6 ++ meta-zephyr-core/README.txt | 1 - 5 files changed, 120 insertions(+), 56 deletions(-) rename README.txt => README.md (60%) create mode 100644 meta-zephyr-bsp/README.md delete mode 100644 meta-zephyr-bsp/README.txt create mode 100644 meta-zephyr-core/README.md delete mode 100644 meta-zephyr-core/README.txt diff --git a/README.txt b/README.md similarity index 60% rename from README.txt rename to README.md index d3694a6..16951b0 100644 --- a/README.txt +++ b/README.md @@ -1,71 +1,101 @@ -Building Zephyr Images via bitbake recipes -========================================== +# meta-zephyr -More detailed and up-to-date information can be found here: - -https://wiki.yoctoproject.org/wiki/TipsAndTricks/BuildingZephyrImages +This layer enables building Zephyr using Yocto Project. -Prerequisites: -============== +## Dependencies This layer depends on: - Yocto distro (master) - git://git.yoctoproject.org/poky - Python layer (meta-openembedded/meta-python) - git://git.openembedded.org/meta-openembedded -Add "meta-openembedded/meta-oe" to BBLAYERS -Add "meta-openembedded/meta-python" to BBLAYERS -Add "meta-zephyr-core" and "meta-zephyr-bsp" to BBLAYERS + URI: https://git.yoctoproject.org/poky + layers: meta, meta-poky + branch: scarthgap + + URI: https://git.openembedded.org/meta-openembedded + layers: meta-oe, meta-python + branch: scarthgap + +## Building Zephyr Images via bitbake recipes + +More detailed and up-to-date information can be found here: + +https://wiki.yoctoproject.org/wiki/TipsAndTricks/BuildingZephyrImages -Building and Running Zephyr Samples -=================================== +> **Pre-requisites:** +1. Refer [Yocto Project Quick Build]( https://docs.yoctoproject.org/dev/singleindex.html#yocto-project-quick-build) documentation. + +2. Clone and add following layers to BBLAYERS + * meta-openembedded/meta-oe + * meta-openembedded/meta-python + * meta-zephyr-core + * meta-zephyr-bsp +``` + $ mkdir sources + $ git clone -b https://git.yoctoproject.org/poky + $ git clone -b https://git.openembedded.org/meta-openembedded + $ git clone -b https://git.yoctoproject.org/meta-zephyr + $ source poky/oe-init-build-env + $ bitbake-layers add-layer ../meta-openembedded/meta-oe + $ bitbake-layers add-layer ../meta-openembedded/meta-python + $ bitbake-layers add-layer ../meta-zephyr/meta-zephyr-core + $ bitbake-layers add-layer ../meta-zephyr/meta-zephyr-bsp +``` + +### Building and Running Zephyr Samples You can build Zephyr samples. There are several sample recipes. To use the Yocto toolchain, modify local conf by adding: +``` DISTRO="zephyr" +``` To use the Zephyr pre-built toolchain, modify local conf by adding: +``` ZEPHYR_TOOLCHAIN_VARIANT = "zephyr" +``` For example, to build the Zephyr "philosophers" sample: - +``` $ MACHINE=qemu-x86 bitbake zephyr-philosophers - -You can then run the created "philosophers" image in qemu: +``` +You can then run the created "philosophers" image in qemu: +``` $ runqemu qemu-x86 - -The same sample, for ARM image: +``` +The same sample, for ARM image: +``` $ MACHINE=qemu-cortex-m3 bitbake zephyr-philosophers $ runqemu qemu-cortex-m3 - -The same sample, for Nios2 image: +``` +The same sample, for Nios2 image: +``` $ MACHINE=qemu-nios2 bitbake zephyr-philosophers $ runqemu qemu-nios2 +``` -Flashing -================================= +### Flashing You can flash Zephyr samples to boards. Currently, the following MACHINEs are supported: * DFU: - - arduino-101-sss - - arduino-101 - - arduino-101-ble + * arduino-101-sss + * arduino-101 + * arduino-101-ble * pyocd: - - 96b-nitrogen + * 96b-nitrogen To flash the example you built with command e.g. - +``` $ MACHINE=96b-nitrogen bitbake zephyr-philosophers +``` call similar command with explicit flash_usb command: - +``` $ MACHINE=96b-nitrogen bitbake zephyr-philosophers -c flash_usb +``` dfu-util and/or pyocd need to be installed in your system. If you observe permission errors or the flashing process seem to hang, follow those instructions: @@ -77,28 +107,31 @@ of IDs. Once that is set, the tool will only try to program these IDs. You can query for the IDs by running `pyocd list` on your host while having the probes attached. Besides setting this variable through the build's configuration or metadata, you can also inject its value from command line with something like: - +``` $ PYOCD_FLASH_IDS=' ' BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE PYOCD_FLASH_IDS" bitbake -c flash_usb +``` + +## Building and Running Zephyr Tests -Building and Running Zephyr Tests -================================= Presently only toolchains for ARM, x86, IAMCU and Nios2 are supported. (For ARM we use CortexM3 toolchain) To run Zephyr Test using Yocto Image Tests, ensure following in local.conf: - +``` INHERIT += "testimage" +``` You can build and test an individual existing Zephyr test. This is done by appending the actual test name to the "zephyr-kernel-test", for example: - +``` $ MACHINE=qemu-x86 bitbake zephyr-kernel-test-sleep $ MACHINE=qemu-x86 bitbake zephyr-kernel-test-sleep -c testimage +``` You can also build and run all Zephyr existing tests (as listed in the file zephyr-kernel-test.inc). For example: - +``` $ MACHINE=qemu-x86 bitbake zephyr-kernel-test-all $ MACHINE=qemu-x86 bitbake zephyr-kernel-test-all -c testimage or @@ -107,16 +140,17 @@ or or $ MACHINE=qemu-nios2 bitbake zephyr-kernel-test-all $ MACHINE=qemu-nios2 bitbake zephyr-kernel-test-all -c testimage - +``` + +## Generating OE Machines based on Zephyr board definitions -Generating OE Machines based on Zephyr board definitions -======================================================== We currently have a recipe called generate-zephry-machines which will go through and attempt to create an OE machine conf file for every board in Zephyr. This is run via: - +``` MACHINE=qemu-x86 bitbake generate-zephyr-machines +``` The output is then put in the normal deploy dir. This recipe is really only useful for maintainers. There is currently no way to use the Zephyr board @@ -125,14 +159,15 @@ you will need to run the above, copy the conf files from the deploy dir to the machine conf directory and then run your build. This shouldn't need to happen often. -Generating new Zephyr recipe versions -===================================== +## Generating new Zephyr recipe versions + The script meta-zephyr-core/scripts/generate-version.py is used to generate Yocto configuration for a Zephyr version from the West configuration in the Zephyr repository. It requires the west and jinja2 Python packages to be installed on the host. Run it as follows: - +``` $ ./meta-zephyr-core/scripts/generate-version.py x.x.x +``` where x.x.x is the Zephyr version. @@ -140,17 +175,37 @@ The patch files added to SRC_URI in the generated file should be validated and modified if required. The new version should be committed and submitted to the mailing list as -described in "Contributing". +described in "Maintainers, Mailing list, Patches". + +## Maintainers, Mailing list, Patches + +Please send any patches for this layer to the yocto-patches mailinglists +with ['meta-zephyr'] in the subject: + + yocto-patches@lists.yoctoproject.org + +When sending patches, please make sure the email subject line includes +`[meta-amd-edf][][PATCH]` and cc'ing the maintainers. + +For more details follow the Yocto Project community patch submission guidelines, +as described in: + +https://docs.yoctoproject.org/dev/contributor-guide/submit-changes.html# + +`git send-email --to yocto-patches@lists.yoctoproject.org *.patch` + +> **Note:** When creating patches, please use below format. To follow best practice, +> if you have more than one patch use `--cover-letter` option while generating the +> patches. Edit the 0000-cover-letter.patch and change the title and top of the +> body as appropriate. -Contributing -============ +**Syntax:** +`git format-patch -s --subject-prefix="meta-zephyr][][PATCH" -1` -Patches for meta-zephyr should be sent to the yocto-patches@lists.yoctoproject.org -mailing list. See https://lists.yoctoproject.org/g/yocto-patches for subscription -details and the list archive. Please add [meta-zephyr] to the subject so -the patches are identifable. +**Example:** +`git format-patch -s --subject-prefix="meta-zephyr][scarthgap][PATCH" -1` -Git can be configured to send mails appropriately when using git send-email: +**Maintainers:** -$ git config --local sendemail.to yocto-patches@lists.yoctoproject.org -$ git config --local format.subjectPrefix meta-zephyr][PATCH + Lee Chee Yang + Sandeep Gundlupet Raju diff --git a/meta-zephyr-bsp/README.md b/meta-zephyr-bsp/README.md new file mode 100644 index 0000000..e159015 --- /dev/null +++ b/meta-zephyr-bsp/README.md @@ -0,0 +1,5 @@ +# meta-zephyr-bsp + +This layer contains machine files for building Zephyr applications. + +For more details see [Building Instructions](../README.md) diff --git a/meta-zephyr-bsp/README.txt b/meta-zephyr-bsp/README.txt deleted file mode 100644 index 2644ed0..0000000 --- a/meta-zephyr-bsp/README.txt +++ /dev/null @@ -1 +0,0 @@ -See ../README.txt diff --git a/meta-zephyr-core/README.md b/meta-zephyr-core/README.md new file mode 100644 index 0000000..18db977 --- /dev/null +++ b/meta-zephyr-core/README.md @@ -0,0 +1,6 @@ +# meta-zephyr-core + +This layer enables Zephyr build metadata such as zephyr scripts, kernel include +files, zephyr applications recipes and bitbake class to support qemu boot. + +For more details see [Building Instructions](../README.md) diff --git a/meta-zephyr-core/README.txt b/meta-zephyr-core/README.txt deleted file mode 100644 index 2644ed0..0000000 --- a/meta-zephyr-core/README.txt +++ /dev/null @@ -1 +0,0 @@ -See ../README.txt