2022-06-02 05:31 PM
See debug out for details.
CA7 : Forward efd info for buf7 with mFdSdbRpmsg:7 and efd:15
CA7 : DBG mmappedData[7]:0xb4d00000
CM4 : SDB0_RxCpltCallback: B7Ae8800000L00100000
CM4 : treatSDBEvent OK physAddr=0xe8800000 physSize=1048576 mArrayDdrBuffCount=7
According to the reference manual this area is only accessible by the A7 (DDR Extension).
I am using the /dev/rpmg-sdb driver to map the memory.
How do I get mmap to map in the proper space? Not sure why it is mapping in the upper range of DDR.
I have been using the logic analyzer example.
Solved! Go to Solution.
2022-07-28 05:55 PM
In the DTS file.
Example CMA allocation for RPMSG
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
linux,cma {
compatible = "shared-dma-pool";
reusable;
size = <0x4000000>;
alloc-ranges = <0xdc000000 0x4000000>;
linux,cma-default;
};
mcuram2: mcuram2@10000000 {
compatible = "shared-dma-pool";
reg = <0x10000000 0x40000>;
no-map;
gives a 64MB chunk for continuous mem allocation
2022-06-10 05:01 AM
Hi @GHamm.2 ,
I'm not sure to catch the point. Are you encountering issue with the Logic analyzer example ?
AFAIK the M4 use DMA to write inside the buffer and do not access it directly.
Physical address looks consistent if you are in a 1GB DDR configuration
Please elaborate further.
Thanks,
Olivier
2022-06-10 10:13 AM
Hi,
Thank you for your response. In the LASTATEMachine code on the M4. The DMA is used to transfer the data from the peripheral to SRAM. Then that data is copied to DDR. When the data is copied in SAMPLING_HIGH_FREQ_BUFF1 to the DDR address. The data is never copied and the program stops in the for loop. This is using the phys address of 0xe8800000. Seems to be inaccessible.
I have snice figured out how to change the allocation address by reconfiguring the CMA config. The default address for the CMA configuration is in the 0xExxxxxxx address space. I am now configuring it to use the starting address of 0xDxxxxxxx. The program now copies with no crash.
Olivier GALLIEN (ST Employee)
"Address printed in your traces looks to be in debug context, so accessible to CM4."
Not sure why it was not working in the debug context. Maybe there was something else I needed to configure.
Thanks again,
GH
2022-07-21 07:33 PM
Hi, Russ
We meet the same problem. Because we use the 1GB DDR , so the sdb map the buffer to the 0xe8xxxxxx. And M4 can't write the data.
How can I change the CMA config, Is it in the dts?
2022-07-21 07:41 PM
Thanks all
Xiao Zhen
2022-07-28 05:55 PM
In the DTS file.
Example CMA allocation for RPMSG
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
linux,cma {
compatible = "shared-dma-pool";
reusable;
size = <0x4000000>;
alloc-ranges = <0xdc000000 0x4000000>;
linux,cma-default;
};
mcuram2: mcuram2@10000000 {
compatible = "shared-dma-pool";
reg = <0x10000000 0x40000>;
no-map;
gives a 64MB chunk for continuous mem allocation
2024-06-17 02:28 AM
Hello
Does anyone know why this solution might not work?
Despite such entries in device tree, the memory is always allocated in extended memory.
The address changes depending on the size I allocate but it is still too far.
I tried using kernel parameters. The size changes but unfortunately the address does not.
[ 0.000000] cma: Reserved 64 MiB at 0xf4000000
[ 0.000000] Kernel command line: root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw drm.edid_firmware= console=ttySTM0,115200 cma=64MB@3072MB-3584MB
[ 0.000000] Memory: 818656K/1048572K available (12288K kernel code, 1242K rwdata, 3480K rodata, 1024K init, 204K bss, 164380K reserved, 65536K cma-reserved, 65536K highmem)
###################################################################
[ 0.000000] cma: Reserved 128 MiB at 0xf0000000
[ 0.000000] Kernel command line: root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw drm.edid_firmware= console=ttySTM0,115200 cma=128MB@3072MB-3584MB
[ 0.000000] Memory: 753120K/1048572K available (12288K kernel code, 1242K rwdata, 3480K rodata, 1024K init, 204K bss, 164380K reserved, 131072K cma-reserved, 0K highmem)
###################################################################
[ 0.000000] cma: Reserved 256 MiB at 0xe0000000
[ 0.000000] Kernel command line: root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw drm.edid_firmware= console=ttySTM0,115200 cma=256MB@3072MB-3584MB
[ 0.000000] Memory: 621536K/1048572K available (12288K kernel code, 1242K rwdata, 3480K rodata, 1024K init, 204K bss, 164892K reserved, 262144K cma-reserved, 131072K highmem)
###################################################################
Only when the size is set to 512MB do we run into an address that I can use. But I don't need such a large size od CMA
[ 0.000000] cma: Reserved 512 MiB at 0xd0000000
[ 0.000000] Kernel command line: root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw drm.edid_firmware= console=ttySTM0,115200 cma=512MB@3072MB-3584MB
[ 0.000000] Memory: 358880K/1048572K available (12288K kernel code, 1242K rwdata, 3480K rodata, 1024K init, 204K bss, 165404K reserved, 524288K cma-reserved, 131072K highmem)
Any hints?
Thanks.