cancel
Showing results for 
Search instead for 
Did you mean: 

Drivers/modules uClinux on STM3210E_EVAL

hervieux
Associate II
Posted on March 15, 2010 at 11:17

Drivers/modules uClinux on STM3210E_EVAL

12 REPLIES 12
hervieux
Associate II
Posted on May 17, 2011 at 13:43

Hi,

I managed to compile my module ( ''hello_world''), but when I do I try the command ''insmod'', I get the following error:

''mydriver: unknown relocation: 10''

''insmod: can not insert` `mydriver.ko: invalid module format''

Yet, when I command ''modinf mydriver.ko'' I have the following message:

filename: mydriver.ko

License: GPL

author: Cedric Hervieux, RFID

Description: mydriver2

Depends:

vermagic: 2.6.26-UC0 ARMv7

parm: major: Static Major number (none = Dynamic) (int)

And so my ''vermagic'' corresponds with the version of my uClinux!

Someone would have an idea?

Thank you very much

Cédric

eagles8601
Associate II
Posted on May 17, 2011 at 13:43

Hello Cédric,

Your driver should be build as a static module (compiled within the kernel) module loader doesn't support thumb relocation.

You can put your driver under ''drivers/xxxx/yourmodule.c'' where xxxx is the driver sub category, and yourmodule.c is your driver module.

Under drivers/xxxx/ update ''Makefile''/''Kconfig'' files to compile the new module.

/*******************************************************/

in Kconfig :

config XXXX_MY_DRIVER

       bool ''Select my driver to be compiled or not''

        depends on XXX_OTHER_MODULE_IF_IT_DEPENDS_ON

       help

         Your module description ......

/*******************************************************/

in Makefile :

obj-$(CONFIG_XXXX_MY_DRIVER)                +=  yourmodule.o

/*******************************************************/

From the kernel configuration menu you can now select your driver to be compiled.

Rebuild the kernel and run it.

Good luck.

hervieux
Associate II
Posted on May 17, 2011 at 13:43

Hi,

Thank you very much for your help, I have now managed to insert my module.

Small remark, so I used the command ''mknod ...''

to create the special file ( ''/ dev / mydriver''), only I had the following error:

''read only file system''.

So I create the special file on my PC with ubuntu HOST in the directory ''romfs'' and I do a ''make image''.

Looks like it worked, thank you again for your help!

Cédric