Skip to main content
Explorer
May 21, 2024
Solved

STM32U575 VREFBUF Driver bug when 2.5V is set

  • May 21, 2024
  • 1 reply
  • 1037 views

Hello,
Just fount a bug on the LL driver of VREFBUF on STM32U575

when you want to configure internal Vref to 2.5V and you use the nest function:

LL_VREFBUF_SetVoltageScaling(LL_VREFBUF_VOLTAGE_SCALE3);

where LL_VREFBUF_VOLTAGE_SCALE3  should set VRS bits of CSR REG to 0x3 it set it to 0x4 instead.

the problem is in the definition of the term  LL_VREFBUF_VOLTAGE_SCALE3

#define LL_VREFBUF_VOLTAGE_SCALE3   VREFBUF_CSR_VRS_2 /*!< Voltage reference scale 1 (VREF_OUT4) */

where
#define VREFBUF_CSR_VRS_2    (0x04UL<< VREFBUF_CSR_VRS_Pos) /*!< 0x00000030 */

where:

#define VREFBUF_CSR_VRS_Pos   (3U)

0x04UL<< VREFBUF_CSR_VRS_Pos  should be equal to  0x00000030 but it actually equal to 0x00000040

therefor wrong value is set in the VRS bits. 

 

    This topic has been closed for replies.
    Best answer by ASEHST

    Hello @Daniel_A

    Thank you for your report. You are absolutely right; the value of LL_VREFBUF_VOLTAGE_SCALE3 should be 0x03. Therefore, it should be defined as follows:

    #define LL_VREFBUF_VOLTAGE_SCALE3 (VREFBUF_CSR_VRS_1 | VREFBUF_CSR_VRS_0)

    This issue will be fixed in the upcoming release.

    With Regads,

     

    1 reply

    ASEHSTAnswer
    ST Employee
    May 24, 2024

    Hello @Daniel_A

    Thank you for your report. You are absolutely right; the value of LL_VREFBUF_VOLTAGE_SCALE3 should be 0x03. Therefore, it should be defined as follows:

    #define LL_VREFBUF_VOLTAGE_SCALE3 (VREFBUF_CSR_VRS_1 | VREFBUF_CSR_VRS_0)

    This issue will be fixed in the upcoming release.

    With Regads,