Skip to main content
Associate II
August 12, 2025
Solved

Custom DTS Overlay Memory Reservation Not Reflected After Boot on STM32MP157F-DK2

  • August 12, 2025
  • 1 reply
  • 1668 views

Hi everyone,

I am trying to reserve a block of RAM using a custom device tree overlay on my STM32MP157F-DK2 running Linux. Here's what I have done so far:

This is my custom DTS overlay

/dts-v1/;
/plugin/;
/ {
 compatible = "st,stm32mp157f-dk2", "st,stm32mp157";
 fragment@0 {
 target-path = "/reserved-memory";
 __overlay__ {
 sensor_shm: sensor_shm@c8000000 {
 compatible = "shared-dma-pool";
 reg = <0xc8000000 0x00040000>; /* 256KB */
 no-map;
 status = "okay";
 };
 };
 };
};

 

I compiled this to get custom-overlay.dtbo and placed it under /boot/overlays/.

Then, I edited the /boot/mmc0_extlinux/stm32mp157f-dk2_extlinux.conf configuration file to include the overlay during boot by adding this line inside the appropriate boot label:

 

# Generic Distro Configuration file generated by OpenEmbedded
menu title Select the boot mode
MENU BACKGROUND /splash_portrait.bmp
TIMEOUT 20
DEFAULT OpenSTLinux
LABEL OpenSTLinux
 KERNEL /uImage
 FDTDIR /
 INITRD /st-image-resize-initrd
 APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=${console},${baudrate}
 fdtoverlays /boot/overlays/custom-overlay.dtbo
LABEL stm32mp157f-dk2-a7-examples
 KERNEL /uImage
 FDT /stm32mp157f-dk2-a7-examples.dtb
 INITRD /st-image-resize-initrd
 APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=${console},${baudrate}
LABEL stm32mp157f-dk2-m4-examples
 KERNEL /uImage
 FDT /stm32mp157f-dk2-m4-examples.dtb
 INITRD /st-image-resize-initrd
 APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=${console},${baudrate}
~

Problem:
After reboot, the reserved memory node /reserved-memory/sensor_shm does not appear in the device tree (checked via /proc/device-tree), and my memory reservation does not take effect.

Could someone please help me identify what I might be missing or doing wrong with the overlay or boot configuration?

Thank you!

Best answer by Erwan SZYMANSKI

Hello @VedantK33 ,
If you built the default OpenSTLinux distribution as explained in the wiki, so the default U-Boot configuration might not have CONFIG_OF_LIBFDT_OVERLAY configured by default, regarding the stm32mp15_defconfig file in sources of U-Boot.

You have 2 different options:

  • Creating a patch for U-Boot that modify the stm32mp15_defconfig and add the necessary configuration. Then add this patch as a bbappend in your Yocto build
  • Cross compiling out of Yocto U-Boot with the modified configuration, and deploy it in your FIP used on your target (what we call the Developer Package method)

Kind regards,
Erwan.

1 reply

Erwan SZYMANSKI
Technical Moderator
August 12, 2025

Hello @VedantK33 ,
Few investigations path you can check at:

  • Does your U-Boot has the necessary configuration to support DTBO ? I think we disable it by default for security reason, but need to double check. The config seems to be CONFIG_LIBFDT_OVERLAY
  • Check if caps are not mandatory in your extconf file read by U-Boot. We have this example for X-LINUXTSNSWCH as extconf U-Boot file:
  • LABEL stm32mp257f-ev1-tsn
     KERNEL /Image.gz
     FDTDIR /
     FDTOVERLAYS /devicetree/stm32mp25xx-ev1-swch.dtbo
     INITRD /st-image-resize-initrd
     APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw earlycon console=${console},${baudrate}
    
  • Add logs in U-Boot in pxe_utils.c file to check if the overlay is well detected and applied.

Kind regards,
Erwan. 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
VedantK33Author
Associate II
August 13, 2025

How can I check my U-boot configuration ? I think I cant change it as the configuration file is baked at build time and now what we have on board is U-boot binary. So I might have to build U-boot with desired configuration. Please correct me if I am wrong. 

Erwan SZYMANSKI
Erwan SZYMANSKIBest answer
Technical Moderator
August 18, 2025

Hello @VedantK33 ,
If you built the default OpenSTLinux distribution as explained in the wiki, so the default U-Boot configuration might not have CONFIG_OF_LIBFDT_OVERLAY configured by default, regarding the stm32mp15_defconfig file in sources of U-Boot.

You have 2 different options:

  • Creating a patch for U-Boot that modify the stm32mp15_defconfig and add the necessary configuration. Then add this patch as a bbappend in your Yocto build
  • Cross compiling out of Yocto U-Boot with the modified configuration, and deploy it in your FIP used on your target (what we call the Developer Package method)

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.