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.

AM5718: CMEM共享内存如何多次申请

Part Number: AM5718

TI的工程师,你们好!

我在使用共享内存API   msg->dataIn = CMEM_allocPool(CMEM_getPool(PAYLOADSIZE), &cmemAttrs);申请共享内存时,第一次调用没有问题,但是第二次调用就无法分配了,运行结果如下:

<-- App_create:
--> App_exec:
CMEM_init success
user: 0xa9bbf000 phys: 0xa0000000      //第一次分配成功
CMEM Error: allocPool: ioctl CMEM_IOCALLOC failed from pool 0: -1          //第二次分配失败
CMEM_alloc() failed (returned NULL)

并且运行了:

pkill ti-mctd
rmmod cmemk
modprobe cmemk phys_start=0xa0000000 phys_end=0xa0100000 pools=2x524288

使用cat /proc/cmem看到的仍然是默认的配置,但是/sys/module/cmemk/parameters/下的各个文件都已经被修改,cat /proc/cmem结果如下:

Block 0: Pool 0: 1 bufs size 0xc000000 (0xc000000 requested)

Pool 0 busy bufs:

Pool 0 free bufs:
id 0: phys addr 0xa0000000

问题:

1、是否运行n次CMEM_allocPool就需要pools分为n个区间?

2、除了修改dtsi的方式,是否modprobe没有作用?

参考帖子:

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/590859/linux-am5728-cmem-error?tisearch=e2e-sitesearch&keymatch=CMEM#

谢谢!