Odroid N2 OLED I2C / SPI driver

Usually an RC circuit used for reset on power on…

From which voltage do you supply the display? 3V3 or 5V?
SSD1309 is only capable of max. 3V3 on the IO-Lines, so if you supply the reset pin out of 5V, it will result in EOS

The GPIO pin 1 of the odroid N2 gives only 3,3V so this should be okay.
I ordered two new displays from aliexpress so I can try again :smiley:

Then maybe it is time for me to pull my SPI display from the drawer and finish the pcb… :slight_smile:

I’ve got one on order so as soon as it arrives I’ll add support for it in SPI mode.

I know SPI support was recently add in CoreELEC but I don’t think it’s enabled by default, does anyone know how to enable it?

1 Like

Only the ftdput are required.

Thanks, is this permanent or would you need to do it every time CoreELEC is updated?

yes, on every update you need to enable again. there is some changes in background what will solve this issue but it’s not released yet…

@Portisch Ok, so I tried activating SPI on my Odroid N2 using

CoreELEC:~ # mount -o remount,rw /flash
CoreELEC:~ # fdtput -t s /flash/dtb.img /soc/cbus@ffd00000/spi@13000/spidev@0 status "okay"
CoreELEC:~ # fdtput -t s /flash/dtb.img /soc/cbus@ffd00000/spi@13000 status "okay"
CoreELEC:~ # reboot 

Now CoreELEC fails to boot, it just hangs at the CoreELEC logo screen, I’m using nightly 20200702

You maybe still have i2c enabled? I know some issues on C4 when i2c and SPI is enabled in same time. I tried your cmds and it boots up normally.

CoreELEC:~ # ls /dev/spi*
/dev/spidev0.0      /dev/spidev32766.0

Yep, SPI is active, I can still SSH into the box and ls /dev/spi* shows it’s active but CoreELEC is stuck on the boot logo.

I’ve downgraded to 20200626 and CoreELEC now boot s correctly so I’ll re-update to 20200702 and try it again.

Ok, so updating to 20200702 causes CoreELEC to hang at the boot logo, SPI isn’t active and I can still SSH into the box, so this maybe a 20200702 issue and I’ll post in the nightly thread.

journalctl -l --no-pager | paste

Argggghhh… Why are all my posts suddenly needing approval :frowning:

2 posts were merged into an existing topic: Nightly builds (NEW)

So I got one of the 2.42 inch SPI displays from China, and after connecting it to an Arduino via SPI and writing some simple test code I can confirm the display works perfectly fine in SPI mode.

However I can’t for the life of me get it to work via SPI on the N2.

I’ve enabled SPI on the N2 and confirmed it’s active.

I’ve converted my working Arduino code to python using this SPI library https://github.com/tomstokes/python-spi but I just can’t get the display to work.

I’m not sure if it’s a problem with the python SPI library I’m using or if the SPI interface on the N2 is even working.

Does anyone know of another pure python SPI library I could try? Or a simple way to test the SPI interface on the N2 actually works?

Just make a hardware loop from pin 19 (MOSI) to pin 21 (MISO) and use the spiddev_test from Hardkernel to test if the SPI works at all.

Yep, I saw that in the wiki https://wiki.odroid.com/odroid-n2/application_note/gpio/spi

How do I use spidev_test… CoreELEC has no gcc to compile it

./build.CoreELEC-Amlogic-ng.arm-9.2-devel/toolchain/bin/armv8a-libreelec-linux-gnueabi-gcc spidev_test.c -o spidev_test
in your CoreELEC clone directory

What exactly is “CoreELEC clone directory”?

Running that command from an SSH session gives

-sh: ./build.CoreELEC-Amlogic-ng.arm-9.2-devel/toolchain/bin/armv8a-libreelec-linux-gnueabi-gcc: not found