1

I am trying to compile a driver for a USB to serial converter.

I've ran the following commands based on a previous thread:

sudo apt-get update
sudo apt-get upgrade
sudo rpi-update

I then downloaded rpi-source and ran it without any errors:

rpi-source

When running make in the root directory of the I receive the following error:

make -C /lib/modules/4.9.25-v7+/build SUBDIRS=/home/pi/dmx_usb_module modules
make[1]: Entering directory '/home/pi/linux-525571c4df4066a61166b4b44cf5d757c2c53f5e'
  CC [M]  /home/pi/dmx_usb_module/dmx_usb.o
  Building modules, stage 2.
  MODPOST 1 modules
FATAL: parse error in symbol dump file
scripts/Makefile.modpost:91: recipe for target '__modpost' failed
make[2]: *** [__modpost] Error 1
Makefile:1493: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory '/home/pi/linux-525571c4df4066a61166b4b44cf5d757c2c53f5e'
Makefile:15: recipe for target 'default' failed
make: *** [default] Error 2

I've managed to compile this driver on two seperate Ubuntu desktop installations with no problem.

Any ideas? Thanks

UPDATE

I've changed the kernel back to 4.450. When I run uname -r:

4.4.50-v7+

I re-ran the rpi-source script with no errors. In the kernel source directory I have ran the following commands with no errors:

make prepare
make headers_check
make headers_install
make scripts

However, when running make from the driver folder I received the same error as above:

make -C /lib/modules/4.4.50-v7+/build SUBDIRS=/home/pi/dmx_usb_module modules
make[1]: Entering directory '/home/pi/linux-e223d71ef728c559aa865d0c5a4cedbdf8789cfd'
  Building modules, stage 2.
  MODPOST 1 modules
FATAL: parse error in symbol dump file
scripts/Makefile.modpost:91: recipe for target '__modpost' failed
make[2]: *** [__modpost] Error 1
Makefile:1405: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory '/home/pi/linux-e223d71ef728c559aa865d0c5a4cedbdf8789cfd'
Makefile:15: recipe for target 'default' failed
make: *** [default] Error 2

Here is the Makefile:

#
# $Id: Makefile 38 2004-09-11 11:15:09Z erwin $
#

ifneq ($(KERNELRELEASE),)

obj-m := dmx_usb.o

else

KDIR    := /lib/modules/$(shell uname -r)/build
PWD     := $(shell pwd)

default:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
        gcc -O2 -pipe -Wall dmx_usb_test.c -o dmx_usb_test

endif

clean:
        rm -f *.o *.ko
        rm -f dmx_usb_test
        rm -f dmx_usb.mod.c
        rm -f .dmx_usb.*
        rm -rf .tmp_versions
        rm -f Module.markers  modules.order  Module.symvers
MO92
  • 11
  • 1
  • 3

1 Answers1

1

Your first mistake is in running rpi-update

"In normal circumstances there is NEVER a need to run rpi-update as it always gets you to the leading edge firmware and kernel and because that may be a testing version it could leave your RPi unbootable". https://www.raspberrypi.org/forums/viewtopic.php?p=916911#p916911 Even the rpi-update documentation now warns "Even on Raspbian you should only use this with a good reason. This gets you the latest bleeding edge kernel/firmware."

sudo apt-get update; sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel will put it back to the stock kernel/bootcode.

THEN check that you have kernel headers which match the kernel you are using and try again. The current supported kernel is 4.4.50

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • I've updated the OP, still running into the same issue when trying to compile on 4.4.50 with correct headers – MO92 Apr 30 '17 at 17:53