1 Reply Latest reply on Nov 27, 2013 6:52 PM by userc_2167

    reconfiguring WICED_UART_2 to use different pins

    StSm_298421

      Im using a BCM9WCD1EVAL1 board, which carries a BCM943362WCD4 module. By default, an SPI interface goes to J3 and J7 on the EVAL1 board. Id like to put a second UART function on those pins instead. The first UART is already used as a debug serial port (over a USB-serial converter).

       

      It is convenient to use the pins which by default are connected to the SPI interface, because these pins are otherwise unused - they only go to a debug header and an unpopulated header.

       

       

      I know how to do this at a very low level (how to configure the appropriate GPIO pins on the STM32F205 to provide an alternate function), but Im having some trouble figuring out how to do this with the least friction in the WICED SDK.

       

      currently there is a global variable called uart_mapping, which lives in platform.c, which is initialized like this:

       

       

      [WICED_UART_2] =

       

          {

       

              .usart                        = USART2,

       

              .gpio_af                      = GPIO_AF_USART2,

       

              .pin_tx                       = &gpio_mapping[WICED_GPIO_3],

       

              .pin_rx                       = &gpio_mapping[WICED_GPIO_4],

       

              .pin_cts                      = &gpio_mapping[WICED_GPIO_1],

       

              .pin_rts                      = &gpio_mapping[WICED_GPIO_2],

       

       

      do I simply change e.g .pin_tx to &gpio_mapping[WICED_GPIO_7], because WICED_GPIO_7 is mapped to GPIO port A pin 6 (by gpio_mapping[] in the same file? And is this sufficient to configure that GPIO port pin as the correct alternate function?

       

       

      thanks, Stuart