aawood
Posts: 7
Joined: Tue Apr 17, 2012 3:56 pm

systemd.modules.load fails, modprobe works

Wed Feb 03, 2016 10:28 pm

'lo peeps!

I picked up a 3.5inch Waveshare Screen for my Pi Zero and, by vaguely following this guide and working around the issues (in particular, rpi-update needs to be followed up by replacing some boot files, from pre-update backups, no idea why), I've got it basically working. Basically.

One issue is that the kernel modules don't load during startup. They're set up in /etc/modules as per the guide, should all be fine, but no go. 'systemctl status systemd-modules-load' gives:

Code: Select all

systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/lib/systemd/system/systemd-modules-load.service; static)
   Active: failed (Result: exit-code) since Wed 2016-02-03 22:14:40 UTC; 1min 21s ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 1079 ExecStart=/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
 Main PID: 1079 (code=exited, status=1/FAILURE)

Feb 03 22:14:40 raspberrypi systemd-modules-load[1079]: Failed to find module 'flexfb regwidth=16 nobacklight init=-1,0xb0,0x0,-1,0x11,-2,250,-1,0x3A,0x55,-1,0xC2,0x44,-1,0xC5,0x00,0x00,0x00,0x00,-1,0xE0,0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00,-1,0xE1,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0xE2,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0x36,0x28,-1,0x11,-1,0x29,-3 width=480 height=320'
Feb 03 22:14:40 raspberrypi systemd-modules-load[1079]: Failed to find module 'fbtft_device name=flexfb speed=16000000 gpios=reset:25,dc:24'
Feb 03 22:14:40 raspberrypi systemd[1]: systemd-modules-load.service: main process exited, code=exited, status=1/FAILURE
Feb 03 22:14:40 raspberrypi systemd[1]: Failed to start Load Kernel Modules.
Feb 03 22:14:40 raspberrypi systemd[1]: Unit systemd-modules-load.service entered failed state.

Boot the Pi, white screen, no go. However, manually modprobing instead...

Code: Select all

sudo modprobe flexfb nobacklight regwidth=16 init=-1,0xb0,0x0,-1,0x11,-2,250,-1,0x3A,0x55,-1,0xC2,0x44,-1,0xC5,0x00,0x00,0x00,0x00,-1,0xE0,0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00,-1,0xE1,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0xE2,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0x36,0x28,-1,0x11,-1,0x29,-3 width=480 height=320
sudo modprobe fbtft_device name=flexfb speed=16000000 gpios=reset:25,dc:24
Works, no problem. (Well, SOME problem, if I try booting to lightdm rather than just the console I just get a blinking cursor, but that's another issue for another time).

I've had a look online, but every solution I can find for a systemd-modules-load failure is stop trying to load the modules that are failing (with the implication they don't exist and aren't needed), which isn't exactly helpful here; I'm not just trying to clear an error message, I need these to load. I can kludge it by setting the modprobe commands to run at each boot within init.d or something, but that doesn't seem proper. How do I track this down?

marco.foschian
Posts: 1
Joined: Sun Feb 14, 2016 4:52 pm

Re: systemd.modules.load fails, modprobe works

Sun Feb 14, 2016 5:03 pm

Spent a couple of hours on this.
The trick is to put the module parameters in /etc/modprobe.d
Make a file for each module with a line formatted as

options modulename opt1 opt2 ...

i.e. :

/etc/modprobe.d/fbtft_device.conf

with content

Code: Select all

options fbtft_device name=flexfb gpios=dc:22,reset:27 speed=48000000
Of course, I've had to enable module spi-bcm2708 before fbtft_device, so finally my /etc/modules is

Code: Select all

snd-bcm2835
#i2c-bcm2708  
i2c-dev

spi-bcm2708  

flexfb
fbtft_device
#flexfb
Now I have to fight to get the touchscreen working.
Some suggestions ?

DirkS
Posts: 10759
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: systemd.modules.load fails, modprobe works

Sun Feb 14, 2016 5:52 pm

if your screen is using ads7846 / xpt2046 it should work with the device tree overlays. See https://github.com/raspberrypi/firmware ... t/overlays

Code: Select all

dtparam=spi
dtoverlay=dtoverlay=ads7846,speed=1000000,penirq=17
That overlay command may need more parameters.

Alternatively you could try to use the device tree overlays from https://github.com/swkim01/waveshare-dtoverlays to get screen and touch working.

Return to “Troubleshooting”