Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: i2c, spi & ethernet? #1

Closed
peterberbec opened this issue Jul 4, 2018 · 12 comments
Closed

Question: i2c, spi & ethernet? #1

peterberbec opened this issue Jul 4, 2018 · 12 comments

Comments

@peterberbec
Copy link
Contributor

Just wondering if this image supports i2c, spi and ethernet?

Thanks for all the work.

@avafinger
Copy link
Owner

I updated to kernel 4.17.4 recently and will check if that is working. For the current Image, ethernet should be working. i2c and spi must be activated. Decompile the DTB and change status = "disabled"; to status = "okay";

@peterberbec
Copy link
Contributor Author

Got it! Would sharing the new file be helpful?

@avafinger
Copy link
Owner

@peterberbec
Can you please try the new kernel 4.17.4 with i2c, spi and ethernet enabled and see if it works as expected?

I have updated github but due to size constraint I pushed an SD CARD 8GB Image to mega, please use 7zip to unzip and flash it to SD CARD using etcher or win32diskimager.

Link: https://mega.nz/#!obIAVQiA!G0CCABkLunCcG8hEqMf7NfjTBK1jgMytt2f0VdtOl08

@peterberbec
Copy link
Contributor Author

I think I got it working by recompiling the dtb file. I currently have an i2c display working. I just have to figure spi out. I just don't have an spi-only device.

@avafinger
Copy link
Owner

OK.
The new release has two DTB files which employes different DVFS:
bpi-m2-zero-v1.dtb_4.17.4-m2z (conservative DVFS)
bpi-m2-zero-v2.dtb_4.17.4-m2z (aggressive DVFS)

default: bpi-m2-zero.dtb -> bpi-m2-zero-v1.dtb_4.17.4-m2z

In the final, they work very similarly and is hard to tell which one is best, unless you push the CPU to its limits.

@peterberbec
Copy link
Contributor Author

Whatever was current when I posted the issue, Linux bpi0 4.15.7-h2-4 #1 SMP Thu Mar 8 17:41:45 -03 2018 armv7l armv7l armv7l GNU/Linux has excellent power management. It is lightyears cooler than the banana kernels.

@peterberbec
Copy link
Contributor Author

Is the DTB where I enable gpio support?

@avafinger
Copy link
Owner

I think for gpio you should use GPIO SYSFS userspace:
https://www.kernel.org/doc/Documentation/gpio/sysfs.txt

@avafinger
Copy link
Owner

You can resort to http://linux-sunxi.org/GPIO

@peterberbec
Copy link
Contributor Author

Again, thanks for the great build. I'm trying to get a https://github.com/PiSupply/PaPiRus working. It needs i2c and spi. I've recompiled the dtb file to enable both. I have an spi display to test. I've gotten an i2c display to work.

Neither both the PaPiRus nor the spi display (simple ssd1306 - same as the i2c board) work. Is there something I should look at for testing SPI functionality? GPIO functionality should be easy - connect a volt meter and see if things light up when i set one as output and one as input.

@avafinger
Copy link
Owner

I had ssd1306 working with i2c-0 on the v2 build. Things you should check:

  • Wiring the ssd1306 to SDA and CLK pins, check if you have SSD1306 that works with 3.3v or 5v. If it is a 3.3v one and you wired 5v, you lost the sdd1306

  • Check the software side to talk to ssd1306. Check dmesg for any errors

  • check if you have the i2c dev nodes:
    sudo ls /dev/i2c*

For the SPI LCD it is a way more complex, you need to make sure the pins you will be using are not shared or in use by another device, for example uart. You need to change the settings on the DTB.

To check if you have wired the SPI LCD correctly i would suggest reading:
https://github.com/avafinger/Ubuntu-18.04-LTS-Bionic-Beaver-on-H5#wiring-28-tft-display-to-the-boards

And use https://github.com/bitbank2/SPI_LCD to check if it is working, it rescued me on the above case.

@peterberbec
Copy link
Contributor Author

Thanks for the help! I'll keep playing with SPI, but I2C works fine for me. My dream is getting that PaPiRus Zero to work, but that'll take crazy rewrites of the fuse library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants