2010-03-15 03:17 AM
Drivers/modules uClinux on STM3210E_EVAL
2011-05-17 04:43 AM
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
2011-05-17 04:43 AM
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.2011-05-17 04:43 AM
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