Can't enable GPIO SPI on Odroid M1

Post Reply
ciaosonomichii
Posts: 8
Joined: Thu Nov 24, 2022 6:24 pm
languages_spoken: English, Italian
ODROIDs: M1
Has thanked: 2 times
Been thanked: 0
Contact:

Can't enable GPIO SPI on Odroid M1

Post by ciaosonomichii »

Hi, I have bought an Odroid M1 but i am having problems enabling GPIO SPI, I have followed the following guide https://wiki.odroid.com/odroid-m1/appli ... e/gpio/spi but still cannot get the SPI to work. How could i solve It? I also tried editing /boot/config.ini.

User avatar
joerg
Posts: 1729
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 155 times
Been thanked: 331 times
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by joerg »

What is the problem? Do you have an device at e.g. /dev/spidev0.0. Show how you have wired your external spi device. What OS, kernel, etc.
Without such information, nobody can help.

User avatar
mctom
Posts: 2254
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
Location: Gdansk, Poland
Has thanked: 280 times
Been thanked: 368 times
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by mctom »

Hi,

On the web page that you linked, make sure to click on "Odroid M1" link to get instructions for Odroid M1. Otherwise you will be shown the default instructions for Odroid XU4.

EDIT: And yes, all questions asked by @joerg also apply. :)
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

ciaosonomichii
Posts: 8
Joined: Thu Nov 24, 2022 6:24 pm
languages_spoken: English, Italian
ODROIDs: M1
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by ciaosonomichii »

joerg wrote:
Thu Nov 24, 2022 6:51 pm
What is the problem? Do you have an device at e.g. /dev/spidev0.0. Show how you have wired your external spi device. What OS, kernel, etc.
Without such information, nobody can help.
No, no spidev interface

ciaosonomichii
Posts: 8
Joined: Thu Nov 24, 2022 6:24 pm
languages_spoken: English, Italian
ODROIDs: M1
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by ciaosonomichii »

mctom wrote:
Thu Nov 24, 2022 6:56 pm
Hi,

On the web page that you linked, make sure to click on "Odroid M1" link to get instructions for Odroid M1. Otherwise you will be shown the default instructions for Odroid XU4.

EDIT: And yes, all questions asked by @joerg also apply. :)
Yes, already did
Nothing.

User avatar
mctom
Posts: 2254
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
Location: Gdansk, Poland
Has thanked: 280 times
Been thanked: 368 times
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by mctom »

so, what OS are you using, and which kernel?
An output of uname -a will help.
These users thanked the author mctom for the post:
ciaosonomichii (Fri Nov 25, 2022 2:44 am)
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

User avatar
joerg
Posts: 1729
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 155 times
Been thanked: 331 times
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by joerg »

So, did you tried the fdt or the dtbo overlay variant?
I would recommend the dtbo overlay variant. Thus must be overlays="spi0 i2c0 i2c1 uart0" in config.ini.
These users thanked the author joerg for the post:
ciaosonomichii (Fri Nov 25, 2022 2:45 am)

ciaosonomichii
Posts: 8
Joined: Thu Nov 24, 2022 6:24 pm
languages_spoken: English, Italian
ODROIDs: M1
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by ciaosonomichii »

mctom wrote:
Thu Nov 24, 2022 8:10 pm
so, what OS are you using, and which kernel?
An output of uname -a will help.
Here it is.
Attachments
photo_2022-11-24_18-45-30.jpg
photo_2022-11-24_18-45-30.jpg (14.68 KiB) Viewed 103 times

ciaosonomichii
Posts: 8
Joined: Thu Nov 24, 2022 6:24 pm
languages_spoken: English, Italian
ODROIDs: M1
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by ciaosonomichii »

joerg wrote:
Thu Nov 24, 2022 8:30 pm
So, did you tried the fdt or the dtbo overlay variant?
I would recommend the dtbo overlay variant. Thus must be overlays="spi0 i2c0 i2c1 uart0" in config.ini.
Already did that.
Attachments
photo_2022-11-24_18-46-31.jpg
photo_2022-11-24_18-46-31.jpg (20.11 KiB) Viewed 102 times

User avatar
tobetter
Posts: 10971
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 738 times
Been thanked: 1868 times
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by tobetter »

@ciaosonomichii, you should try Ubuntu 20.04 with Linux 4.19, not using Linux kernel 5.x yet.
These users thanked the author tobetter for the post:
joerg (Fri Nov 25, 2022 3:32 am)

User avatar
joerg
Posts: 1729
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 155 times
Been thanked: 331 times
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by joerg »

The description in wiki can't work with your kernel 5.18. It's for kernel 4.19, stock kernel from Hardkernel distro.
Or, do you have any overlay files in the /boot folder and sub folders?
The fdt alternative also can't work as described. It's pointing to /boot/dtbs/4.19.219-odroid-arm64/rockchip/rk3568-odroid-m1.dtb.
Find the dtb file used with Bullseye OS. It should be also in boot sub folder.
Then try the command from wiki with this dtb file, like:
sudo fdtput -t s /boot/<place-found-file-here>.dtb spi0 status "okay"
With luck it works, if spi0 is defined in the dtb.

[edit]
Just wrote this during answer of @tobetter
These users thanked the author joerg for the post:
tobetter (Fri Nov 25, 2022 3:44 am)

ciaosonomichii
Posts: 8
Joined: Thu Nov 24, 2022 6:24 pm
languages_spoken: English, Italian
ODROIDs: M1
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by ciaosonomichii »

joerg wrote:
Fri Nov 25, 2022 3:32 am
The description in wiki can't work with your kernel 5.18. It's for kernel 4.19, stock kernel from Hardkernel distro.
Or, do you have any overlay files in the /boot folder and sub folders?
The fdt alternative also can't work as described. It's pointing to /boot/dtbs/4.19.219-odroid-arm64/rockchip/rk3568-odroid-m1.dtb.
Find the dtb file used with Bullseye OS. It should be also in boot sub folder.
Then try the command from wiki with this dtb file, like:
sudo fdtput -t s /boot/<place-found-file-here>.dtb spi0 status "okay"
With luck it works, if spi0 is defined in the dtb.

[edit]
Just wrote this during answer of @tobetter
So there is no method to get this working on Debian?

No overlays file in boot folder

User avatar
joerg
Posts: 1729
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 155 times
Been thanked: 331 times
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by joerg »

Look, on my C4, it is looking as this:

Code: Select all

#tree /boot/dtbs
/boot/dtbs
└── 5.15.0-odroid-arm64
    ├── amlogic
    │   ├── meson64_odroidc2.dtb
    │   ├── meson64_odroidc4.dtb
    │   ├── meson64_odroidhc4.dtb
    │   ├── meson64_odroidn2.dtb
    │   ├── meson64_odroidn2_plus.dtb
    │   ├── meson-g12b-odroid-n2.dtb
    │   ├── meson-g12b-odroid-n2-plus.dtb
    │   ├── meson-gxbb-odroidc2.dtb
    │   ├── meson-sm1-odroid-c4.dtb
    │   ├── meson-sm1-odroid-hc4.dtb
    │   └── overlays
    │       ├── odroidc4
    │       │   ├── can01.dtbo
    │       │   ├── can0.dtbo
    │       │   ├── can1.dtbo
    │       │   ├── display_vu7c.dtbo
    │       │   ├── hifishield2.dtbo
    │       │   ├── hktft32.dtbo
    │       │   ├── hktft35.dtbo
    │       │   ├── i2c0.dtbo
    │       │   ├── i2c1.dtbo
    │       │   ├── pcf8563.dtbo
    │       │   ├── pwm_ab.dtbo
    │       │   ├── spi0.dtbo
    │       │   ├── sx865x-i2c1.dtbo
    │       │   ├── uart0.dtbo
    │       │   ├── uart1.dtbo
    │       │   ├── uart2.dtbo
    │       │   ├── uart3.dtbo
    │       │   ├── w1-gpio_p15.dtbo
    │       │   └── w1-gpio_p22.dtbo
    │       └── odroidn2
    │           ├── fanspeed-full.dtbo
    │           ├── hktft35.dtbo
    │           ├── i2c0.dtbo
    │           ├── i2c1.dtbo
    │           ├── pwm_cd.dtbo
    │           ├── pwm_ef.dtbo
    │           ├── pwmfan-lowtemp.dtbo
    │           ├── spi0.dtbo
    │           ├── sx865x-i2c1.dtbo
    │           ├── uart0.dtbo
    │           ├── uart1.dtbo
    │           ├── w1-gpio_p15.dtbo
    │           └── w1-gpio_p22.dtbo
    └── meson64_odroidc4.dtb -> amlogic/meson64_odroidc4.dtb

You need to find the valid .dtb file. And then try the fdtput command. If this is not working: No, you can't use spi on M1 Bullseye with mainline kernel.
Can you show the output of tree /boot?

ciaosonomichii
Posts: 8
Joined: Thu Nov 24, 2022 6:24 pm
languages_spoken: English, Italian
ODROIDs: M1
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by ciaosonomichii »

No, Nothing like this, i'm installing via netboot Ubuntu 20.04

ciaosonomichii
Posts: 8
Joined: Thu Nov 24, 2022 6:24 pm
languages_spoken: English, Italian
ODROIDs: M1
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by ciaosonomichii »

News: I solved that after the suggest of @tobetter to reinstall the os to Ubuntu 20.04 with kernel 19.x

User avatar
mctom
Posts: 2254
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: OGA, XU4, C2, M1, H3+, SP3, Vu8M
Location: Gdansk, Poland
Has thanked: 280 times
Been thanked: 368 times
Contact:

Re: Can't enable GPIO SPI on Odroid M1

Post by mctom »

that's 4.19.x and I'm glad to hear yet again the only problem was the experimental OS.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 2 guests