Hello NXP community,
I am interested in how the IPCF shared memory need is calculated correctly.
The project has 0x15000 of shared RAM assigend to c0 and c2 in the linker file and in the IPCF config shared mem size.
Further I created two channels with one buffer pool each. The pool of the first channel contains 18 buffers with size 4. The pool of the second channel should contain 1220 buffers of size 34.
All in all this is 18*4+1220*34=41552 raw bytes of data (0xA250).
This is way less than the available 0x15000 but still the init of the shared mem (ipc_shm_init) fails returning -2 (IPC_SHM_E_NOMEM).
When I reduce the number of buffers of the pool of the second channel to 459 (instead of 1220) it is working fine. 460 will fail again. But the total raw data is then limited to only 18*4+459*34=15678 (0x3D3E) leaving a hole of 0x112C2 bytes.
It is not possible that the configuration needs such an amount of mem space, is it? Is it a bug? What am I missing?
Note: the focus of the attached project is the configuration of IPCF not the code which is simply the example code. Breakpoint at the line of "err = ipc_shm_init(&ipcf_shm_instances_cfg);" stepping over and evaluating the error code.
Thanks in advance.
Solved! Go to Solution.
for new versions of IPCF you can use the defines from ipc_ip_cfg_defines.h
#define IPC_SHM_MEM_SIZE_IPCF_INSTANCE0 0x
#define IPC_SHM_MEM_SIZE_IPCF_INSTANCE1 0x
Thanks for the reply @nxf45396
Since what version this define will be generated? We're currently using 4.1.0 for the S32K3 and I am not getting these defines.
AFAIK 4.1.0 is the latest one available for S32K3?
BR
Andreas
for S32k3xx will be in next release
Hello @Iota,
This is the IPCF memory size layout.
You can refer to the above images to calculate IPCF mem size.
Best regards,
Dan
@nxf78987 thank you for the memory size layout.
Using this for my configuration results in the following:
16 + ( 19 × 8 ) + [ring channel 0]
16 + ( 19 × 8 ) + [ring pool 0]
18 × 4 + [data]
16 + ( 460 × 8 ) + [ring channel 1]
16 + ( 460 × 8 ) + [ring pool 0]
459 × 34 [data]
= 23382 (0x5B56)
But this is still far away from 0x15000 and the init still fails. Do you see another point in my project that could fail during initialization with return value -2?
Hello Dan @nxf78987,
Thank you for the detailed information. If the calculation is correct and more than enough shared mem size is allocated via the IPCF config - what could be the root cause of the ipc_shm_init function returning IPC_SHM_E_NOMEM?
I think it is in managed_channel_init where it checks if pool fits into the shared memory. But this should be the case so there should not be any reason to return the error here...
Hello @Iota,
Before call ipc_shm_init function(), the share memory must be cleared.
Did you to do that?
Best regards,
Dan