1 Reply Latest reply on Oct 10, 2017 11:21 AM by inoue_tomohiro_1742091

    Type1GC-Eval RevA - SPI_1_CS driving issue

    iadam_2458121

      Hello,

       

      I'm trying to drive a SPI peripheral on SPI_1 and I cannot get SPI_1_CS to be driven properly.

       

      The wiced_spi_device_t data structure that is supplied to wiced_spi_init() expects a wiced_gpio_t structure for it's .chip_select, but SPI_1_CS is a wiced_peripheral_pin_t, not a wiced_gpio_t. When a wiced_peripheral_pin_t is supplied, the SPI bus fails to initialize. When a wiced_gpio_t is supplied, the driver fails to drive the pin.

       

      Is there any example code available that shows how to set up SPI_1?

        • 1. Re: Type1GC-Eval RevA - SPI_1_CS driving issue
          inoue_tomohiro_1742091

          I see this define in platform.h, so CS is controlled by SPI Controller, not as a GPIO.

          #define WICED_SPI_FLASH_CS   (WICED_GPIO_NONE) /* No GPIO available, must use controller */

           

          In platform.c, pin definition of SPI2 is missing, so you may need to add mosi/miso/clock/cs as below.

              [WICED_SPI_2]  =

              {

                  .port                    = BCM4390X_SPI_1,

                  .pin_mosi                = &platform_gpio_pins[WICED_PERIPHERAL_PIN_13],

                  .pin_miso                = &platform_gpio_pins[WICED_PERIPHERAL_PIN_11],

                  .pin_clock               = &platform_gpio_pins[WICED_PERIPHERAL_PIN_12],

                  .pin_cs                  = &platform_gpio_pins[WICED_PERIPHERAL_PIN_14],

                  .driver                  = &spi_gsio_driver,

              },

          2 of 2 people found this helpful