cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U575 VREFBUF Driver bug when 2.5V is set

Daniel_A
Associate

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. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ASEHST
ST Employee

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,

 

If your question is answered, please close this topic by clicking "Accept as Solution".

View solution in original post

1 REPLY 1
ASEHST
ST Employee

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,

 

If your question is answered, please close this topic by clicking "Accept as Solution".