> For the complete documentation index, see [llms.txt](https://explore-vineeth.gitbook.io/mywiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://explore-vineeth.gitbook.io/mywiki/programming/yocto/sdk.md).

# SDK

Yocto builds SDK to develop applications.  bitbake builds sdk. Copy SDK and install on any location&#x20;

This flow is on Xilinx/AMD yocto layers ( meta-xilinx and metal-petalinux)

## Build SDK

### Yocto

Follow <https://github.com/Xilinx/yocto-manifests/blob/rel-v2022.2/README.md>

`bitbake petalinux-image-minimal -c do_populate_sdk`<br>

### Petalinux

* Get petalinux tool and any bsp&#x20;
* `petalinux-build -c petalinux-image-minimal -x do_populate_sdk`

### Install SDK

Once the build is success, you can find sdk at \
**build/tmp/deploy/sdk/petalinux-glibc-x86\_64-petalinux-image-minimal-\*.sh**

Install the sdk using \
`./petalinux-glibc*.sh -y -p -d <path to dir>`

### SDK Usage

source the sdk and see the tool chain from sdk path.\
. \<path to sdk./environment-setup-\*

Verify the installation\ <mark style="color:purple;">which aarch64-xilinx-linux-gcc</mark>\ <mark style="color:blue;">\<path</mark>*<mark style="color:blue;">to</mark>*<mark style="color:blue;">sdk>/sysroots/x86\_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-gcc</mark>

#### Add Packages&#x20;

Add nativesdk packages into sysroot. Add below details in the image bb recipe<br>

**Add utils under corresponding ARCH**\
`TOOLCHAIN_TARGET_TASK ?= ""`

**To add utilities under X86\_64**\
`TOOLCHAIN_HOST_TASK ?= "`\
`nativesdk-sdk-provides-dummy`\
`nativesdk-python3-core`\
`nativesdk-python3-modules`\
`nativesdk-python3-misc "`<br>
