2025-08-12 1:04 AM
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!
Solved! Go to Solution.
2025-08-18 6:13 AM
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:
Kind regards,
Erwan.
2025-08-12 6:04 AM
Hello @VedantK33 ,
Few investigations path you can check at:
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}
Kind regards,
Erwan.
2025-08-12 10:21 PM
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.
2025-08-18 6:13 AM
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:
Kind regards,
Erwan.
2025-08-20 10:25 PM
Hey @Erwan SZYMANSKI
Thanks for replying.
I used another way to overlay custom-overlay on the stm32mp157f.dts file.
It is very simple and does not require developer package method.
I am pasting link below where I have mentioned steps to create reserved memory
Guide to create reserved memory
Thanks and regards,
Vedant.