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.

PROCESSOR-SDK-AM65X: Buildroot support

Part Number: PROCESSOR-SDK-AM65X

Hello Forum members!

I'm working for a client developing a new AM6458-based design using the TI Processor SDK for Linux.  We are currently using 06.00.00.07, which I believe is the latest SDK code.

My client would like to use Buildroot to create a cross-compilation toolchain, bootloader (U-Boot), root filesystem (ext4), and Linux kernel.  Eventually they would like to add their own applications and tools to the Buildroot output as well.  They have used Buildroot in the past with other TI Sitara processors with good results, and like the simplicity and relative speed that Buildroot offers.

After a _lot_ of work with our local FAE, we were able to get a U-Boot image and Linux image built, copy it onto an uSD card using the create-sdcard.sh provided in the SDK, and got to a Linux login prompt.  I should also mention that this new design uses LPDDR4, and that was the source of some significant pain, including updates to the provided DRAM driver and special .dtsi configuration for the LPDDR4 that is being used.  Fantastic support.

With that said, my client does not want to check in the whole SDK with its cross-compilers, U-Boot source, Linux source, etc.  Instead, they would like to use Buildroot, which is an open-source project aimed at creating the above-mentioned components using a simple board configuration file and the ubiquitous 'make' utility.  The whole thing will be done using a "br2-external" tree, which essentially means that there is an "overlay" that contains all of our board-specific stuff.  The plan is to install a specific version of Buildroot at the same level as our overlay, and then run something like:

make BR2_EXTERNAL=<path_to_our_overlay> our_defconfig

make menuconfig # To configure what we want to create

make savedefconfig # To save our configuration back in our_defconfig

make # To make all of our tools, U-Boot, Linux, and rootfs

Then we would take the resulting binaries and Image file and directly copy it onto a uSD card using the "dd" utility.  We would end up with a boot partition and a rootfs partition on the uSD card.  Only the overlay and configuration, along with any specific project executables would need to be checked into version control.  Buildroot itself would not be in version control - just downloaded and put adjacent to our overlay.

Has anyone gone through getting Buildroot to do this for the AM65X?  If so, can you provide any advice on how configure Buildroot to get it to work?

One problem I see is that U-Boot for the AM65X apparently requires both a 32-bit compiler for the R5 core, and a 64-bit compiler for the A53 core.  Both cores are involved in the U-Boot execution.  This means two separate toolchains (which are provided by the SDK if you build things from what TI provides).  However, it appears that Buildroot will only create a single toolchain based on a specific architecture (e.g. 64-bit AARCH64).  I do not know how Buildroot can be make to create a second toolchain (e.g. 32-bit ARM), or how to control which pieces get built by each toolchain.

Further, it seems like the U-Boot sources and Linux kernel sources have specific nuances and drivers for the AM65X.  Letting Buildroot pull all of the "stock" code down from websites or repositories does not seem like it will work.  I'm thinking specifically of the modified DRAM driver that was required to get the LPDDR4 to work, but there may be other differences, too.  I confess that I just don't know.

I still consider myself a novice with U-Boot, embedded Linux, and definitely with Buildroot, and to this point have managed to get something working through the SDK only with TI's excellent FAE support.

Is anyone else out there using Buildroot for the AM65X, and if so, is what we are trying to accomplish even feasible with Buildroot instead of TI's (Yocto-based) SDK?

Any advice is welcomed.  If I can clarify anything further, please let me know.  There is significant time pressure, and if this is not feasible, I'd like to be able to intelligently explain why to my client.

Thanks for listening, and I appreciate any help/advice you can provide.

Scott

  • Hi,

    I am glad to hear that you got something working. Unfortunately we are not Buildroot experts so we are not able to provide any help on if this is a viable path or not for your development. I can only make some comments/observations that hopefully help.

    - I don't know of any other users of the AM65x having used Buildroot, perhaps somebody else besides TI could comment here in this forum.

    - With the different toolchains for the R5 and A53 could you define a dependent processor or have two different projects for U-Boot that build independently of each other?

    - Could you go into more detail why pulling down the source code from the different sites may not work? Which stock code are you referring to?

    - Please note using toolchains other than what is provided in the SDK that were used to build TI U-Boot and Kernel may have an issue with building the executable images. I am probably not following Buildroot methodology you described but please note regarding toolchains having access to a previous version might be helpful in case an older source tree being compiled with a later toolchain has shown issues in the past too.

    - Modifications such as LPDDR4 that were provided by TI should be available in future TI SDKs or repositories. This is also something to be aware of as the software for the processors matures. Developers should track the TI SDK releases looking at the release notes and perhaps trying out the latest kernel as this will pick up any fixes from the community and TI for the kernel.

    - Could you use a hydrid approach such as use Buildroot for the filesystem and the TI make all command to build the images for U-Boot and the Kernel?

    Best Regards,

    Schuyler 

  • Hi Schuler,

    Thanks very much for your reply.  Let me address your comments point by point.

    - I assume that most AM65x users are using the Yocto-based SDK, not Buildroot, but also hope that someone else out there is trying to implement a lighter-weight build system with Buildroot.

    - Buildroot seems to be set up to only support a single toolchain (e.g. AArch64 or ARM (32-bit)). To build U-Boot with two separate toolchains, it seems like we would need to have two separate copies of Buildroot, each configured differently, and then some post-build script to pick the R5/A53 pieces from the output.  This may work, but seems very cumbersome.  Worth more thought, though.

    - The "stock" code I was referring to is the U-Boot code provided by the current TI SDK (06.00.00.07).  Since our custom board has LPDDR4 on it, a newly-revised driver was provided by TI to support this.  It's not part of the "stock" TI SDK - at least until a new SDK version is released.

    - I'm not quite sure what you meant about using toolchains other than what is provided in the SDK possibly causing an issue with building the executables for U-Boot and the kernel.  Have these toolchains been modified or patched in some way that would prevent a standard AArch64 or 32-bit ARM gcc/binutils from building valid executables?

    - Yes, I understand that the SDK will continue to be evolved and corrected.  I'll keep checking back, but at the moment I only have the modified ddrss driver needed for LPDDR4 support, and it doesn't look like a new SDK is available.  I will try to subscribe to notifications about new SDKs - is there a place to do so?

    - The hybrid approach would require us to maintain multiple repositories, along with potentially confusing instructions on how to download/install the SDK, how to download/install Buildroot, and how to glue all the pieces back together.  That's one of the reasons we wanted to use Buildroot - if it wasn't for the requirement of a 2nd toolchain for the R5 portion of U-Boot, in theory Buildroot could create a host cross-compiler, bootloader, Linux image, and root filesystem all within one system.

    What I'm proposing just may not be feasible. To be honest, this is the first processor/SoC that I've ever used that uses multiple cores with different architectures just to boot up (i.e., first the 32-bit R5, then the 64-bit A53).

    I'm trying to reach out to the Buildroot community to see if anyone else is trying to do this, or has a way to add additional host packages like the 32-bit compiler.

    Thank you again for your time and suggestions,

    Scott

  • Hi Scott,

    Here are some additional thoughts on a couple of your responses.

    - Toolchains: There have been differences not so much with patches but tool chain configuration such as which libraries are included for app building, include files etc. 

    -SDK updates: the link below is the SDK download page, there a button called "alert me" that you can click and sign up for alerts on the SDK you are interested in. TI releases SDKs 4 times a year. 

    TI Processors SDK download

    Are you reaching out to the Buildroot community independent of this thread? 

    Best Regards,

    Schuyler

  • Hi Schuyler,

    Thanks for your additional thoughts.  I did sign up for alerts when the SDK changes.

    I have also reached out to the Buildroot community via their mailing list.  Apparently there is a patch to support a 2nd "bare bones" toolchain, and several people have been asking for this.

    I'm trying to find out now when the patch will become available and how to apply/use it.  I am not sure how long it might take, but it's comforting to know that we're not the only ones looking for a way to build everything we need for host/AM65x from Buildroot.

    Best regards!

    Scott

  • Hi Scott,

    I left the thread hoping somebody from the e2e community would chime in, since I don't see anybody else post I will close the thread for now. I think your best course from here is what you are doing which is working with the Buildroot community.  

    Best Regards,

    Schuyler

  • Also please see this E2E FAQ for additional information & up-to-date info regarding Buildroot on AM6x devices. While the FAQ doesn't explicitly list out AM65x the current solution/patch set should be easily adoptable to AM65x, as all the fundamental building blocks to support the TI K3 architecture have been added.

    [FAQ] Buildroot Support for Sitara AM62x/AM62Ax/AM64x Devices
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1226815/faq-buildroot-support-for-sitara-am62x-am62ax-am64x-devices

    Regards, Andreas