Intel:Cyclone® V SoC において、SPI Master Module の spim0 でアクセスしたいのですが、u-boot でのリード/ライトコマンドの具体例を教えてください

Cyclone SoC EDS/DS-5 SoC FPGA

カテゴリー:SoC
ツール:SoC EDS
デバイス:Cyclone® V

SPI としては sspi というコマンドが Uboot に用意されています。
デフォルトの状態では使用できるようになっていませんが、下記修正を加えることにより sspi コマンドが使用できるようになります。

ファイル: /uboot-socfpga/include/configs/socfpga_common.h
編集内容: ファイルに #define CONFIG_CMD_SPI を追加

(例)549~552 行目に下記を 追加

/* 
 * SPI CMD support
 */
#define CONFIG_CMD_SPI

(参考)編集内容を反映させたファイル

コマンド使用方法については、下記ファイルを参考にしてください。

ファイル: /uboot-socfpga/common/cmd_spi.c

U_BOOT_CMD(
	sspi,	5,	1,	do_spi,
	"SPI utility command",
	"[<bus>:]<cs>[.<mode>] <bit_len> <dout> - Send and receive bits"
	"<bus>     - Identifies the SPI bus"
	"<cs>      - Identifies the chip select"
	"<mode>    - Identifies the SPI mode to use"
	"<bit_len> - Number of bits to send (base 10)"
	"<dout>    - Hexadecimal string that gets sent"
);

経験豊富なFAEが
無料でご相談を承ります。

特定製品の仕様からパーツの選定まで、当社のFAEが皆様のテクニカルなお悩みに無料で回答します。ぜひ、お気軽にご相談ください。