Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I find CYUSB3014 IO configuration very complicated and confusing. My firmware is stored in a Flash memory and I choose the SPI boot option. Meanwhile I use UART for logging. UART_TX and UART_RX are configured to GPIO and GPIO which are also SPI_MISO and SPI_MOSI. Thus, only when I unplug the UART-USB converter from the PC host can the firmware be booted from the SPI flash.
Here below is my configuration.
/* Configure the IO matrix for the device. */
io_cfg.isDQ32Bit = CyFalse; io_cfg.lppMode = CY_U3P_IO_MATRIX_LPP_UART_ONLY; io_cfg.gpioSimpleEn = 0; io_cfg.gpioSimpleEn = 0; io_cfg.gpioComplexEn = 0; io_cfg.gpioComplexEn = 0; io_cfg.useUart = CyTrue; /* Uart is enabled for logging. */ io_cfg.useI2C = CyTrue; /* I2C is used for communication with FPGA. */ io_cfg.useI2S = CyFalse; io_cfg.useSpi = CyFalse; // SPI Flash
I find GPIO and GPIO can also be configured to UART bus. How can I configure the IO matrix to avoid the multi-usage of GPIO and GPIO?
The UART pins in FX3 can be configured as per your requirements. If you refer to table 7 in the FX3 datasheet, if you configure for a 32 bit data bus OR if you wish to use 16 bit DATA bus + UART only , then the UART pins are from GPIO[53:56]. To configure a 32 bit data bus, you need to set io_cfg.isDQ32Bit as TRUE and to use only UART, you need to set io_cfg.lppMode = CY_U3P_IO_MATRIX_LPP_UART_ONLY. In these cases, the UART lines will be on GPIO [53:56]. In this configuration, you cannot use SPI
If you wish to use SPI then you would need to change the UART lines to GPIO[46:49]. For this you would need to set io_cfg.lppMode = CY_U3P_IO_MATRIX_LPP_DEFAULT and io_cfg.isDQ32Bit as FALSE. This way you can use both the SPI and the UART.