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!