Skip to main content
Visitor II
July 26, 2021
Solved

Customizing device tree

  • July 26, 2021
  • 2 replies
  • 1771 views

Help on customizing the device tree

I installed my starter package according to instructions at https://wiki.st.com/stm32mpu/wiki/STM32MP15_Discovery_kits_-_Starter_Package

And the developer package following instructions at  https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package

Then on developing my projects, I realized that I need a different device tree than what was provided in those two packages, because the CAN bus is not  defined in those installations, and that is the core of my project.

Then I read this blog

https://wiki.st.com/stm32mpu/wiki/How_to_cross-compile_with_the_Developer_Package

Somewhere, it requires to navigate to "Device Drivers - Generic Driver Options"

  • select "Size in Megabytes"
  • modify its value to 256
  • exit and save the new configuration

The problem is: if you follow those instructions, there is no option to select “Size in Megabytes,�? which left in darkness!!

Somewhere in the next page it advises to change directory to the <Linux kernel build directory> as

PC $> cd <Linux kernel build directory>

 

Problem is that no clear information on what this <Linux kernel build directory> is!

 

Again, on the next page there is this instruction

 

PC $> cd <Linux kernel source directory>

The following several pages keep jumping between <Linux kernel source directory> which is not clearly defined, and the <Linux kernel build directory> and then comes

 

PC $> cd <tag>/sources/arm-<distro>-linux-gnueabi

Where the so called <tag> and <distro> are not clearly defined

On modifying u-boot, there is the command

PC $> cd <U-Boot source directory>

and I have no idea what the <U-Boot source directory> directory is. I believe If I gent into that directory, the following instructions should be easy to fulfil, but I don’t know where that directory is. Finally there is this command with a similar problem about <TF-A source directory>

PC $> cd <TF-A source directory>

Another document I read is this

https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package

Section 3 states the prerequisistes which are in agreement with my prior process of installing of the Starter package and Developer package. However, Section 4 suggests something that I have to reinstall the developer package again, which is what I fail to understand why if I have already met the prerequisites of Section 3. If I skip Section 4, then it seems that Section 5 does not work at all.

This document relies on WORKDIR, which in my case (following instructions at https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package) would be

$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v3.0.0/Developer-Package

But unfortunately it does not work, which means the instructions at

https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package

are different from those at

https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package

which bothers me.

Can I get any help on how to customize my device tree?

    This topic has been closed for replies.
    Best answer by Olivier GALLIEN

    Hi @MSele.1​ ,

    Ok I think I got it .

    https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package seems to not follow same rules than https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package and https://wiki.st.com/stm32mpu/wiki/How_to_cross-compile_with_the_Developer_Package#Modifying_the_Linux_kernel_device_tree

    So I recommand to ignore https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package and stick on the other ones.

    As a summary :

    For <working directory absolute path> we recommend <whatever you want>/STM32MP15-Ecosystem-v3.0.0/

    So in your case <working directory absolute path> = "$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v3.0.0/"

    Then all is relative from this folder.

    <Linux kernel installation directory> is

    <working directory absolute path>/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.10-r0

    <Linux kernel source directory>

    <working directory absolute path>/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.10-r0/linux-5.10.10

    <Linux kernel build directory> in case :

    * Compile and install on a build directory

    -> <working directory absolute path>/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.10-r0/build

    else same as <Linux kernel source directory>

    <SDK installation directory> is <working directory absolute path>/Developer-Package/SDK

    Hope it help

    Olivier

    2 replies

    Technical Moderator
    July 27, 2021

    Hi @MSele.1​ ,

    Thanks for your post and sorry for inconvenience using the wiki.

    To get what we call "source directory" I think it can be helpful to refer to

    https://wiki.st.com/stm32mpu/wiki/Example_of_directory_structure_for_Packages

    For reference to <Linux kernel build directory>  in

    https://wiki.st.com/stm32mpu/wiki/How_to_cross-compile_with_the_Developer_Package#Modifying_a_built-in_Linux_kernel_device_driver

    you have to know that this page consider you already build Linux a first time following :

    https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package#Building_and_deploying_the_Linux_kernel_for_the_first_time

    "build directory" may depends you have decided to use in-tree or "out-tree with build folder" build mode.

    For "“Size in Megabytes,�? which left in darkness!!" problem .. I will have a look

    But I don't think you need to change kernel configuration just to enable CAN in device tree, right ?

    Let me know if this is clearer.

    Olivier

    MSele.1Author
    Visitor II
    July 27, 2021

    Thank you; the information at https://wiki.st.com/stm32mpu/wiki/Example_of_directory_structure_for_Packages provides information about some directories. However, if I followed installation instructions at https://wiki.st.com/stm32mpu/wiki/STM32MP15_Discovery_kits_-_Starter_Package

    and at https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package to the letter without deviating, what will be my <Linux kernel build directory>? Is it same as the <Linux kernel installation directory> or the <SDK installation directory>?

    On another note, I just installed the starter and the developer packages only; I did not install the distribution package. Was that a mistake?

    Technical Moderator
    July 27, 2021

    Hi @MSele.1​ ,

    Ok I think I got it .

    https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package seems to not follow same rules than https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package and https://wiki.st.com/stm32mpu/wiki/How_to_cross-compile_with_the_Developer_Package#Modifying_the_Linux_kernel_device_tree

    So I recommand to ignore https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package and stick on the other ones.

    As a summary :

    For <working directory absolute path> we recommend <whatever you want>/STM32MP15-Ecosystem-v3.0.0/

    So in your case <working directory absolute path> = "$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v3.0.0/"

    Then all is relative from this folder.

    <Linux kernel installation directory> is

    <working directory absolute path>/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.10-r0

    <Linux kernel source directory>

    <working directory absolute path>/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.10-r0/linux-5.10.10

    <Linux kernel build directory> in case :

    * Compile and install on a build directory

    -> <working directory absolute path>/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.10-r0/build

    else same as <Linux kernel source directory>

    <SDK installation directory> is <working directory absolute path>/Developer-Package/SDK

    Hope it help

    Olivier

    MSele.1Author
    Visitor II
    July 27, 2021

    Thank you; this helps a lot. I have just uninstalled all prior installations to start afresh. I will bring my feedback after the whole process. Do you think I should also install the distribution package? is it necessary?

    Technical Moderator
    July 27, 2021

    Good to know it help, thanks !

    For Distribution package, for you current need of just updating dts I would say no .. but it depends what you want to do afterward.

    I recommend to read :

    https://wiki.st.com/stm32mpu/wiki/Which_STM32MPU_Embedded_Software_Package_better_suits_your_needs

    Olivier

    In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'