2024-05-21 05:39 AM
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.
Solved! Go to Solution.
2024-05-24 09:30 AM
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,
2024-05-24 09:30 AM
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,