Jump to content

mmax

Members
  • Posts

    3
  • Joined

  • Last visited

  1. I installed the kernel-source package (created when compiling armbian in Ubuntu VM) and compiled my module against this directory. Now the "preemt" tag appeared in the vmagic string but the tag "sunxi" got lost. Currently the vermagic string of my module is "4.19.36+ SMP preempt mod_unload ARMv7 thumb2 p2v8" but it should be "4.19.36-sunxi SMP preempt mod_unload ARMv7 thumb2 p2v8" Any Idea?
  2. Hi, I am trying to write my own kernel module/drive for the NanoPi air, running a self-compiled version of armbian 5.83. Actually I only added the PREEMTION option to get real-time behavior when reading/writing from IO pins. I started using the "hello world" template from here. To get the module compiled I had to build the headers for my kernel as well using the option INSTALL_HEADERS in the armbian-build config file. The build debian-package called "linux-headers-next-sunxi_5.83_armhf.deb" was copied and installed on the NanoPi. OK, so now compiling (on the NanoPi - so no cross-compilation) works like a charm: > make make -C /lib/modules/4.19.36-sunxi/build M=/home/gresy/Examples modules make[1]: Entering directory '/usr/src/linux-headers-4.19.36-sunxi' CC [M] /home/gresy/Examples/hello.o Building modules, stage 2. MODPOST 1 modules CC /home/gresy/Examples/hello.mod.o LD [M] /home/gresy/Examples/hello.ko make[1]: Leaving directory '/usr/src/linux-headers-4.19.36-sunxi' But when I try to load the hello-world module it's rejected: > sudo insmod hello.ko insmod: ERROR: could not insert module hello.ko: Invalid module format The following message shows up in the kernel buffer, which implies to me the module is not "preemtion compatible" ... if that's possible at all. Or at least the version magic is wrong. > dmesg ... [ 710.970775] hello: version magic '4.19.36-sunxi SMP mod_unload ARMv7 thumb2 p2v8 ' should be '4.19.36-sunxi SMP preempt mod_unload ARMv7 thumb2 p2v8 ' Here some other information which might be useful: > sudo modinfo hello.ko filename: /home/gresy/Examples/hello.ko version: 0.1 description: A simple Hello world LKM! author: Akshat Sinha license: GPL srcversion: B7B3CF8B5A8284B3911C7AF depends: name: hello vermagic: 4.19.36-sunxi SMP mod_unload ARMv7 thumb2 p2v8 > uname -a Linux nanopiair 4.19.36-sunxi #5.83 SMP PREEMPT Tue Apr 30 11:04:15 CEST 2019 armv7l GNU/Linux So, does anyone know why the module will not get loaded? Thanks for your help, Markus
  3. Happy new year everyone, I am working on a project where I want to control two brushed DC motors equipped with a magnetic encoder and driven by a H-bridge circuit. All this has to be done on a tiny arm board (with enough cpu power for other computations), and I decided to go for the NanoPi NEO Air. I compiled the actual mainline Kernel with realtime capability (turned PREEEMTIVE on in menuconfig, hope that's enough) and debian streched. One issue might be the tight and constraining timing when sampling the magnetic encoder, which generates two 1.6kHz (about 0.6ms) pulses for each motor. I guess it would be best to get an interrupt generated at each rising edge for one signal/pin. The second signal indicated the direction of the motor and can get read within the interrupt routine. All this has to be done two times because of the two motors. So does anyone know if this is possible on the NanoPI with RT Linux? On the other side I am just looking around what ways there are to access the GPIO pins and found several like WiringNP (aka WiringPi and others), wiringX, GPIO via SysFS, and maybe others. I prefer writing my application in ansi C ... so which way to access the GPIOs would you recommend? I appreciate every feedback.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines