support for HSI48 in stm32l4xx Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

support for HSI48 in stm32l4xx  Topic is solved

Postby alex31 » Thu Feb 15, 2018 11:12 pm

Hello, I am in the burden of porting my app(s) to 18.2, and I have a small bug with this new implementation :

In a low power app where I chase for minimizing consumption, when I disable entirely STM32_HSI48 , compilation fail.

If STM32_HSI48_ENABLED is set to FALSE, it's impossible to define STM32_CLK48SEL to either value (NOCLOCK par exemple), so
STM32_CLK48SEL take the default value which is STM32_CLK48SEL_PLL. Then the test of clock validity fail.

Here is my proposal patch :

Code: Select all

diff --git a/os/hal/ports/STM32/STM32L4xx/hal_lld.h b/os/hal/ports/STM32/STM32L4xx/hal_lld.h
index a40bc2b96..16b0ce0d1 100644
--- a/os/hal/ports/STM32/STM32L4xx/hal_lld.h
+++ b/os/hal/ports/STM32/STM32L4xx/hal_lld.h
@@ -1182,7 +1182,7 @@
 /*
  * PLL enable check.
  */
-#if (STM32_CLK48SEL == STM32_CLK48SEL_PLL) ||                               \
+#if (STM32_HSI48_ENABLED && (STM32_CLK48SEL == STM32_CLK48SEL_PLL)) || \^M
     (STM32_SW == STM32_SW_PLL) ||                                           \
     (STM32_MCOSEL == STM32_MCOSEL_PLL) ||                                   \
     (STM32_SAI1SEL == STM32_SAI1SEL_PLL) ||                                 \



It permit to compile, but nevertheless i have to comment STM32_CLK48SEL define in mcuconf.h, which is not orthogonal with other settings, it would be better to be able to set it to a NOCLK value.

Alexandre
Attachments
hsi48.patch.zip
(418 Bytes) Downloaded 135 times

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: support for HSI48 in stm32l4xx

Postby Giovanni » Fri Feb 16, 2018 11:07 am

Moved this single post in "bug reports".

Giovanni

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: support for HSI48 in stm32l4xx

Postby Giovanni » Fri Feb 23, 2018 4:34 pm

Fixed as bug #922.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 8 guests