11 Replies Latest reply on Nov 7, 2016 11:44 AM by user_1377889

    CY8CKIT-058 Bootloader generated UART code stops transmitting once buffer is full

    jean.boucher_1839961

      I have a simple Bootloader test program that shows the generated code for the 5LP gets stuck once the 64 char SW FIFO gets full (Write index = 63, Read index = 0).

         

      For some reason, the  UART code seems to stop pulling from the FIFO. It gets stuck in UART1_PutChar() at line 1067 of .\Generated_Source\PSoC5\UART1.c :

         
              do         { /* Block if software buffer is full, so we don't overwrite. */          #if ((UART1_TX_BUFFER_SIZE > UART1_MAX_BYTE_VALUE) && (CY_PSOC3))             /* Disable TX interrupt to protect variables from modification */             UART1_DisableTxInt();         #endif /* (UART1_TX_BUFFER_SIZE > UART1_MAX_BYTE_VALUE) && (CY_PSOC3) */              locTxBufferWrite = UART1_txBufferWrite;             locTxBufferRead  = UART1_txBufferRead;          #if ((UART1_TX_BUFFER_SIZE > UART1_MAX_BYTE_VALUE) && (CY_PSOC3))             /* Enable interrupt to continue transmission */             UART1_EnableTxInt();         #endif /* (UART1_TX_BUFFER_SIZE > UART1_MAX_BYTE_VALUE) && (CY_PSOC3) */         } -->     while( (locTxBufferWrite < locTxBufferRead) ? (locTxBufferWrite == (locTxBufferRead - 1u)) :                                 ((locTxBufferWrite - locTxBufferRead) ==                                 (uint8)(UART1_TX_BUFFER_SIZE - 1u)) ); 
         

      All I see are the first 2 chars ("..") on my terminal before everything stops in this simple test setup to reproduce the problem on my CY8CKIT-058 board:

         
      #include <project.h>  int main() {     UART1_CyBtldrCommStart();           // Starts the communication interface and enables its interrupts & callbacks          char str[] = ".";            //"\r\nThis is a sample string.";     uint16 written = 0;     cystatus ret = CYRET_SUCCESS;     for (uint16 loopCount = 0; ret == CYRET_SUCCESS; loopCount++)     {         Pin_User_LED_Write(loopCount & 1);         //UART1_PutChar('.');         ret = UART1_CyBtldrCommWrite((uint8 *)str, sizeof(str), &written, 0);         //CyDelay(10 * UART1_BL_CHK_DELAY_MS);                   <----- this keeps it from getting stuck at a full FIFO     }  }
         

      Environment:
      PSoC Creator  4.0 (4.0.0.432)
      Culture: English (United States)
      OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
      CLR Version: 4.0.30319.42000

         

      Installed CyInstaller Products:
      CY8CKIT-059 PSoC 5LP Prototyping Kit 1.0 Rev.**
      Cypress Document Manager 1.0 SP1
      Peripheral Driver Library 2.1.0
      PSoC Programmer 3.25.0
      PSoC Creator 3.3 CP3
      PSoC Creator 4.0        <--- using this one

         

      Bootloader v1.50

         

      cy_boot v5.50

         

      UART v2.50

         

      UART_Rx/Tx cy_pins v2.20

         

      Anybody should be able to reproduce this with PSoC Creator 4.0, a CY8CKIT-059, a simple project with only a Bootloader component (mine is set for Dual-application mode) and a UART component, and the main() of main.c I pasted above. Can anybody explain why that's happening before I cry "BUG!!!" ?