S32G399ARDB3-IPCF-Failed to get buffer for channel 1 while trying to run IPCF sample on Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32G399ARDB3-IPCF-Failed to get buffer for channel 1 while trying to run IPCF sample on Linux

2,735 Views
MohamedAbdelslam
Contributor III

Hi experts, 
I am working on an example of IPCF on S32G399A board IPCF_FreeRTOS_S32G399A_M7_0 
I got the error shown in the attachment screenshot. 
Versions: 
IPCF: 4.10.0
BSP : 41 

Tags (1)
0 Kudos
Reply
14 Replies

2,703 Views
Celeste_Liu
NXP Employee
NXP Employee

Hello @MohamedAbdelslam ,

Thank you for contacting NXP Tech Support. Kindly note that the versions of IPCF used by the M core and the A core must be consistent. Since the IPCF version you are using on the M core is 4.10.0, the A core should also employ version 4.10.0. However, the default IPCF in Linux BSP41 may not be this version. You need to manually compile IPCF 4.10.0 for Linux. The source code of IPCF for the A core is available at the following link: https://github.com/nxp-auto-linux/ipc-shm.
We hope the above information is of use to you.

Best Regards,

Celeste

0 Kudos
Reply

2,650 Views
MohamedAbdelslam
Contributor III

Hello @Celeste_Liu
Is there an example or guide to compile a different or a new version of the IPCF on Linux? I tried to compile it but it seems needs a kernel source on HW, if you have another idea to do that

Tags (1)
0 Kudos
Reply

2,642 Views
Celeste_Liu
NXP Employee
NXP Employee

Hello @MohamedAbdelslam ,

Compiling Linux IPCF indeed requires kernel code. Regarding how to compile a specific version of Linux IPCF (taking Linux bsp40 and IPCF4.9.0 as an example) and perform the insertion operation, please refer to the following steps:
Compile Linux kernel
Refer to sections 3.2.3 and 3.2.3.1 - 3.2.3.2 of the bsp40 document for operation.
Clone the Linux repository and Perform compilation:

   git clone https://github.com/nxp-auto-linux/linux 
   cd linux 
   git checkout bsp40.0-5.15.145-rt 
   ls 
   make ARCH=arm64 CROSS_COMPILE=/path/to/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- s32cc_defconfig
   make ARCH=arm64 CROSS_COMPILE=/path/to/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-

Compile IPCF modules

Set the cross-compilation tool path, clone the IPCF repository and compile the modules.

   export CROSS_COMPILE=/path/to/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
   git clone https://github.com/nxp-auto-linux/ipc-shm 
   cd ipc-shm 
   git checkout release/SW32G_IPCF_4.9.0_D2310
   make -C./sample KERNELDIR=~/path/to/linux PLATFORM_FLAVOR=s32g3 modules

Copy the following image files to the FAT32 partition (boot_s32g27) of the SD card:

  • Copy the kernel image (linux/arch/arm64/boot/Image) and replace the original one on the SD card.
  • Copy the device tree image (linux/arch/arm64/boot/dts/freescale/s32g274a-rdb2.dtb) and replace the original one on the SD card.
  • Copy the IPC images (ipc-shm/ipc-shm-dev.ko, ipc-shm/sample/ipc-shm-sample.ko).

Power on

If everything is okay, you will get the A53 booting log on the terminal. After Kernel is up, enter root to login.

Copy the IPC module files and insert IPCF modules

   $mkdir ipc 
   $mount /dev/mmcblk0p1./ipc 
   $cp./ipc/ipc-shm-* ~ 
   $umount./ipc 
   $insmod ipc-shm-dev.ko 
   $insmod ipc-shm-sample.ko

 

Hope the above information is helpful to you.

Best Regards,

Celeste

0 Kudos
Reply

2,504 Views
MohamedAbdelslam
Contributor III

Hello @Celeste_Liu  
I have updated the IPC version in the image to 4.10 to be compatible with M core Version following the README file that existed in the ipc-shm repo, mainly adding those two lines 

BRANCH:pn-ipc-shm = "release/SW32G_IPCF_4.10.0_D2405"
SRCREV:pn-ipc-shm = "2419b87af860faac9f46a63536b0bbf906b31053" 
and running application from A53 core following example instructions but still have the same error 

Tags (1)
0 Kudos
Reply

2,485 Views
Celeste_Liu
NXP Employee
NXP Employee

Please refer to the above steps, the kernel file also needs to be replaced. 

0 Kudos
Reply

2,479 Views
MohamedAbdelslam
Contributor III

HI @Celeste_Liu  I used Yocto for building the image and IPCF, following BSB41 RM. Should I build the image manually?

Tags (1)
0 Kudos
Reply

2,470 Views
Celeste_Liu
NXP Employee
NXP Employee

Hello, I suggest using the pre-built images by NXP to isolate any compilation/configuration errors under your custom yocto build. The following community post provides information on regards of manually building the IPCF module and loading into a pre-built image by NXP:

Re: Issue with NXP S32G274A RDB2 -  IPCF - NXP Community

0 Kudos
Reply

2,439 Views
MohamedAbdelslam
Contributor III

Hello @Celeste_Liu  Thanks for your continued support 
I have done those steps, cloned the kernel and IPC repositories and build them and copied the image, dtb and IPCF .ko files to boot partition successfully and continued the steps of the example but when try to insert the module i got the following error.  
root@s32g399ardb3:~# insmod /lib/modules/5.15.153-rt75+gadceb7e8fa72/extra/ipc-shm-dev.ko
insmod: ERROR: could not insert module /lib/modules/5.15.153-rt75+gadceb7e8fa72/extra/ipc-shm-dev.ko: Invalid module format
 
please suggest us how to resolve this error? 

Tags (1)
0 Kudos
Reply

2,399 Views
Celeste_Liu
NXP Employee
NXP Employee

Hello,

How did you copy the IPC module? Is it through the way shown in the following screenshot? If so, you should use “insmod ipc-shm-dev.ko” instead of “insmod /lib/modules/5.15.153-rt75+gadceb7e8fa72/extra/ipc-shm-dev.ko”.

Celeste_Liu_0-1731030089238.png

BRs,

Celeste

0 Kudos
Reply

2,383 Views
MohamedAbdelslam
Contributor III

Hi @Celeste_Liu  
Typically as the instructions you provided, I have copied the IPC files then at the end umount ipc directory but when I  used “insmod ipc-shm-dev.ko” , I got the following error message below
 
root@s32g399ardb3:~# ls /run/media/boot_s32g3-mmcblk0p1/
Image  s32g399a-rdb3.dtb  s32g_pfe_class.fw

root@s32g399ardb3:~# ls /ipc
root@s32g399ardb3:~# ls ~/ipc-shm-*.ko
/home/root/ipc-shm-dev.ko  /home/root/ipc-shm-sample.ko


root@s32g399ardb3:~# insmod ~/ipc-shm-dev.ko
insmod: ERROR: could not insert module /home/root/ipc-shm-dev.ko: Invalid module format
Please let me know what is your recommendation to resolve this error and initiate IPC between M Core and A core 

Tags (1)
0 Kudos
Reply

2,380 Views
Celeste_Liu
NXP Employee
NXP Employee

Hello @MohamedAbdelslam ,

If possible, would you mind posting a new question? So that we can better support you. This question has been open for too long.

BRs,

Celeste

2,366 Views
MohamedAbdelslam
Contributor III
No problem, I've posted a new question

2,644 Views
MohamedAbdelslam
Contributor III

Also I want to make sure that the version (in the attached screenshot) of the ipc in Linux is correct?

Tags (1)
0 Kudos
Reply

2,639 Views
Celeste_Liu
NXP Employee
NXP Employee

I can't determine the version of ipcf from your screenshot. However, if this is in the prebuilt image of Linux BSP41, it is very likely not the ipcf 4.10.0 version.

0 Kudos
Reply