2 Replies Latest reply on Apr 4, 2014 6:13 AM by GregG_16

    USART setup question

      When I use 9bits (8bits and parity) data like below, USART doesnt work properly with WICED SDK 2.2.1.

       

       

      
      uart_config = {
      
         .baud_rate    = 115200,
      
         .data_width   = DATA_WIDTH_9BIT,
      
         .parity       = EVEN_PARITY,
      
         .stop_bits    = STOP_BITS_1,
      
         .flow_control = FLOW_CONTROL_CTS_RTS,
      
      };
      
      

       

       

      In stm32fXxx_platform.c, DMA is configured as following around line.1099.

       

      
      if ( config->data_width == DATA_WIDTH_9BIT )
      
      {
      
         dma_init_structure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
      
         dma_init_structure.DMA_MemoryDataSize     = DMA_MemoryDataSize_HalfWord;
      
      }
      
      else
      
      {
      
         dma_init_structure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
      
         dma_init_structure.DMA_MemoryDataSize     = DMA_MemoryDataSize_Byte;
      
      }
      
      

       

       

      It should be fixed as below I think.

       

      
      if ( config->data_width == DATA_WIDTH_9BIT ) && ( config->parity == NO_PARITY )
      
      ...
      
      

       

       

      Could you check this and give me your feedback?