Real-time Edge Yocto Build Instructions Failure

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Real-time Edge Yocto Build Instructions Failure

Jump to solution
888 Views
stmatscaps
Contributor III

From the "Real-time Edge Yocto Project User Guide" section "8 Building packages based on i.MX Yocto release" I understand that it is possible to add Real-Time Edge to an existing Yocto build. I'm interested in the real-time features and the abilty to run a bare-metal application on an A53 core of an i.MX 8M Nano chip along with Linux on the other cores.

When I reproduce the instructions in section 8 of the "Real-time Edge Yocto Project User Guide" I do not get a working build. The build fails more or less immediately with the following error messages:

$ bitbake core-image-minimal
NOTE: Your conf/bblayers.conf has been automatically updated.
WARNING: You are running bitbake under WSLv2, this works properly but you should optimize your VHDX file eventually to avoid running out of storage space
Loading cache: 100% |                                                                                   | ETA:  --:--:--
Loaded 0 entries from dependency cache.
WARNING: /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb: Exception during build_dependencies for do_kernel_checkout
WARNING: /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb: Error during finalise of /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb
ERROR: ExpansionError during parsing /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb
Traceback (most recent call last):
  File "Var <do_kernel_checkout>", line 1, in <module>
  File "/home/stm/src/imx-yocto-bsp/sources/poky/meta/classes-recipe/kernel-yocto.bbclass", line 86, in get_machine_branch(d=<bb.data_smart.DataSmart object at 0x7ff1bdf4f280>, default='master'):
     def get_machine_branch(d, default):
    >    fetch = bb.fetch2.Fetch([], d)
         for url in fetch.urls:
  File "/home/stm/src/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1687, in Fetch.__init__(urls=['${KERNEL_SRC}'], d=<bb.data_smart.DataSmart object at 0x7ff1bdf4f280>, cache=True, localonly=False, connection_cache=None):
                     try:
    >                    self.ud[url] = FetchData(url, d, localonly)
                     except NonLocalMethod:
  File "/home/stm/src/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1274, in FetchData.__init__(url='${KERNEL_SRC}', d=<bb.data_smart.DataSmart object at 0x7ff1bdf4f280>, localonly=False):
             self.basepath = None
    >        (self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(d.expand(url))
             self.date = self.getSRCDate(d)
  File "/home/stm/src/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 357, in decodeurl(url='${KERNEL_SRC}'):
         if not m:
    >        raise MalformedUrl(url)

bb.data_smart.ExpansionError: Failure expanding variable do_kernel_checkout, expression was     set +e

        source_dir=`echo //git | sed 's%/$%%'`
        source_workdir="//git"
        if [ -d "//git/" ]; then
                # case: git repository
                # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree.
                if [ "${source_dir}" != "${source_workdir}" ]; then
                        if [ -d "${source_workdir}/.git" ]; then
                                # regular git repository with .git
                                rm -rf //git
                                mv //git //git
                        else
                                # create source for bare cloned git repository
                                git clone //git //git
                                rm -rf //git
                        fi
                fi
                cd //git

                # convert any remote branches to local tracking ones
                for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do
                        b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`;
                        git show-ref --quiet --verify -- "refs/heads/$b"
                        if [ $? -ne 0 ]; then
                                git branch $b $i > /dev/null
                        fi
                done

                # Create a working tree copy of the kernel by checking out a branch
                machine_branch="${@ get_machine_branch(d, "master" )}"

                # checkout and clobber any unimportant files
                git checkout -f ${machine_branch}
        else
                # case: we have no git repository at all.
                # To support low bandwidth options for building the kernel, we'll just
                # convert the tree to a git repo and let the rest of the process work unchanged

                # if //git hasn't been set to the proper subdirectory a default of "linux" is
                # used, but we can't initialize that empty directory. So check it and throw a
                # clear error

                cd //git
                if [ ! -f "Makefile" ]; then
                        bberror "S is not set to the linux source directory. Check "
                        bbfatal "the recipe and set S to the proper extracted subdirectory"
                fi
                rm -f .gitignore
                git init
                check_git_config
                git add .
                git commit -q -m "baseline commit: creating repo for no-pn-0.0-1"
                git clean -d -f
        fi

        set -e
 which triggered exception MalformedUrl: The URL: '${KERNEL_SRC}' is invalid and cannot be interpreted
The variable dependency chain for the failure is: do_kernel_checkout

ERROR: Parsing halted due to errors, see error messages above

What is wrong with the instructions in the "Real-time Edge Yocto Project User Guide" and how can I set up a working build?

And is it possible in general to use Real-Time Edge with an i.MX 8M Nano chip?

 

Tags (1)
0 Kudos
1 Solution
479 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Please find the dynamic-layers/imx-layer/recipes-kernel/linux/linux-imx_%.bbappend

Modify SRC_URI = "${KERNEL_SRC}" to SRC_URI:real-time-edge = "${KERNEL_SRC}"

View solution in original post

0 Kudos
11 Replies
480 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Please find the dynamic-layers/imx-layer/recipes-kernel/linux/linux-imx_%.bbappend

Modify SRC_URI = "${KERNEL_SRC}" to SRC_URI:real-time-edge = "${KERNEL_SRC}"

0 Kudos
395 Views
stmatscaps
Contributor III

Hi @Zhiming_Liu ,

thanks for this information, with that change I was now able to build the Real-Time Edge image.

0 Kudos
855 Views
brian14
NXP TechSupport
NXP TechSupport

Hi @stmatscaps

Thank you for contacting NXP Support.

Based on the Real-Time Edge Yocto Project User Guide, this layer is unsupported for the i.MX8M Nano.

Have a great day!

0 Kudos
824 Views
stmatscaps
Contributor III

Hi @brian14 ,

I'm aware that the i.MX8M Nano is not officially supported by NXP out-of-the-box, but is there something that makes it impossible in general to use Real-Time Edge with i.MX8M Nano chips? It is clear to me that I would have to make the necessary modifications to the Real-Time Edge myself for a custom board with the i.MX8M Nano chip.

Regarding the build failure that I reported, I should have included the information that I did strictly follow the instructions in section "8 Building packages based on i.MX Yocto release" of the "Real-time Edge Yocto Project User Guide" for one of the officially supported boards. The command line to set up the build was:

"DISTRO=nxp-real-time-edge MACHINE=imx8mp-lpddr4-evk source imx-setup-release.sh -b build-real-time-edge"

I would expect that when building for one of the officialy supported machine types the build should succeed with the provided instructions.

0 Kudos
815 Views
brian14
NXP TechSupport
NXP TechSupport

Hi @stmatscaps

Based on the Real-Time Edge Yocto Project User Guide section 8.3 Building the image you need to start building the image using the command:

$ bitbake imx-image-multimedia

Please try with this command and tell me if it works.

Have a great day!

0 Kudos
800 Views
stmatscaps
Contributor III

Hi @brian14 ,

could you please also answer the question whether Real-Time Edge can work in general on i.MX 8M Nano chips, even if this is not officially supported by NXP currently? If it doesn't work in general, please point out the concrete missing features in the i.MX 8M Nano chip hardware-wise that make it impossible to use Real-Time Edge.

Regarding the build, I tried to build with "bitbake imx-image-multimedia", and this results in the same build error as with "bitbake core-image-minimal":

 

 

$ DISTRO=fsl-imx-wayland MACHINE=imx8mp-lpddr4-evk source imx-setup-release.sh -b
build-real-time-edge

 Build directory is  build-real-time-edge

Some BSPs depend on libraries and packages which are covered by NXP's
End User License Agreement (EULA). To have the right to use these binaries in
your images, you need to read and accept the following...

<...long EULA text removed ...>

Welcome to Freescale Community BSP

The Yocto Project has extensive documentation about OE including a
reference manual which can be found at:
    http://yoctoproject.org/documentation

For more information about OpenEmbedded see their website:
    http://www.openembedded.org/

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support

Your build environment has been configured with:

    MACHINE=imx8mp-lpddr4-evk
    SDKMACHINE=i686
    DISTRO=fsl-imx-wayland
    EULA=
BSPDIR=
BUILD_DIR=.
meta-freescale directory found
$ vi conf/bblayers.conf
# <... edited conf/bblayers.conf according to the instructions ...>
$ bitbake imx-image-multimedia
NOTE: Your conf/bblayers.conf has been automatically updated.
WARNING: You are running bitbake under WSLv2, this works properly but you should optimize your VHDX file eventually to avoid running out of storage space
Loading cache: 100% |                                                                                   | ETA:  --:--:--
Loaded 0 entries from dependency cache.
WARNING: /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb: Exception during build_dependencies for do_kernel_checkout
WARNING: /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb: Error during finalise of /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb
ERROR: ExpansionError during parsing /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb
Traceback (most recent call last):
  File "Var <do_kernel_checkout>", line 1, in <module>
  File "/home/stm/src/imx-yocto-bsp/sources/poky/meta/classes-recipe/kernel-yocto.bbclass", line 86, in get_machine_branch(d=<bb.data_smart.DataSmart object at 0x7f015dc9faf0>, default='master'):
     def get_machine_branch(d, default):
    >    fetch = bb.fetch2.Fetch([], d)
         for url in fetch.urls:
  File "/home/stm/src/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1687, in Fetch.__init__(urls=['${KERNEL_SRC}'], d=<bb.data_smart.DataSmart object at 0x7f015dc9faf0>, cache=True, localonly=False, connection_cache=None):
                     try:
    >                    self.ud[url] = FetchData(url, d, localonly)
                     except NonLocalMethod:
  File "/home/stm/src/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1274, in FetchData.__init__(url='${KERNEL_SRC}', d=<bb.data_smart.DataSmart object at 0x7f015dc9faf0>, localonly=False):
             self.basepath = None
    >        (self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(d.expand(url))
             self.date = self.getSRCDate(d)
  File "/home/stm/src/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 357, in decodeurl(url='${KERNEL_SRC}'):
         if not m:
    >        raise MalformedUrl(url)

bb.data_smart.ExpansionError: Failure expanding variable do_kernel_checkout, expression was     set +e

        source_dir=`echo //git | sed 's%/$%%'`
        source_workdir="//git"
        if [ -d "//git/" ]; then
                # case: git repository
                # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree.
                if [ "${source_dir}" != "${source_workdir}" ]; then
                        if [ -d "${source_workdir}/.git" ]; then
                                # regular git repository with .git
                                rm -rf //git
                                mv //git //git
                        else
                                # create source for bare cloned git repository
                                git clone //git //git
                                rm -rf //git
                        fi
                fi
                cd //git

                # convert any remote branches to local tracking ones
                for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do
                        b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`;
                        git show-ref --quiet --verify -- "refs/heads/$b"
                        if [ $? -ne 0 ]; then
                                git branch $b $i > /dev/null
                        fi
                done

                # Create a working tree copy of the kernel by checking out a branch
                machine_branch="${@ get_machine_branch(d, "master" )}"

                # checkout and clobber any unimportant files
                git checkout -f ${machine_branch}
        else
                # case: we have no git repository at all.
                # To support low bandwidth options for building the kernel, we'll just
                # convert the tree to a git repo and let the rest of the process work unchanged

                # if //git hasn't been set to the proper subdirectory a default of "linux" is
                # used, but we can't initialize that empty directory. So check it and throw a
                # clear error

                cd //git
                if [ ! -f "Makefile" ]; then
                        bberror "S is not set to the linux source directory. Check "
                        bbfatal "the recipe and set S to the proper extracted subdirectory"
                fi
                rm -f .gitignore
                git init
                check_git_config
                git add .
                git commit -q -m "baseline commit: creating repo for no-pn-0.0-1"
                git clean -d -f
        fi

        set -e
 which triggered exception MalformedUrl: The URL: '${KERNEL_SRC}' is invalid and cannot be interpreted
The variable dependency chain for the failure is: do_kernel_checkout

ERROR: Parsing halted due to errors, see error messages above

Summary: There were 3 WARNING messages.
Summary: There were 2 ERROR messages, returning a non-zero exit code.

 

 

 

 

0 Kudos
793 Views
brian14
NXP TechSupport
NXP TechSupport

Hi @stmatscaps

Regarding using the i.MX8M Nano, unfortunately I don't have the exact information about why is not supported.

I tried to build the image using the Real-Time Edge Yocto Project User's Guide section 8 and I can confirm the issue with the Real Time Edge Software v2.7.
However, I tried with the Real Time Edge Software v2.6 and Linux BSP version LF6.1.36 and I was able to build the image successfully.
I'm reviewing with the team how to fix this issue. In the meantime, you can try using the same instructions but, in the step, related to clone the meta-real-time-edge use the following command:

git clone https://github.com/nxp-real-time-edge-sw/meta-real-time-edge.git -b Real-Time-Edge-v2.6-202307

Please try and tell me if it works.

Have a great day!

0 Kudos
747 Views
stmatscaps
Contributor III

Hello @brian14 ,

I tried the build as suggested with the following command to clone the meta-real-time-edge repository:

git clone https://github.com/nxp-real-time-edge-sw/meta-real-time-edge.git -b Real-Time-Edge-v2.6-202307

Unfortunately I'm getting exactly the same error as before:

$ bitbake imx-image-multimedia
NOTE: Your conf/bblayers.conf has been automatically updated.
WARNING: You are running bitbake under WSLv2, this works properly but you should optimize your VHDX file eventually to avoid running out of storage space
Loading cache: 100% |                                                                                   | ETA:  --:--:--
Loaded 0 entries from dependency cache.
WARNING: /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb: Exception during build_dependencies for do_kernel_checkout
WARNING: /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb: Error during finalise of /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb
ERROR: ExpansionError during parsing /home/stm/src/imx-yocto-bsp/sources/meta-freescale/recipes-kernel/linux/linux-imx_6.1.bb
Traceback (most recent call last):
  File "Var <do_kernel_checkout>", line 1, in <module>
  File "/home/stm/src/imx-yocto-bsp/sources/poky/meta/classes-recipe/kernel-yocto.bbclass", line 86, in get_machine_branch(d=<bb.data_smart.DataSmart object at 0x7f79932e2be0>, default='master'):
     def get_machine_branch(d, default):
    >    fetch = bb.fetch2.Fetch([], d)
         for url in fetch.urls:
  File "/home/stm/src/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1687, in Fetch.__init__(urls=['${KERNEL_SRC}'], d=<bb.data_smart.DataSmart object at 0x7f79932e2be0>, cache=True, localonly=False, connection_cache=None):
                     try:
    >                    self.ud[url] = FetchData(url, d, localonly)
                     except NonLocalMethod:
  File "/home/stm/src/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1274, in FetchData.__init__(url='${KERNEL_SRC}', d=<bb.data_smart.DataSmart object at 0x7f79932e2be0>, localonly=False):
             self.basepath = None
    >        (self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(d.expand(url))
             self.date = self.getSRCDate(d)
  File "/home/stm/src/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 357, in decodeurl(url='${KERNEL_SRC}'):
         if not m:
    >        raise MalformedUrl(url)

bb.data_smart.ExpansionError: Failure expanding variable do_kernel_checkout, expression was     set +e

        source_dir=`echo //git | sed 's%/$%%'`
        source_workdir="//git"
        if [ -d "//git/" ]; then
                # case: git repository
                # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree.
                if [ "${source_dir}" != "${source_workdir}" ]; then
                        if [ -d "${source_workdir}/.git" ]; then
                                # regular git repository with .git
                                rm -rf //git
                                mv //git //git
                        else
                                # create source for bare cloned git repository
                                git clone //git //git
                                rm -rf //git
                        fi
                fi
                cd //git

                # convert any remote branches to local tracking ones
                for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do
                        b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`;
                        git show-ref --quiet --verify -- "refs/heads/$b"
                        if [ $? -ne 0 ]; then
                                git branch $b $i > /dev/null
                        fi
                done

                # Create a working tree copy of the kernel by checking out a branch
                machine_branch="${@ get_machine_branch(d, "master" )}"

                # checkout and clobber any unimportant files
                git checkout -f ${machine_branch}
        else
                # case: we have no git repository at all.
                # To support low bandwidth options for building the kernel, we'll just
                # convert the tree to a git repo and let the rest of the process work unchanged

                # if //git hasn't been set to the proper subdirectory a default of "linux" is
                # used, but we can't initialize that empty directory. So check it and throw a
                # clear error

                cd //git
                if [ ! -f "Makefile" ]; then
                        bberror "S is not set to the linux source directory. Check "
                        bbfatal "the recipe and set S to the proper extracted subdirectory"
                fi
                rm -f .gitignore
                git init
                check_git_config
                git add .
                git commit -q -m "baseline commit: creating repo for no-pn-0.0-1"
                git clean -d -f
        fi

        set -e
 which triggered exception MalformedUrl: The URL: '${KERNEL_SRC}' is invalid and cannot be interpreted
The variable dependency chain for the failure is: do_kernel_checkout

ERROR: Parsing halted due to errors, see error messages above
0 Kudos
660 Views
brian14
NXP TechSupport
NXP TechSupport

Hi @stmatscaps

I noticed that you are using WSL please have a look to the requirements described in Real-time Edge Yocto Project User Guide (nxp.com) chapter 3 Host-Setup.

0 Kudos
605 Views
stmatscaps
Contributor III

Hi @brian14 ,

yes it is correct that I'm building under WSL. I followed all the requirements in chapter "3 Host setup" in the "Real-time Edge Yocto Project User Guide" document, but I found no WSL-specific instructions there. I'm also building a normal NXP Yocto distribution in the same WSL environment without any problems since quite a while.

0 Kudos
784 Views
stmatscaps
Contributor III

Hello @brian14 ,

thanks for your research regarding the workaround for the build failure. I will try that at the beginning of next week, as I'm currently busy with something else.

Regarding the i.MX 8M Nano not being supported, I understand that it may not be possible to officially support Real-Time Edge for all NXP i.MX chips. But it would be helpful if NXP documents what the necessary steps are to create a custom layer for a CPU that is not officially supported out of the box. As Real-Time Edge support the i.MX 8M Mini and i.MX 8M Plus CPUs which are very similar to the i.MX 7M Nano CPU I don't see anything fundamental that would make it impossible to run Real-Time Edge on that CPU.

0 Kudos