How to compile the device tree with the Developer Package

Revision as of 12:35, 13 February 2019 by Registered User (→‎Purpose)

Template:ArticleMainWriter Template:ArticleFirstDraftVersion Template:ReviewersList


1. Purpose[edit source]

This article explains how to compile a devicetree in a Windows® environment, and how to deploy the compiled devicetree.

2. Rationale[edit source]

By using cubeMX or for any reason, a new device could be needed and should be flashed on running software.

3. Pre-requisites[edit source]

  1. Install a cross-compiler
    • A cross compiler is needed to parse/prepare the dts file.
      System Workbench for STM32 is a good candidate
      The zip file with the gcc could be find in C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.16.0.201807130628\tools
      mingw64 is also is good alternative
  2. Install a devicetree compiler

4. updating devicetree of TF-A[edit source]


5. updating devicetree of U-Boot[edit source]


6. updating devicetree of Kernel[edit source]

  1. Get the source code of Linux
  2. Apply patch on the source code of Linux
  3. Create a workdir directory
    mkdir workdir
  4. Copy from source code of Linux the dt-bindings and dt files
    cp <KernelSources>/include/dt-bindinds workdir
    cp <KernelSources>/arch/arm/boot/dts/* workdir/
  5. Copy your dts into workdir
    cp <Your/dts/file.dts> workdir/
  6. Prepare dts
    cd workdir
    arm-none-eabi-gcc.exe -E -nostdinc -I . -undef -D__DTS__ -x assembler-with-cpp -o <yourDTS.dts>.tmp <yourDTS.dts>
  7. compile dts.tmp with dtc.exe
    dtc.exe -I dts -O dtb -o <DTBresult.dtb> <yourDTS.dts>.tmp