Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Odroid C4 & SPI - anyone successful?

Featured Replies

Hi,

after a long time I started up my C4 and tried both the standard download kernel as well as a home compiled one.

I need SPI on the C4, so I changed the device tree to meson-sm1-odroid-c4-spidev.dtb, and see spidev kernel modul loaded, but no driver, and I don't get any signals on the corresponding pins.

Any help is appreciated - would be great to have SPI working again...

See you, Michael

Hello Michael,

 

Unfortunately I am bit late to the party, but it seems that you have to specify fdtfile in armbianEnv.txt. The path needs to be amlogic/..., exactly like discovered in

Otherwise you won't be able to boot and need to edit the file with another linux/unix. Add this to your /boot/armbianEnv.txt

# Add to /boot/armbianEnv.txt
fdtfile=amlogic/meson-sm1-odroid-c4-spidev.dtb
overlays=spi0 spi-spidev spidev # TODO check which one is the right one ;)
#param_spidev_spi_bus=0 # Not needed at least for spidev0.x

 

Changing the status to "okay" in meson-sm1-odroid-c4.dtb does not do the trick, despite getting high hopes reading https://wiki.odroid.com/odroid-c4/application_note/gpio/spi#tab__odroid-c4.

 

Nevertheless it can't hurt to check the status in meson-sm1-odroid-c4-spidev.dtd:

fdtget /boot/dtb/amlogic/meson-sm1-odroid-c4-spidev.dtb /soc/bus@ffd00000/spi@15000 status
fdtget /boot/dtb/amlogic/meson-sm1-odroid-c4-spidev.dtb /soc/bus@ffd00000/spi@15000/spidev@0 status

 

Make sure to load the spidev kernel module at startup, i.e. by adding to /etc/modules

# Append /etc/modules
spidev

 

Note: I did a diff between both de-compiled dtb files, but haven't checked yet, if something else could be affected by using the spidev variant.

 

Hope this helps! I would highly appreciate it, if you could have a look into the overlays= / param_spidev_bus= and report your findings. Thanks in advance!

 

Best,
Daniel G.

  • Author

Let me revive this thread, finally I found time to get into the issue again.
I use the latest C4 server image (Ubuntu 24.04).
Changes made so far: I added a line
 

fdtfile=amlogic/meson-sm1-odroid-c4-spidev.dtb

into the armbianEnv.txt, which seems at least to load the spidev kernel module.
A /dev/spidev0.0 is created, and I can use the standard test program found on https://github.com/KnCMiner/spi-test/blob/master/spi-test.c

It seems to work, there are no errors invoking the program, but the I/Os of SPI stay inactive, no matter what I do.

gpioinfo shows the lines on PIN_19, PIN_21, PIN_23 and PIN_24 as "unused":

Seem that basically the SPI controller is working, but the I/O mux is not setup correctly.

 

Anyone who can contribute here? I can test with logic analyzer, in case some input is given to me :)

 

  • Author

Thanks to Igor, I have a patch now in the build system (own branch - fix-spi-c4). Would be nice if someone could countercheck if that one also works in other place than mine.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.