2024年2月17日 星期六

ZYNQ add SPI interface and petalinux device tree

 ZYNQ add SPI interface

  1. Open “Open Block Diagram”
  2. Add “AXI QUAD SPI” block
  3. Run “Run Conection Automation”
  4. Generate Bitstream
  5. Open “Open Implementation Design”
  6. Switch to “I/O Planning” and select “I/O Ports”

  1. Pin assign for SPI interface


  1. Generate Bitstream and export hardware

Customize SPI device tree for petalinux

After update HDF and execute command: petalinux-config –get-hw-description=<HDF Directory>

In components/plnx_workspace/device-tree/device-tree/pl.dtsi, will produce SPI device node automatically as below:

Modify project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi as below

Enable SPI device driver

$ petalinux-config -c kernel

Go to Device Drivers -> SPI Support -> User mode SPI device driver support and enable it.

Use spidev_test.c to verify the SPI interface.

$ ls /dev/spi*

$ gcc spidev_test.c -o spidev_test

$ ./spidev_test -D /dev/spidev1.0

沒有留言:

張貼留言

BlueTea螢幕錄影程式

  螢幕錄影新選擇:簡單、方便、免費 現在的螢幕錄影工具多樣,但安裝麻煩、操作複雜讓人卻步。我們推出了一款全新的螢幕錄影程式,專為追求簡單和效率的你設計。 1. 免安裝 無需安裝程式。解壓縮後點兩下就可以開始使用 2. 可選取錄影範圍 自由選擇全螢幕、特定視窗或自定義區域,靈活應...