3 Replies Latest reply on May 29, 2013 6:29 PM by userc_2167

    Sometimes Interrupt is not called

      # Environments

       

      - WICED Version 2.3.0

       

      - ThreadX + NetX_Duo

       

      - BCMUSI11 Platform

       

      - BCM43362

       

       

      Hi

       

       

      We are trying to use high-speed UART and SPI. The concept is that

       

      when data come from UART or SPI, it is sent through the Wi-Fi (and vice versa).

       

       

      We are now facing with a critical interrupt problem.

       

      When there is data traffic through the Wi-Fi, If I send a lot of data through the UART,

       

      sometimes interrupt is not called. It is very small but critical. (about 0~30 / 1,000,000 times).

       

       

      # UART Condition

       

      - baud rate: 921600 or over

       

      - flow-control: None or RTS+CTS

       

      - the other is not changed

       

       

      # Interrupt count check method

       

      - Add 1 to global counter variable in the usart1_irq function.

       

        and check it after sending.

       

       

      # Things I tried (but the problem still exist)

       

      - Changed UART interrupt priority from 57, 68 to 00.

       

      - Removed interrupt-disable function in the stm32f2xx_platform.c and core_cmFunc.h files.

       

      - Uncomment #define WICED_DISABLE_MCU_POWERSAVE in the wiced_defaults.h file.

       

       

      Do you have any suggestion to solve this problem ?

        • 1. Re: Sometimes Interrupt is not called
          When the UART RX interrupt isnt fired, can you check whether the data sent from your client are already in the RX buffer? If not than perhaps the UART peripheral didnt receive the data at all.
          • 2. Re: Sometimes Interrupt is not called
            The data was arrived. I could know that because the arrived one and the one got from buffer was not synced.

             

            When I get the char from the buffer, it is not the one received right before, but received several times ago.

             

            for example... Supposing I send "ABCDE", when I sent E, I could see B or something which is sent previously.
            • 3. Re: Sometimes Interrupt is not called
              reply test
              • 4. Re: Sometimes Interrupt is not called
                Is it possible for you to post your test code?

                 

                 

                The UART API relies on the interrupt to notifies the caller via a semaphore that an X number of bytes specified has been received. It does not, however, rely on the interrupt to increment the counter every byte its received.

                 

                 

                In cases where CPU utilisation is high, X number of bytes received does not translate to X number of UART interrupt serviced. When two or more successive interrupts fired so close together, they might be serviced together at once.

                 

                 

                In stm32f2xx_platform.c function usart1_irq(),

                 

                 

                ------------------------------------------------------------------------------------------------------------

                 

                uart_interfaces[0].rx_buffer->tail = uart_interfaces[0].rx_buffer->size - uart_mapping[0].rx_dma_stream->NDTR;

                 

                ------------------------------------------------------------------------------------------------------------

                 

                 

                The above code does not increment the circular buffer tail by one byte; rather, it adds the total number of bytes received.