How to create your board device tree

Revision as of 10:17, 14 August 2019 by Registered User (→‎Article purpose)


1. Article purpose[edit source]

This article is a guideline to create a first TF-A device tree for your board with STM32CubeMX and compile it with STM32MP1 Distribution Package. Thanks to follow those three links to be familiar with those elements before digging into the steps below.

2. TF-A setup to get the serial log and USB boot[edit source]

2.1. In STM32CubeMX[edit source]

  • Create a new project with the MCU selector, selecting the STM32MP1 part number that is mounted on your board
  • In Pinout & Configuration:
    • RCC: enable the HSE according to your board setup. The HSE is needed for various PLL (USB, DDR).
    • UARTx: setup the serial console.
      • Assign UARTx to the "Cortex-A7 non-secure" and the "Boot loader" contexts
      • Select the "Asynchronous" mode
      • In the "pinout view", change the RX and TX lines if STM32CubeMX default choices are not maching with your board.
      • Notice that UARTx instance is gotten from the device tree for the console but it is hard coded to UART4 with TX on GPIOG11 for the crash console, in plat/st/stm32mp1/stm32mp1_def.h.
    • USB OTG: setup the serial boot interface.
      • Assign USB OTG to the "Cortex-A7 non-secure", the "Boot loader" and "Boot ROM" contexts.
      • Select the "High speed OTG/Dual_Role_Device".
  • In Clock configuration:
    • Check that UARTx source clock corresponds to your wish or select HSI by default.
    • Configure the USBPHYC clock mux.
  • GENERATE CODE then:
    • Complete "USER CODE BEGIN root" with "chosen" and "aliases" nodes, taking ST boards values as example.