- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[WICED-SDK-2.2.1]
When I use even parity like below, USART doesnt work properly with WICED SDK 2.2.1.
---
uart_config = {
.baud_rate = 115200,
.data_width = DATA_WIDTH_8BIT,
.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?
Solved! Go to Solution.
- Labels:
-
UART
- Tags:
- 1036
- assume
- assumes
- config-baud_rate
- config-data_width
- config-parity
- config-stop_bits
- correct
- data
- data_width_8bit
- data_width_9bit
- f4xx
- includes
- issue
- line
- no_parity
- optional
- parity
- part
- patch
- previous
- releases
- sdk-2.2.1
- stm32
- stm32f1xx
- stop_bits_1
- switch
- uart
- usart_init_structure.usart_baudrate
- usart_init_structure.usart_mode
- usart_init_structure.usart_stopbits
- usart_init_structure.usart_wordlength
- usart_stopbits_1
- usart_stopbits_2
- usart_wordlength_8b
- usart_wordlength_9b
- wiced
- wicedplatformcommonarm_cortex_m3stm32f2xxstm32f2xx_platform.c
- working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
usart_init_structure.USART_Mode = 0; usart_init_structure.USART_BaudRate = config->baud_rate;- usart_init_structure.USART_WordLength = ( config->data_width == DATA_WIDTH_8BIT ) ? USART_WordLength_8b : USART_WordLength_9b;+ usart_init_structure.USART_WordLength = ( (config->data_width == DATA_WIDTH_9BIT) || + ( (config->data_width == DATA_WIDTH_8BIT) && (config->parity != NO_PARITY) ) + ) ? USART_WordLength_9b : USART_WordLength_8b; usart_init_structure.USART_StopBits = ( config->stop_bits == STOP_BITS_1 ) ? USART_StopBits_1 : USART_StopBits_2; switch ( config->parity )--------------------------------------------------------------------------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
usart_init_structure.USART_Mode = 0; usart_init_structure.USART_BaudRate = config->baud_rate;- usart_init_structure.USART_WordLength = ( config->data_width == DATA_WIDTH_8BIT ) ? USART_WordLength_8b : USART_WordLength_9b;+ usart_init_structure.USART_WordLength = ( (config->data_width == DATA_WIDTH_9BIT) || + ( (config->data_width == DATA_WIDTH_8BIT) && (config->parity != NO_PARITY) ) + ) ? USART_WordLength_9b : USART_WordLength_8b; usart_init_structure.USART_StopBits = ( config->stop_bits == STOP_BITS_1 ) ? USART_StopBits_1 : USART_StopBits_2; switch ( config->parity )--------------------------------------------------------------------------------------------------------------------------------------------