This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CMEM: failed to mmap buffer at physical address

Hi,

I use DM368 to try CMEM usage, but it failed to mmap buffer at physical address 0x84000000 while assign Linux memory 64MB. 

After insmod cmemk module with command "insmod /home/cmemk.ko phys_start=0x84000000 phys_end=0x88000000 allowOverlap=1 pools=5x6291456,2x3145728,3x833536" and execute cmem app, the debug massage is shown below:

CMEM Debug: init: entered - ref_count 0, cmem_fd -2
CMEM Debug: init: successfully opened /dev/cmem, matching driver version...
CMEM Debug: getVersion: entered
CMEM Debug: getVersion: exiting, ioctl CMEM_IOCGETVERSION returned 0x3000100
CMEM Debug: init: ... match good (0x3000100)
CMEM Debug: init: exiting, returning success
CMEM Debug: alloc: entered w/ size 0, params - type HEAP, flags NONCACHED, align 0x20
CMEM Debug: allocHeap: allocated phys buffer 0x84000000
CMEM Error: allocHeap: Failed to mmap buffer at physical address 0x84000000
CMEM Error: Freeing phys buffer 0x84000000
OSA_CMEM: 00000000 0 bytes
virtAddr == NULL!
ERROR: could not allocate 0x00000000 size memory
CMEM Debug: exit: entered - ref_count 1, cmem_fd 3
CMEM Debug: exit: decrementing ref_count
CMEM Debug: exit: ref_count == 0, closed /dev/cmem (succeeded)
CMEM Debug: exit: exiting, returning 0

  • Hi,

    may be:

    insmod kernel/cmemk.ko phys_start=0x84000000 phys_end=0x88000000 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672 useHeapIfPoolUnavailable=1

  • Hi,

    Thanks for your answer, but it's the same result:

    CMEMK module: built on Jan 24 2013 at 19:38:01
    Reference Linux version 2.6.32
    File /linuxutils_2_26_01_02/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
    allocated heap buffer 0xc7000000 of size 0x4000000
    heap fallback enabled - will try heap if pool buffer is not available
    CMEM Range Overlaps Kernel Physical - allowing overlap
    CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x84000000)
    cmemk initialized



    [root@DM368 /home]# ./cmem cmem 0x10
    CMEM Debug: init: entered - ref_count 0, cmem_fd -2
    CMEM Debug: init: successfully opened /dev/cmem, matching driver version...
    CMEM Debug: getVersion: entered
    CMEM Debug: getVersion: exiting, ioctl CMEM_IOCGETVERSION returned 0x3000100
    CMEM Debug: init: ... match good (0x3000100)
    CMEM Debug: init: exiting, returning success
    CMEM Debug: alloc: entered w/ size 0, params - type HEAP, flags NONCACHED, align 0x20
    CMEM Debug: allocHeap: allocated phys buffer 0x84000000
    CMEM Error: allocHeap: Failed to mmap buffer at physical address 0x84000000
    CMEM Error: Freeing phys buffer 0x84000000
    OSA_CMEM: 00000000 0 bytes
    virtAddr == NULL!
    ERROR: could not allocate 0x00000000 size memory
    CMEM Debug: exit: entered - ref_count 1, cmem_fd 3
    CMEM Debug: exit: decrementing ref_count
    CMEM Debug: exit: ref_count == 0, closed /dev/cmem (succeeded)
    CMEM Debug: exit: exiting, returning 0

  • Ariel T,

      I think you can try reducing the CMEM size and check once. May be enough space not available on your RAM.  Check for the address between 0x86000000 & 0x88000000 ...

  • Hi Ariel, Could you let me know if you ever figured out what was causing this issue? Did reducing CMEM size actually fix this error?

    Thanks!