Template:ArticleMainWriter Template:ArticleFirstDraftVersion Template:ReviewersList
1. Purpose[edit source]
This article explains how to compile a device tree in a Windows® environment, and how to deploy the compiled devicetree.
2. Rationale[edit source]
STM32CubeMX can be used in both Linux® and Windows® environments.
The use of STM32MPU_Embedded_Software_distribution depends on a Linux® environment.
Nevertheless, the generation of a devicetree from STM32CubeMX and its compilation can be managed in a Windows® environment for some components.
3. Pre-requisites[edit source]
- Install a cross-compiler
- A cross compiler is needed to parse and prepare the devicetree (.dts) file.
- System Workbench for STM32 is recommended.
- The zip file with the gcc can be found at <INSTALL_DIR>\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.16.0.201807130628\tools
- mingw64 is also a good alternative.
- System Workbench for STM32 is recommended.
- A cross compiler is needed to parse and prepare the devicetree (.dts) file.
- Install a device tree compiler
- To install a community device tree compiler, please refer to Device Tree Compiler (MSYS2 version)
- Upon request, STMicroelectronics may provide an executable binary, without warranty nor support
4. updating devicetree of TF-A[edit source]
5. updating devicetree of U-Boot[edit source]
6. updating the kernel device tree[edit source]
- Get the Linux® source code
- Apply patches to the Linux® source code
- Create a workdir directory
- mkdir workdir
- 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/
- Copy your dts into workdir
- cp <Your/dts/file.dts> workdir/
- 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>
- compile dts.tmp with dtc.exe
- dtc.exe -I dts -O dtb -o <DTBresult.dtb> <yourDTS.dts>.tmp