# Driver compilation failed for Fusion Hat

**URL:** <https://forum.sunfounder.com/t/driver-compilation-failed-for-fusion-hat/4449>\
**Category:** Accessories for Raspberry Pi and Arduino\
**Created:** [March 6, 2026, 10:11pm UTC](https://forum.sunfounder.com/t/driver-compilation-failed-for-fusion-hat/4449 "2026-03-06T22:11:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![KevinJohn](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@KevinJohn](https://forum.sunfounder.com/u/KevinJohn)\
**Post date:** [March 6, 2026, 10:11pm UTC](https://forum.sunfounder.com/t/driver-compilation-failed-for-fusion-hat/4449/1 "2026-03-06T22:11:53Z")

</div>

I’ve recently bought the Fusion Hat and am trying to use it with my Raspberry Pi 3.

I’ve tried installing under Raspian Bullseye (Debian 11) and Raspian Bookworm (Debian 12) and keep getting the following errors in the install log and the installation script shows failure for compiling the driver:

#### ✗ Compile driver

Building Fusion Hat driver and device tree overlay…  
make -C /lib/modules/5.10.103-v7+/build M=/home/pi/fusion-hat/driver modules  
make[1]: Entering directory ‘/usr/src/linux-headers-5.10.103-v7+’  
CC [M] /home/pi/fusion-hat/driver/i2c.o  
CC [M] /home/pi/fusion-hat/driver/adc.o  
CC [M] /home/pi/fusion-hat/driver/battery.o  
/home/pi/fusion-hat/driver/battery.c: In function ‘fusion\_hat\_battery\_init’:  
/home/pi/fusion-hat/driver/battery.c:192:5: warning: ISO C90 forbids mixed decl\>  
192 | struct power\_supply\_config psy\_cfg = {};  
| ^ ~~~~~  
CC [M] /home/pi/fusion-hat/driver/shutdown.o  
CC [M] /home/pi/fusion-hat/driver/pwm.o  
/home/pi/fusion-hat/driver/pwm.c: In function ‘period\_store’:  
/home/pi/fusion-hat/driver/pwm.c:155:3: warning: ISO C90 forbids mixed declarat\>  
155 | uint32\_t frequency = 1000000 / period;  
| ^ ~~~~~~~  
/home/pi/fusion-hat/driver/pwm.c: In function ‘fusion\_hat\_pwm\_probe’:  
/home/pi/fusion-hat/driver/pwm.c:374:55: warning: passing argument 2 of ‘kobjec\>  
374 | ret = kobject\_init\_and\_add(&pwm\_channels[i].kobj, &pwm\_channel\_ktyp\>  
| ^ ~~~~~~~~~~~~~~~~~  
In file included from ./include/linux/energy\_model.h:7,  
from ./include/linux/device.h:16,  
from /home/pi/fusion-hat/driver/main.h:12,  
from /home/pi/fusion-hat/driver/pwm.c:10:  
./include/linux/kobject.h:99:44: note: expected ‘struct kobj\_type \*’ but argume\>  
99 | struct kobj\_type \*ktype, struct kobject \*paren\>  
| ~~~~~~~~~~~~^~~  
CC [M] /home/pi/fusion-hat/driver/button.o  
/home/pi/fusion-hat/driver/button.c: In function ‘fusion\_hat\_button\_poll\_work’:  
/home/pi/fusion-hat/driver/button.c:35:5: warning: ISO C90 forbids mixed declar\>  
35 | int ret = fusion\_hat\_i2c\_read\_byte(dev-\>client, CMD\_READ\_BUTTON\_STA\>  
| ^  
/home/pi/fusion-hat/driver/button.c:45:5: warning: ISO C90 forbids mixed declar\>  
45 | bool current\_state = (button\_status & 0x01);  
| ^~  
CC [M] /home/pi/fusion-hat/driver/led.o  
CC [M] /home/pi/fusion-hat/driver/speaker.o  
CC [M] /home/pi/fusion-hat/driver/main.o  
/home/pi/fusion-hat/driver/main.c: In function ‘fusion\_hat\_probe’:  
/home/pi/fusion-hat/driver/main.c:178:53: error: macro “class\_create” requires \>  
178 | fusion\_dev-\>class = class\_create(FUSION\_HAT\_NAME);  
| ^  
In file included from ./include/linux/device.h:31,  
from ./include/linux/acpi.h:15,  
from ./include/linux/i2c.h:13,  
from /home/pi/fusion-hat/driver/main.c:2:

#### ./include/linux/device/class.h:259: note: macro “class\_create” defined here

259 | #define class\_create(owner, name)  
|  
/home/pi/fusion-hat/driver/main.c:178:25: error: ‘class\_create’ undeclared (fir\>  
178 | fusion\_dev-\>class = class\_create(FUSION\_HAT\_NAME);  
| ^ ~~~~~~~~~~~  
| vfs\_create  
/home/pi/fusion-hat/driver/main.c:178:25: note: each undeclared identifier is r\>  
/home/pi/fusion-hat/driver/main.c: At top level:  
/home/pi/fusion-hat/driver/main.c:338:14: error: initialization of ‘int (_)(str\>  
338 | .probe = fusion\_hat\_probe,  
| ^ ~~~~~~~~~~~~~~~  
/home/pi/fusion-hat/driver/main.c:338:14: note: (near initialization for ‘fusio\>  
/home/pi/fusion-hat/driver/main.c:339:15: error: initialization of ‘int (_)(str\>  
339 | .remove = fusion\_hat\_remove,  
| ^ ~~~~~~~~~~~~~~~~  
/home/pi/fusion-hat/driver/main.c:339:15: note: (near initialization for ‘fusio\>  
cc1: some warnings being treated as errors  
make[2]: \*\*\* [scripts/Makefile.build:280: /home/pi/fusion-hat/driver/main.o] Er\>  
make[1]: \*\*\* [Makefile:1825: /home/pi/fusion-hat/driver] Error 2  
make[1]: Leaving directory ‘/usr/src/linux-headers-5.10.103-v7+’  
make: \*\*\* [Makefile:43: all] Error 2  
✗ Install driver  
Installing Fusion Hat driver and device tree overlay…  
rmmod fusion\_hat || echo "Warning: Failed to unload fusion\_hat module. It may b\>  
rmmod: ERROR: Module fusion\_hat is not currently loaded  
Warning: Failed to unload fusion\_hat module. It may be in use or require additi\>  
make[1]: Entering directory ‘/home/pi/fusion-hat/driver’  
Installing kernel module…  
make -C /lib/modules/5.10.103-v7+/build M=/home/pi/fusion-hat/driver modules\_in\>  
make[2]: Entering directory ‘/usr/src/linux-headers-5.10.103-v7+’  
cat: /home/pi/fusion-hat/driver/modules.order: No such file or directory  
DEPMOD 5.10.103-v7+  
Warning: modules\_install: missing ‘System.map’ file. Skipping depmod.  
make[2]: Leaving directory ‘/usr/src/linux-headers-5.10.103-v7+’  
Loading required IIO subsystem module…  
Updating module dependencies…  
depmod -a  
Module installation completed.

I’m not that adept with Linux but am doing the install as per the instructions:

#### curl -sSL [https://raw.githubusercontent.com/sunfounder/sunfounder-installer-scripts/main/install-fusion-hat.sh](https://raw.githubusercontent.com/sunfounder/sunfounder-installer-scripts/main/install-fusion-hat.sh) | sudo bash

Can someone advise how to resolve this please?

Thanks

---

<div class="post-metadata">

**Author:** ![mike22](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@mike22](https://forum.sunfounder.com/u/mike22)\
**Post date:** [March 7, 2026, 2:11am UTC](https://forum.sunfounder.com/t/driver-compilation-failed-for-fusion-hat/4449/2 "2026-03-07T02:11:24Z")

</div>

Hi Kevin,

I can see you have a Makefile Error 2 which could mean you are missing the Linux kernel headers required to build the fusion-hat library module. I had a similar issue building the library for Ubuntu 24.04 on a Pi5.

I posted the solution here [Cannot compile driver for Fusion-HAT+ on Pi5 running Ubuntu 24.04 with install script](https://forum.sunfounder.com/t/cannot-compile-driver-for-fusion-hat-on-pi5-running-ubuntu-24-04-with-install-script/4302)

After re-installing the missing Linux headers the install script and module build worked fine.

The install command will install the correct headers for the OS and version you have installed.

let me know if this works!

Mike

---

<div class="post-metadata">

**Author:** ![KevinJohn](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@KevinJohn](https://forum.sunfounder.com/u/KevinJohn)\
**Post date:** [March 7, 2026, 2:37am UTC](https://forum.sunfounder.com/t/driver-compilation-failed-for-fusion-hat/4449/3 "2026-03-07T02:37:09Z")

</div>

Hi Mike,

I tried that command earlier as I spotted your previous post, unfortunately it reported it couldn’t find the relevant Linux Headers file.

I’m getting a weird error with make, it’s reporting ISO C90 forbids mixed declarations for a number of the files and then bad arguments or invalid pointers in the main.h file.

I’ve been going round in circles trying to force make to use C99 using CFLAGS but I’m more a Windows person, my Unix history was Xenix, Solaris, SCO OpenServer, Novell UnixWare and some Red Hat when VMWare was using that as its core underlying OS, I haven’t really done Unix in quite some time.

Thanks

Kevin

---

<div class="post-metadata">

**Author:** ![mike22](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@mike22](https://forum.sunfounder.com/u/mike22)\
**Post date:** [March 7, 2026, 3:00am UTC](https://forum.sunfounder.com/t/driver-compilation-failed-for-fusion-hat/4449/4 "2026-03-07T03:00:54Z")

</div>

Bugger. It looked like your log threw more errors than my attempt. I doubt I can help. Consider getting a pi5? Or a pi4?

---

<div class="post-metadata">

**Author:** ![KevinJohn](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@KevinJohn](https://forum.sunfounder.com/u/KevinJohn)\
**Post date:** [March 7, 2026, 7:59am UTC](https://forum.sunfounder.com/t/driver-compilation-failed-for-fusion-hat/4449/5 "2026-03-07T07:59:00Z")

</div>

Yeah, it threw up a load of errors. I might re-image the USB stick with an older OS and try again since going newer didn’t work. If I got it working then I was considering getting a newer pi, but wanted to try it out with the 3B to start.

---

<div class="post-metadata">

**Author:** ![KevinJohn](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@KevinJohn](https://forum.sunfounder.com/u/KevinJohn)\
**Post date:** [March 10, 2026, 12:56am UTC](https://forum.sunfounder.com/t/driver-compilation-failed-for-fusion-hat/4449/6 "2026-03-10T00:56:05Z")

</div>

Well after re flashing the OS, the driver compiled. Having a different issue now but will create a new post for it.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [March 10, 2026, 9:36am UTC](https://forum.sunfounder.com/t/driver-compilation-failed-for-fusion-hat/4449/7 "2026-03-10T09:36:15Z")

</div>

We have not been able to reproduce your issue so far. We tested with a Raspberry Pi 3 Model B Rev 1.2 running the Bookworm 64-bit desktop system, and the installation worked without any problems.

Could you please let us know which Raspberry Pi model and operating system version you are using? We will test again based on your setup.

 ![image - 2026-03-10T173537.333](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/2X/d/d98bc6b5073bbceac8bfb1090167b5d4da4be36e.png)
