1

Ater setting up my Raspberry Pi Zero W with DietPi v150 I activated I2C module via the dietpi-config tool. However, I need to use SPI in addition and since there is no such option in the config tool I decided to go the manual way and edit /boot/config.txt. The original part of the file looks like this:

#-------spi-------------
dtparam=spi=off

Which I changed into:

#-------spi-------------
dtparam=spi=on

After saving the file and double-checking its contents again I rebooted the system by sudo reboot and reconnected via ssh dietpi@192.168.0.1.

I wanted to check whether the SPI module has been loaded correctly. So I typed lsmod | grep 'spi*' which printed nothing. So it seems that the module was not loaded and I tried ls /dev/sp* which raised ls: cannot access /dev/sp*: No such file or directory. In order to get a clue about what was going on here I had a look into /boot/config.txt again:

#-------spi-------------
dtparam=spi=off

Which shows that SPI module should not be activated when booting the system. Since I edited the file, as described above, I think that somewhat replaces the /boot/config.txt with the default one during boot process.

I had another look around the Internet and found this forum entry which is essentially the same procedure I used to enable SPI module and check its activation. Since they use DietPi as well, I am a bit confues about what is going on here.

Does anyone which process is overriding my edited /boot/config.txt during start-up or how I am able to enable the SPI module on DietPi?

1

I figured out, that the /boot/config.txt is not accessed during system boot because of an additional version of this file on the DietPi-RamDisk.

The very first lines of the /boot/config.txt contain the following hint:

#Modifcations to /boot/* files, will not be saved when powered on.
#Please ensure you edit from the DietPi-RamDisk location /DietPi/*

So after accessing the correct version of the config.txt in /DietPi/config.txt, editing the desired line from

#-------spi-------------
dtparam=spi=off

to

#-------spi-------------
dtparam=spi=on

and the mandatory reboot the SPI module is loaded correctly as shown by:

dietpi@DietPi:~$ lsmod | grep spi
spidev                  7034  0 
spi_bcm2835             7424  0 

Note: A similar issue was discussed on the DietPi forum

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.