insmod: ERROR: could not insert module

Applications, development tools, FPGA, C, WEB
Post Reply
pita
Posts: 17
Joined: Mon Oct 05, 2015 12:00 pm

insmod: ERROR: could not insert module

Post by pita » Thu Feb 18, 2016 12:17 pm

Howdy cowboys ! :mrgreen:

I compiled the rpad driver from viewtopic.php?f=7&t=317 by linking it towards the linux-xlnx-xilinx-v2015.4.01 version.
Here's the adapted makefile.

Code: Select all

obj-m += rpad.o

rpad-y := rp_pl.o rp_pl_hw.o rp_hk.o rp_scope.o rp_asg.o

all:
	$(Q)$(MAKE) ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- -C ../../../linux-xlnx-xilinx-v2015.4.01 M=$(PWD)/src modules

clean:
	$(Q)$(MAKE) ARCH=arm -C ../../../linux-xlnx-xilinx-v2015.4.01 M=$(PWD)/OS/driver/rpad/src clean

The rpad.ko binary compiles fine, but when I give it a insmod - that's what I get back:

Code: Select all

insmod: ERROR: could not insert module /tmp/rpad.ko: No such device or address
[edit] AH yeah I should mention here that the file /tmp/rpad.ko exists.. so the output of insmod is
somewhat misleading here. Could also be an issue with the wrong ld-linux.so.3 loader or broken
dynamic linkage something like that.. [edit]

I tried inserting rpad.ko with two different versions of the RedPitaya OS:
- manually built version of the latest RedPitaya master branch. [ based onna linux-xlnx-xilinx-v2015.4.01 kernel]
- latest version of the red_pitaya_OS-stable.img.zip from website. [from 21 Dec 2015]

insmod isn't very verbose about what went wrong as You can see..
Am I missing something ?


Best regards
pita

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: insmod: ERROR: could not insert module

Post by Nils Roos » Thu Feb 18, 2016 1:40 pm

I haven't tried building the module on the current release myself, so I can't tell you if it will ultimately be possible to load it.

I can however say that there is one thing that is definitely wrong with the Makefile, you need to change the cross-compiler (I think "arm-linux-gnueabihf-" would be the right one). Building for the wrong architecture leads to the less-than-clear error messages when handling executable files.

pita
Posts: 17
Joined: Mon Oct 05, 2015 12:00 pm

Re: insmod: ERROR: could not insert module

Post by pita » Thu Feb 18, 2016 3:22 pm

Ah okay !
Hm.. I already built my manually compiled version with the arm-xilinx-linux-gnueabi- compiler.
I first tried the arm-linux-gnueabihf-, but I then got an error during OS build where it said "your compiler is too buggy"
and compilation failed. So I switched to gnueabi..
Maybe my ubuntu gnueabihf version 4.8 interferes when doing CROSS_COMPILE=arm-xilinx-linux-gnueabihf-..
Will try to fix this.

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: insmod: ERROR: could not insert module

Post by Nils Roos » Thu Feb 18, 2016 5:01 pm

when doing CROSS_COMPILE=arm-xilinx-linux-gnueabihf-..
Do not use "arm-xilinx-linux-gnueabihf-", just "arm-linux-gnueabihf-".

pita
Posts: 17
Joined: Mon Oct 05, 2015 12:00 pm

Re: insmod: ERROR: could not insert module

Post by pita » Thu Feb 18, 2016 9:24 pm

Sorry, that was a typo ! I been already using CROSS_COMPILE=arm-linux-gnueabihf-.
I was now able to fix my OS version to arm-linux-gnueabihf-,
as well as the rpad driver.

But the issue "insmod: ERROR: could not insert module /tmp/rpad.ko: No such device or address" still remains..

pita
Posts: 17
Joined: Mon Oct 05, 2015 12:00 pm

Re: insmod: ERROR: could not insert module

Post by pita » Thu Feb 18, 2016 9:41 pm

Aaah okay - output of dmesg gives:

Code: Select all

[   41.464191] rpad: no supported RPAD PL found
[   41.467085] Module rpad not loaded
[  126.245181] random: nonblocking pool is initialized
[  821.696276] rpad: no supported RPAD PL found
[  821.699206] Module rpad not loaded
[  861.818169] rpad: no supported RPAD PL found
[  861.821063] Module rpad not loaded
[  969.622976] rpad: no supported RPAD PL found
[  969.625905] Module rpad not loaded


Actually this should only be the case if there's no supported RPAD PL as in the driver's init function.
But I did a cat /tmp/ddrdump.bin > /dev/xdevcfg before.. so why he doesn't find it.. hm...

[edit] I am directly using the ddrdump.bin binary given as a download in viewtopic.php?f=7&t=317,
that's okay, isn't it ?

By the way I couldn't run that "nginx -p /opt/www" command.
It gave me a

Code: Select all

nginx: symbol lookup error: nginx: undefined symbol: _ZNSt8ios_base4Init11_S_refcountE


I did a export LD_LIBRARY_PATH=/opt/redpitaya/lib before.
But actually.. RPAD and PL should be working even without nginx.
[edit]

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: insmod: ERROR: could not insert module

Post by Nils Roos » Thu Feb 18, 2016 10:31 pm

Oops, maybe it's time I updated the links on the first post of the topic. The first version was just a demonstration and didn't include the versioning fields - among other things. You can easily test for the right version with

Code: Select all

monitor 0x7fff0000
It should output 0xfff00001 or greater.

Use the ddrdump.bin from this download.
By the way I couldn't run that "nginx -p /opt/www" command.
With the 0.94 ecosystem, nginx is controlled by systemd. Use "systemctl start/stop redpitaya_nginx".

pita
Posts: 17
Joined: Mon Oct 05, 2015 12:00 pm

Re: insmod: ERROR: could not insert module

Post by pita » Thu Feb 18, 2016 11:28 pm

STRIKEFLASH !!!! It works.

Thank You very very much ! Sowww awwwesome it works now. :)
ARRRRR where's that smiley with the eye patch ? XD


Best regards
pita

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 104 guests