Intel: I would like to access the Cyclone® V SoC with spim0 of the SPI Master Module. Please give me a specific example of read/write commands in u-boot

Cyclone SoC EDS/DS-5 SoC FPGAs

Category: SoCs
Tool: SoC EDS
Device: Cyclone® V

As an SPI, Uboot has a command called sspi.
Although it is not enabled in the default state, the sspi command can be used by adding the following modifications.

File: /uboot-socfpga/include/configs/socfpga_common.h
Edit: Added #define CONFIG_CMD_SPI to the file

(Example) Add the following to lines 549 to 552

/* 
 * SPI CMD support
 */
#define CONFIG_CMD_SPI

(Reference) File reflecting edited contents

Please refer to the file below for how to use the command.

ファイル: /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" );

Experienced FAE
Free consultation is available.

From specific product specifications to parts selection, the Company FAE will answer your technical concerns free of charge. Please feel free to contact us.