UART Driver for UART4 Peripheral

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

Adam
Posts: 18
Joined: Thu Sep 05, 2013 1:53 pm

UART Driver for UART4 Peripheral

Postby Adam » Wed Jul 23, 2014 8:06 am

Hi Giovanni!

(STM32F407)
Is possible use an UART Driver for an UART4 peripheral? I can run the UART4 with SerialDriver, but the SerialDriver is not good for RS485 mode.

Is there any way how to run UART4 peripheral with UART Driver?

Thank you!

Adam

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: UART Driver for UART4 Peripheral

Postby Giovanni » Wed Jul 23, 2014 8:26 am

Hi,

It is supported, see mcuconf.h.

Giovanni

Adam
Posts: 18
Joined: Thu Sep 05, 2013 1:53 pm

Re: UART Driver for UART4 Peripheral

Postby Adam » Wed Jul 23, 2014 8:37 am

This is a part of my mcuconf.h:

Code: Select all

/*
 * UART driver system settings.
 */
#define STM32_UART_USE_USART1               FALSE
#define STM32_UART_USE_USART2               FALSE
#define STM32_UART_USE_USART3               FALSE
#define STM32_UART_USE_USART6               FALSE
#define STM32_UART_USART1_RX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 5)
#define STM32_UART_USART1_TX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 7)
#define STM32_UART_USART2_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 5)
#define STM32_UART_USART2_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 6)
#define STM32_UART_USART3_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 1)
#define STM32_UART_USART3_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 3)
#define STM32_UART_USART6_RX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 2)
#define STM32_UART_USART6_TX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 7)
#define STM32_UART_USART1_IRQ_PRIORITY      12
#define STM32_UART_USART2_IRQ_PRIORITY      12
#define STM32_UART_USART3_IRQ_PRIORITY      12
#define STM32_UART_USART6_IRQ_PRIORITY      12
#define STM32_UART_USART1_DMA_PRIORITY      0
#define STM32_UART_USART2_DMA_PRIORITY      0
#define STM32_UART_USART3_DMA_PRIORITY      0
#define STM32_UART_USART6_DMA_PRIORITY      0
#define STM32_UART_DMA_ERROR_HOOK(uartp)    chSysHalt()


I see UART4 in serialdriver system settings only:

Code: Select all

/*
 * SERIAL driver system settings.
 */
#define STM32_SERIAL_USE_USART1             TRUE
#define STM32_SERIAL_USE_USART2             FALSE
#define STM32_SERIAL_USE_USART3             FALSE
#define STM32_SERIAL_USE_UART4              TRUE
#define STM32_SERIAL_USE_UART5              FALSE
#define STM32_SERIAL_USE_USART6             FALSE
#define STM32_SERIAL_USART1_PRIORITY        12
#define STM32_SERIAL_USART2_PRIORITY        12
#define STM32_SERIAL_USART3_PRIORITY        12
#define STM32_SERIAL_UART4_PRIORITY         12
#define STM32_SERIAL_UART5_PRIORITY         12
#define STM32_SERIAL_USART6_PRIORITY        12


The version of ChibiOS is 2.6.1.

In uart_lld.h the UART4 is not defined too.

Adam

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: UART Driver for UART4 Peripheral

Postby Giovanni » Wed Jul 23, 2014 8:50 am

You need to upgrade to the latest version.

Giovanni

Adam
Posts: 18
Joined: Thu Sep 05, 2013 1:53 pm

Re: UART Driver for UART4 Peripheral

Postby Adam » Wed Jul 23, 2014 8:56 am

Thank you so much for help! In new version (2.6.5) is UART4 already defined.

Adam


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 27 guests