Skip to main content
chenlijun1999
Associate II
Apr 18, 2019 9:11 PM UTC
Solved

Are HAL_ppp_MspInit functions the only place to initialize low level resources?

Hi everybody.

I'm met several scenarios in which the use of HAL_PPP_MspInit

would be too constraining.

A typical example is when I'm making a reusable library that needs

some peripheral. If I initialize the low level resources for the peripherals

used by the library in HAL_PPP_MspInit functions, then the application code

won't be able to use them anymore.

I've always initialized the low level resource before calling HAL_PP_Init and

it has always worked. But I would like to have your confirm that I'm doing is legitimated.

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Apr 18, 2019 10:31 PM UTC

Yes is it reasonable and legitimate to do clock and pin initialization elsewhere prior to usage.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Apr 18, 2019 10:31 PM UTC

Yes is it reasonable and legitimate to do clock and pin initialization elsewhere prior to usage.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
chenlijun1999
Associate II
Apr 19, 2019 8:15 PM UTC

Thank you very much for the answer!