S32K358 IPCF mem size calculation

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K358 IPCF mem size calculation

ソリューションへジャンプ
1,036件の閲覧回数
Iota
Contributor II

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.

タグ(2)
0 件の賞賛
1 解決策
867件の閲覧回数
nxf78987
NXP Employee
NXP Employee

Hello @Iota,

Sorry for my wrong calculation. This is the correct calculation.

nxf78987_0-1701743561886.png

Best regards,

Dan

元の投稿で解決策を見る

0 件の賞賛
9 返答(返信)
417件の閲覧回数
nxf45396
NXP Employee
NXP Employee

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

OCV
0 件の賞賛
405件の閲覧回数
AndreasStolze
Contributor IV

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

0 件の賞賛
381件の閲覧回数
nxf45396
NXP Employee
NXP Employee

for S32k3xx will be in next release

OCV
964件の閲覧回数
nxf78987
NXP Employee
NXP Employee

Hello @Iota,

This is the IPCF memory size layout.

nxf78987_0-1701238587427.pngnxf78987_1-1701238605849.png

You can refer to the above images to calculate IPCF mem size.

Best regards,

Dan

959件の閲覧回数
Iota
Contributor II

@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?

0 件の賞賛
939件の閲覧回数
nxf78987
NXP Employee
NXP Employee

Hello @Iota,

Maybe, you calculated wrong. This is the right calculation.

nxf78987_0-1701256152641.png

Best regards,

Dan

0 件の賞賛
928件の閲覧回数
Iota
Contributor II

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...

0 件の賞賛
392件の閲覧回数
nxf78987
NXP Employee
NXP Employee

Hello @Iota,

Before call ipc_shm_init function(), the share memory must be cleared.

Did you to do that?

Best regards,

Dan

0 件の賞賛
868件の閲覧回数
nxf78987
NXP Employee
NXP Employee

Hello @Iota,

Sorry for my wrong calculation. This is the correct calculation.

nxf78987_0-1701743561886.png

Best regards,

Dan

0 件の賞賛