Problem: S32R45 IPCF insmod ipc-shm-sample.ko mod ERROR: Invalid parameters.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Problem: S32R45 IPCF insmod ipc-shm-sample.ko mod ERROR: Invalid parameters.

跳至解决方案
2,829 次查看
amei_liu
Contributor II

According to the steps described in S32R45_LinuxBSP_33.0_User_Manual.pdf, I finally generated a fsl-image-auto-s32r45evb.sdcard file. I use the dd command to write it to the SD card. Then I plug it into the S32R45EVB card slot. I set S32R45EVB to start from SD card. After Linux is started, when I execute insmod ipc-shm-sample.ko as described in SW32R45_IPCF_4.3.0_D2203_UserManual.pdf, an error occurs, as shown in the following figure:

3805AAD3-C05D-4c9f-935D-86BA952C7E07.png

2.png

 

I modified the ipc-shm.bb file in two places, as follows:

1. Change the value of BRANCH to release/bsp33.0;
2. Change the value of SRCREV to d80b27e5fc6c3d6a9d53de6ae23fa84a17560fd3(commit id)。

1.png

 

I want to know the reason and solution of this error.

Thank you very much.

标记 (1)
0 项奖励
1 解答
2,617 次查看
UrikRodriguez
NXP Employee
NXP Employee

Yeah, that is because the kernel reports have an associated log level that defines the importance of the message. The kernel.printk defines which buffer message are printed in the console.

 

UrikRodriguez_0-1677689482934.png

To change this value you can use the command dmesg -n 7

UrikRodriguez_1-1677689632490.png

It uses "1" from the beginning because these log messages can cause misfunctions in other projects. 

UrikRodriguez_2-1677689919962.png

 

Let me know if this worked for you. 

 

在原帖中查看解决方案

0 项奖励
14 回复数
2,755 次查看
UrikRodriguez
NXP Employee
NXP Employee

Hi @amei_liu,

Could you please try rebuilding those .ko files? The problem may be these were not added correctly to the Linux image. 

You can have information of how to do this in the SW32R45_IPCF_4.3.0_D2203_UserManual.pdf, (Section 6.1/Page 18-19)

 

Best regards, 

Urik

0 项奖励
2,723 次查看
UrikRodriguez
NXP Employee
NXP Employee

Before you rebuild the .ko files, change the ipc-os.c and the ipc-uio.c files that are in the folder: ipc-shm/os/

You need change the parameter "fsl,s32cc-mscm" to "nxp,s32cc-mscm" in both files.

Best regards,

Urik

0 项奖励
2,688 次查看
amei_liu
Contributor II

According to your method:

First, I modified the ipc-os. c and the ipc-uio. c files as follows;
ipc_os.c.png

ipc_uio.c.png

Then I rebuild those. ko files according to SW32R45_IPCF_4.3.0_D2203_UserManual.pdf (Section 6.1/Page 18-19). I copied those *. ko files to the SD card and executed the insmod command on the S32R45EVB, and then reported an error: insmod: ERROR: could not insert module ipc-shm-dev.ko: Invalid module format

1.png

There are 2 compilers in my ubuntu: one is aarch64-linux-gnu-gcc, the other is gcc-arm-10.2-2020.11-x86_ 64-aarch64-none-linux-gnu。 I rebuild those *.ko whith aarch64-linux-gnu-gcc according to the following steps:

破坏者
liujun@liujun-vm:~/s32r45$ which aarch64-linux-gnu-gcc
/usr/bin/aarch64-linux-gnu-gcc
liujun@liujun-vm:~/s32r45$ export CROSS_COMPILE=/usr/bin/aarch64-linux-gnu-
liujun@liujun-vm:~/s32r45$ export ARCH=arm64
make -C ./linux s32gen1_defconfig
make -C ./linux
make -C ./ipc-shm/sample PLATFORM_FLAVOR=s32r45 KERNELDIR=$PWD/linux modules

See the attachment for detailed compilation log.

 

0 项奖励
2,678 次查看
amei_liu
Contributor II

To solve the above problem, I modified the utsrelease. h file in the linux/include/generated directory. Change the value of UTS_RELEASE to "5.10.109-rt65+g0bace7fde5f5".

Then I rebuilt those. ko files.

I copy these files to the SD card and insert them into the slot of the S32R45EVB. When Linux starts up, i execute the insmod ipc-shm-sample.ko command, the shell prints the following information, and then Linux crashes.

1.png 

0 项奖励
2,669 次查看
UrikRodriguez
NXP Employee
NXP Employee

Instead of changing the utsrelease.h file, to insert the .ko files with the correct format, you can insert those .ko files into a partition of the SD:

UrikRodriguez_2-1677513875192.png

I inserted directly the .ko files and the Linux image that I compiled ("image") changing the name of the original to "image2".

Then I load the files from the partition:

 

UrikRodriguez_3-1677514322024.png

 

 

 

 

 

 

  

0 项奖励
2,655 次查看
amei_liu
Contributor II

First of all, thank you very much for your response。

According to your method, I rebuild the Image and *. ko files and copied them to SD for testing. When executing the insmod ipc-shm-sample.ko command, the following error occurred and my Linux crashed:

insmod.png

 

 For the image and. ko file rebuild process, see the attachment rebuild.txt。

For the execution process of insmod,see the annex insmod.txt。

0 项奖励
2,638 次查看
UrikRodriguez
NXP Employee
NXP Employee

Before boot the Linux image, zero set the SRAM shared memory:

-dcache off

-mw.q 0x34000000 0x0 0x100000

UrikRodriguez_0-1677610557841.png

 

 

If this doesn't work, another suggestion is to use the BSP35 version:

NXP.COM:

-binaries_auto_linux_bsp35.0_s32r45.tgz

NXP REPOSITORIES:

-linux repository : remotes/github/release/bsp35.0-5.10.145-rt

-ipc-shm repository: remotes/Github/release/bsp35.0

 

 

In this version there is no need to change the ipc-os.c nor the ipc--uio.c files. 

Also use the s32cc_defconfig instead of s32gen1_defconfig.

For the CROSS_COMPILE try with the aarch64-none-linux-gnu-

For the PLATFORM_FLAVOR try with s32g2

 

Let me know if you have any issue. 

2,484 次查看
amei_liu
Contributor II

Hi, what is an SRAM with an address starting at 0x34000000 and a length equal to 0x100000 bytes used for?

0 项奖励
2,466 次查看
UrikRodriguez
NXP Employee
NXP Employee

HI @amei_liu,

Could you please open this question in the forum, as a new one, to have a better control of the cases?

Thank you

 

0 项奖励
2,461 次查看
amei_liu
Contributor II

ok.

0 项奖励
2,627 次查看
amei_liu
Contributor II

Before boot the Linux image, zero set the SRAM shared memory:

-dcache off

-mw.q 0x34000000 0x0 0x100000

Execute insmod ipc-dev-sample.ko and no error will be reported.

After that, I did the test as described in 6.5.4 of SW32R45_IPCF_4.3.0_D2203_UserManual.pdf, but after executing "echo 10>/sys/kernel/ipc-shm-sample-instance/ping", I did not see any print information and did not receive the data sent by M7.

The BSP version I use is 35.
Ipc-shm-dev.ko and ipc-shm-sample.ko come with BSP35, not recompiled by me。

See attachment for test log。

 

0 项奖励
2,618 次查看
UrikRodriguez
NXP Employee
NXP Employee

Yeah, that is because the kernel reports have an associated log level that defines the importance of the message. The kernel.printk defines which buffer message are printed in the console.

 

UrikRodriguez_0-1677689482934.png

To change this value you can use the command dmesg -n 7

UrikRodriguez_1-1677689632490.png

It uses "1" from the beginning because these log messages can cause misfunctions in other projects. 

UrikRodriguez_2-1677689919962.png

 

Let me know if this worked for you. 

 

0 项奖励
2,610 次查看
amei_liu
Contributor II

This problem has been solved.

Now the ipcf sample can run correctly.

Thank you very much for your help.

0 项奖励
2,802 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Could you please share name of your company? I need it to be able ask RADAR team.

Best regards,

Peter

0 项奖励