Skip to main content
Uwe Bonnes
Chief
February 19, 2024
Question

Inconsistancies in U5 device headers

  • February 19, 2024
  • 2 replies
  • 897 views

Hello,

most devices define helper definitions, like selecting the system clock source. E.g. L412:

#define RCC_CFGR_SWS_MSI (0x00000000UL) /*!< MSI oscillator used as system clock */
#define RCC_CFGR_SWS_HSI (0x00000004UL) /*!< HSI16 oscillator used as system clock */
#define RCC_CFGR_SWS_HSE (0x00000008UL) /*!< HSE oscillator used as system clock */
#define RCC_CFGR_SWS_PLL (0x0000000CUL) /*!< PLL used as system clock */

E.g. The U5 headers miss these definition. What a pity. That makes writing portabe code harder.Please consider adding.

Regards

 

This topic has been closed for replies.

2 replies

STTwo-32
ST Technical Moderator
February 19, 2024

Hello @Uwe Bonnes 

In STM32CubeU5, we have the RCC_System_Clock_Source_Status System Clock Source Status on the stm32u5xx_hal_rcc.h:

STTwo32_0-1708355663457.png

and RCC_LL_EC_SYS_CLKSOURCE_STATUS System clock switch status on the stm32u5xx_ll_rcc.h:

STTwo32_1-1708355784067.png

Best regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Uwe Bonnes
Chief
February 19, 2024

Using HAL header does not play well when using/implementing some other "HAL", aka Nut/Os(Ethernut) in my case. Only Vendor provided definitions in the Device header are of help.