Hi,
updated ChibiOS 17.6.0 USARTv2 driver with STM32L0/L4 LPUART support is attached.
Is it possible to review and merge?
STM32L0/L4 LPUART support Topic is solved
STM32L0/L4 LPUART support Topic is solved
- Attachments
-
- lpuart.tar.gz
- (14.35 KiB) Downloaded 173 times
Vitaly
- 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:
- 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: STM32L0/L4 LPUART support
Hi,
The patch is not aligned with trunk, the real problem is that it uses 64 bits arithmetic in usart_start(), is this really required?
Also, all mcuconf.h files should be aligned with the new settings.
Giovanni
The patch is not aligned with trunk, the real problem is that it uses 64 bits arithmetic in usart_start(), is this really required?
Also, all mcuconf.h files should be aligned with the new settings.
Giovanni
Re: STM32L0/L4 LPUART support
Hi,
64-bit part is completely the same as in hal_serial.c:
#if STM32_SERIAL_USE_LPUART1
if ( sdp == &LPSD1 )
{
u->BRR = (uint32_t)( ( (uint64_t)sdp->clock * 256 ) / config->speed);
}
else
#endif
if it is a problem, will try to do it only with uint32_t.
mcuconf.h files should be aligned: do you mean to define STM32_HAS_LPUART1 in all stm32_registry.h?
64-bit part is completely the same as in hal_serial.c:
#if STM32_SERIAL_USE_LPUART1
if ( sdp == &LPSD1 )
{
u->BRR = (uint32_t)( ( (uint64_t)sdp->clock * 256 ) / config->speed);
}
else
#endif
if it is a problem, will try to do it only with uint32_t.
mcuconf.h files should be aligned: do you mean to define STM32_HAS_LPUART1 in all stm32_registry.h?
Vitaly
- 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: STM32L0/L4 LPUART support
I have not noticed it in the serial driver... thanks for pointing that out. If you find a 32bits-only solution then I will apply it also on the serial driver, if not then let's keep the 64 bits arithmetics.
Correct, all registry files have to be updated and have those keys to FALSE. All L4 mcuconf.h files have to be updated too but we are in the middle of huge HAL changes so that will be done at the end, no need to do this now.
Giovanni
Correct, all registry files have to be updated and have those keys to FALSE. All L4 mcuconf.h files have to be updated too but we are in the middle of huge HAL changes so that will be done at the end, no need to do this now.
Giovanni
Re: STM32L0/L4 LPUART support
Hi,
STM32_HAS_LPUART1 macro set in all stm32_registry.h files already, so there is no reason to change it again, we need just merge l0/l4 registry file with new LPUART macros and hal_uart_lld
I would suggest this solution for 32bits only arithmetic:
STM32_HAS_LPUART1 macro set in all stm32_registry.h files already, so there is no reason to change it again, we need just merge l0/l4 registry file with new LPUART macros and hal_uart_lld
I would suggest this solution for 32bits only arithmetic:
Code: Select all
if sdp->clock <= 0xFFFFFF then
BRR = (sdp->clock * 256 ) / config->speed
else
BRR = ((sdp->clock / 100) * 256 ) / (config->speed / 100)
Vitaly
Return to “Small Change Requests”
Who is online
Users browsing this forum: No registered users and 5 guests