lexus2k / ssd1306

Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms
MIT License
662 stars 127 forks source link

SSD1331 demo failing #136

Open sgjava opened 2 years ago

sgjava commented 2 years ago
make: Entering directory '/home/servadmin/ssd1306/examples'
make -C ../src -f Makefile.linux MCU= SDL_EMULATION= \
                     ADAFRUIT=
make[1]: Entering directory '/home/servadmin/ssd1306/src'
make[1]: Nothing to be done for 'default'.
make[1]: Leaving directory '/home/servadmin/ssd1306/src'
mkdir -p ../bld/demos/
cc -o ../bld/demos/ssd1331_demo.out -g -Os -w -ffreestanding -MD -g -Os -w -ffreestanding -I./demos/ssd1331_demo -I../src -Wall -Werror -Wl,--gc-sections -ffunction-sections -fdata-sections  ../bld/main.o ../bld/demos/ssd1331_demo/sova.o ../bld/demos/ssd1331_demo/ssd1331_demo.o -L../bld -lssd1306
../bld/demos/ssd1331_demo.out
Failed to initialize SPI: No such file or directory!
^Cmake: *** [Makefile.linux:52: flash] Interrupt

I assume there's a way to set SPI device and pins for DC and RESET? Also I shouldn't have to run as root as I have the permissions set for non-root user on SPI device.

lexus2k commented 2 years ago

Do you have spidev kernel module loaded? Does the application have access privileges to kernel module driver? What is the configuration of the target system?

sgjava commented 2 years ago

Doesn't it use spidev from userspace?

lexus2k commented 2 years ago

Yes, it use spidev from userspace, but accessing to spi char devices requires root privileges

sgjava commented 2 years ago

I just use a script to set permissions https://github.com/sgjava/javauio/blob/main/scripts/uio-permissions.sh I mean I use u8g2 fine with https://github.com/olikraus/u8g2/tree/master/sys/arm-linux You can see where I committed changes to use c-periphery.