Page 1 of 1

[DONE] Small bug in header STM32F4xx/hal_lld.h

Posted: Fri Dec 20, 2013 4:08 pm
by dismirlian
Hello, first of all, thank you for providing this excellent OS for free!

I think I've found a bug in the STM32F4xx/hal_lld.h header, namely, in the following code:

Code: Select all

#if (STM32_MCO2SEL == STM32_MCO2SEL_HSI) ||                                 \
    ((STM32_MCO2SEL == STM32_MCO2SEL_PLL) &&                                \
     (STM32_PLLSRC == STM32_PLLSRC_HSI))
#error "HSI not enabled, required by STM32_MCO2SEL"
#endif


The MCO2 doesn't support outputting the HSI clock, so STM32_MCO2SEL_HSI isn't defined (which is correct). The code above checks the value of STM32_MCO2SEL_HSI, which is zero by default (the same value as STM32_MCO2SEL_SYSCLK). Of course, the PLL output can be routed to MCO2, and the PLL can have the HSI as its source, so maybe the code should be modified to:

Code: Select all

#if ((STM32_MCO2SEL == STM32_MCO2SEL_PLL) &&                                \
     (STM32_PLLSRC == STM32_PLLSRC_HSI))
#error "HSI not enabled, required by STM32_MCO2SEL"
#endif


Thanks!

Diego.

Re: Small bug in header STM32F4xx/hal_lld.h

Posted: Fri Dec 20, 2013 4:43 pm
by Giovanni
hi,

Thanks for finding, marking this for review before 2.6.2.

Giovanni

Re: [DONE] Small bug in header STM32F4xx/hal_lld.h

Posted: Mon Dec 23, 2013 9:48 am
by Giovanni
Fixed in repository, bug #447.

Giovanni