This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM-Q1: Building Arago for BeagleBone-AI64

Part Number: TDA4VM-Q1
Other Parts Discussed in Thread: TDA4VM

Tool/software:

Hi,

Is it possible to build Arago for BB-AI64, targeting Processor SDK version 10.01?

I've tried a few dead ends, for example:

git clone git.ti.com/.../oe-layersetup.git tisdk
cd tisdk
./oe-layertool-setup.sh -f configs/processor-sdk-analytics/processor-sdk-analytics-10.01.00-config.txt
cd build
echo 'MACHINE = "beaglebone-ai64"' >> conf/local.conf
source conf/setenv
bitbake -k tisdk-tiny-image

I also tried repeating the above but with:

echo 'TI_PREFERRED_BSP = "ti-6_6"' >> conf/local.conf

Instead of digging into details of the above or why it did not work (arbitrary choices by me, could be wrong) - let's focus on how it's supposed to be built. Apparently you can specify MACHINE=beaglebone-ai64 so how is that supposed to work? What's the minimal reproducible steps to generate an image that can be flashed to an SD card and that can boot Linux on the BB-AI64?

Side question: I used the -analytics flavor, that's just something I used with TDA4 before, but it's not a requirement, perhaps -linux would be better? What is the difference? (If this is stated somewhere in more precise manners than "with analytics tools", please let me know, I've been looking for it.)

Thanks,

Joel

  • Hi Joel,

    Support for Arago on the BeagleBone-AI64, is a community driven project, and we don't do testing or validation of the images for the BB-AI64. It should work, however; do you have any error logs?

    Is there a reason you want Arago on the BB-AI64 instead of the Beagle provided Debian image?

    Side question: I used the -analytics flavor, that's just something I used with TDA4 before, but it's not a requirement, perhaps -linux would be better? What is the difference? (If this is stated somewhere in more precise manners than "with analytics tools", please let me know, I've been looking for it.)

    The analytics configurations bring support for running vision applications on the DSPs and accelerators. Using the "linux" configuration would just provide an image with Linux and GPU support.

    Best,
    Jared

  • Hi Jared,

    I see. Even if community supported - do you know of anywhere I can find information on how to build it, or where I can ask questions about it?

    The thing is, I require tidl/tiovx to work. But perhaps I can build that separately for the BeagleBone Debian?

    BR,

    Joel

  • Hi Joel,

    I see. Even if community supported - do you know of anywhere I can find information on how to build it, or where I can ask questions about it?

    You can ask within the Beagle discord/forum. I can help you with some simple debugging, but I don't have a BB-AI64.

    It should work, however; do you have any error logs?

    As I stated before, the image should work on the BB-AI64, but do you have any error logs?

    The thing is, I require tidl/tiovx to work. But perhaps I can build that separately for the BeagleBone Debian?

    Support for tidl/tiovx is almost nonexistent for Debian. You'll likely have to adapt an Arago image to the board.

    Best,
    Jared

  • Hi Jared,

    Ok, thanks for the help! Do I need the -analytics version for tidl/tiovx or does the -linux version work equally well? Maybe I will have more success with -linux, assuming it supports my use case.

    The errors are a bit different between builds. Some patches that have slightly changed or missing symlinks, those I fixed. My guess being that bb.org runs 6.12 kernels and that's too new for PSDK 10.01 (?)

    For TI_PREFERRED_BSP=ti-6_6 I for example get:

    tisdk/build/arago-tmp-default-glibc/work/beaglebone_ai64-oe-linux/u-boot-ti-staging/2024.04+git/git/arch/arm/mach-k3/arm64-mmu.c:320:29: error: 'soc_mem_map' undeclared here (not in a function); did you mean 'k3_mem_map'?
    |   320 | struct mm_region *mem_map = soc_mem_map;

    I think that's related to a memory map patch that I saw being applied (edit: meta-edgeai/recipes-bsp/u-boot has some device tree changes but I also remember seeing a C code patch for this somewhere).

    Without TI_PREFERRED_BSP (which I think defaults to BB Debian?) it just won't boot - no error message. I think this may have to do with UEFI - I have been able to hack together booting systems without UEFI by copying files here and there (syslinux-based). I tried removing efi support from the MACHINE but it did not work, I assume arago does not support that anymore with the rest of the rootfs? This could very well be a dead end though, not on the Arago track we should be heading on.

    There is one odd thing I've had to do, and that is to replace tispl.bin, sysfw.itb and tiboot3.bin to the (quite old) files that came with the BB-AI64 eMMC. Otherwise it wouldn't boot, complaining about DDR memory training failing. Do you think this is related - maybe I have to rebuild those but with a new config for the memory training?

    I feel that it's easy to become side tracked and try solving the wrong problem. I would like to make a bet on the best of the following parameters, before trying to resolve any problems, but I need your help on which one would be the most compatible:

    -linux/-analytics, TI_PREFERRED_BSP (and thus kernel BRANCH), MACHINE support for efi, which image to build (maybe tisdk-tiny-image is not optimal), any other?

    Which combination do you think will see the most success?

    Thanks & BR,

    Joel

  • Hi Joel,

    Ok, thanks for the help! Do I need the -analytics version for tidl/tiovx or does the -linux version work equally well? Maybe I will have more success with -linux, assuming it supports my use case.

    You would need the analytics version of tidl/tiovx.

    The errors are a bit different between builds. Some patches that have slightly changed or missing symlinks, those I fixed. My guess being that bb.org runs 6.12 kernels and that's too new for PSDK 10.01 (?)

    PSDK 10.01 supports kernel 6.6. PSDK 11.0 will support 6.12.

    -linux/-analytics, TI_PREFERRED_BSP (and thus kernel BRANCH), MACHINE support for efi, which image to build (maybe tisdk-tiny-image is not optimal), any other?

    tisdk-tiny-image will not have any support for tidl/tiovx. It is as bare bones as possible.

    Which combination do you think will see the most success?

    Can you try building the tisdk-analytics-image or the tisdk-edgeai-image with the MACHINE set to the bbai64?

    Best,
    Jared

  • Hi Jared,

    Just
    MACHINE=beaglebone-ai64 bitbake tisdk-edgeai-image
    for example? And not setting TI_PREFERRED_BSP?
    BR,
    Joel
  • I'll run the full build during the night, it takes quite a few hours on my laptop, but I just wanted to report on some partial success playing around with the build system (maybe this is useful for someone else finding this thread). I managed to build and boot tisdk-tiny-image with the following in conf/local.conf:

    MACHINE = "beaglebone-ai64"
    TI_PREFERRED_BSP = "ti-6_6"
    IMAGE_SR1_1_HS_FS_FILES:bsp-ti-6_6 = ""
    IMAGE_SR1_1_HS_SE_FILES:bsp-ti-6_6 = ""
    IMAGE_SR2_HS_FS_FILES:bsp-ti-6_6 = ""
    IMAGE_SR2_HS_SE_FILES:bsp-ti-6_6 = ""

    I also had to do the symlink trick (ln -s j721e-evm beaglebone-ai64) mentioned above and also change (devtool modify u-boot-ti-staging) some u-boot memory map (which I'm a bit worried it's incorrect considering the edgeai memory map paches - but this was just a test):

    diff --git a/arch/arm/mach-k3/arm64-mmu.c b/arch/arm/mach-k3/arm64-mmu.c
    index 07edbde64ad..ac7f0764c62 100644
    --- a/arch/arm/mach-k3/arm64-mmu.c
    +++ b/arch/arm/mach-k3/arm64-mmu.c
    @@ -53,7 +53,7 @@ struct mm_region k3_mem_map[] = {
     
     #ifdef CONFIG_SOC_K3_J721E
     
    -#ifdef CONFIG_TARGET_J721E_A72_EVM
    +#if defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J721E_A72_BEAGLEBONEAI64)
     /* NR_DRAM_BANKS + 32bit IO + 64bit IO + terminator */
     #define NR_MMU_REGIONS (CONFIG_NR_DRAM_BANKS + 6)

  • Hi Joel,

    for example? And not setting TI_PREFERRED_BSP?

    I see what you mean. You likely have to set it. I never have to set it because I build for images for TI EVMs.

    You might want to look at the ti-bsp.inc and see the deltas between the beaglebone-ai64.conf.

    Another possible (albeit hacky) solution could be to take the TDA4VM adas/edgeai image and switch the DTS to the BB-AI64 DTS.

    Best,
    Jared

  • Hi Jared,

    I finally got this to build and boot. Fixes needed:

    ln -s j721e-evm sources/meta-edgeai/recipes-kernel/linux/linux-ti-staging/beaglebone-ai64

    devtool modify u-boot-ti-staging + apply the patch above to load the correct MMU setup.

    The following in conf/local.conf and then build tisdk-edgeai-image

    MACHINE = "beaglebone-ai64"
    TI_PREFERRED_BSP = "ti-6_6"
    ARAGO_BRAND = "edgeai"
    IMAGE_SR1_1_HS_FS_FILES:bsp-ti-6_6 = ""
    IMAGE_SR1_1_HS_SE_FILES:bsp-ti-6_6 = ""
    IMAGE_SR2_HS_FS_FILES:bsp-ti-6_6 = ""
    IMAGE_SR2_HS_SE_FILES:bsp-ti-6_6 = ""
    WKS_FILE:edgeai = "sdimage-2part-efi.wks.in"

    IMAGE_SR* - I'm unsure of these, apparently the -GP version gets copied. Is this a trait of the hardware or more like how you run it (security model?)?

    ARAGO_BRAND sets :edgeai, which is needed so that the correct FW_DIR gets applied.

    tisdk-edgeai-image.bb makes a hard assignment of WKS_FILE = "tisdk-edgeai-sdimage.wks", I'm not sure how this is supposed to work when MACHINE_FEATURES contains "efi, or even without as I don't think the rootfs supports non-efi boots anymore? I set it explicitly in my conf, (ab)using the :edgeai override as it would otherwise not "take" since not using ?= in the .bb file. If you know of any way of skipping EFI I'm up for it - how does this work on the TDA4-SK, or does it actually work in PSDK 10.01?

    The rest of the problems was due to my CPU overheating and randomly misbehaving. I'll move the whole thing to our build server next week, which is actually up to the task, my old laptop is clearly not.... (We do have a CI server that builds images from earlier PSDK versions, with for example a layer that uses a custom .wic file without EFI in similar veins as tisdk-edgeai-image.bb/tisdk-edgeai-sdimage.wks, so if it's possible to skip EFI I would be happy to know how.)

    Have a nice weekend!

    BR,

    Joel

  • Hi Joel,

    That's good to hear. For removing UEFI, I assume you would just need to edit the U-Boot .config/defconfig. Essentially, do the opposite of what this documentation says: https://docs.u-boot.org/en/latest/develop/uefi/uefi.html 

    Best,
    Jared