3 Replies Latest reply on Jun 17, 2020 11:02 PM by RakshithM_16

    Using other pins for UART with PSoC 6 Wi-Fi BT Prototyping Board

    SySa_4665481

      Hi,

       

      I would like to use P9.0 and P9.1 for UART with the prototyping board. I have followed this example:

       

      #define DATA_BITS_8 8

      #define STOP_BITS_1 1

      #define TX_PIN P9_1

      #define RX_PIN P9_0

      #define BAUD_RATE 115200

      #define UART_DELAY 10u

      #define RX_BUF_SIZE 4

      #define TX_BUF_SIZE 4

       

      /* Variable Declarations */

      cy_rslt_t rslt;

      cyhal_uart_t uart_obj;

      uint32_t actualbaud;

      uint8_t tx_buf[TX_BUF_SIZE] = {'1','2','3','4'};

      uint8_t rx_buf[RX_BUF_SIZE];

      size_t tx_length = TX_BUF_SIZE;

      size_t rx_length = RX_BUF_SIZE;

      uint32_t value = 'A';

       

      /* Initialize the UART configuration structure */

      const cyhal_uart_cfg_t uart_config =

      {

        .data_bits = DATA_BITS_8,

        .stop_bits = STOP_BITS_1,

        .parity = CYHAL_UART_PARITY_NONE,

        .rx_buffer = rx_buf,

        .rx_buffer_size = RX_BUF_SIZE

      };

       

      /* Initialize the UART Block */

      rslt = cyhal_uart_init(&uart_obj, TX_PIN, RX_PIN, NULL, &uart_config);

      /* Set the baud rate */

      rslt = cyhal_uart_set_baud(&uart_obj, BAUD_RATE, &actualbaud);

      /* Begin Tx Transfer */

      cyhal_uart_write(&uart_obj, (void*)tx_buf, &tx_length);

      cyhal_system_delay_ms(UART_DELAY);

       

       

      But I am running into Cy_SysLib_ProcessingFault() at the cyhal_uart_write() line.

      Am I missing something?