Jump to content
  • 0

Setup TFT and RFID SPI?


crossmax
 Share

Question

Hi to all!

I'm taking my first steps with an Orange Pi PC+. Before I did projects with raspberry pi, but the extra functionality provided by emmc memory has made me decant for orange pi. So my problems are related to the compatibility of gpio functionality.

 

I have two SPI devices (TFT and RFID reader), and I want use PA21 pin for SPI1_CS. I changed /boot/script.bin file for second SPI activate adding this lines:

 

[spi1]

spi_used = 1

spi_cs_bitmap = 1

spi_cs0 = port:PA21<2><1><default><default>

spi_sclk = port:PA14<2><default><default><default>

spi_mosi = port:PA15<2><default><default><default>

spi_miso = port:PA16<2><default><default><default>

 

but I get this error while booting:

 

[    0.616093] sunxi_spi_request_gpio()1420 - SPI1 devm_pinctrl_get() failed! return -22
[    0.616108] sunxi_spi_hw_init()1538 - [spi-1] Request GPIO failed!
[    0.616120] sunxi_spi_probe()1703 - spi hw init failed!
[    0.616200] spi: probe of spi1 failed with error -1
 

How I can setup my armbian to work with my old raspberry code?

 

Thanks in advance!! 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
5 minutes ago, crossmax said:

I want use PA21 pin for SPI1_CS.

Hardware SPI chip selects cannot be changed and the kernel does not support software SPI chip selects.

So you have following options:

  • Use GPIOs as chip selects and drive them from userspace
  • Patch the legacy kernel to support HW chip selects
  • Use experimental mainline kernel based images where software chip selects are supported by the kernel, but these images are provided with minimal support.
Link to comment
Share on other sites

Order Armbian Linux merch!

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...