2022-03-01 05:09 AM
These bits are always 0 and I can't change the voltage scaling of MCU (The code is stuck at both "while"s). The MCU P/N is STM32H743IIT6. The starting part of the code is:
int main(void)
{
PWR->D3CR=0x0000C000; //changing voltage scaling to VOS1
while(((PWR->CSR1)&(0x00002000))==0); //Waiting for voltage scaling
while(((PWR->D3CR)&(0x00002000))==0); //Waiting for voltage scaling
//MCU runs no more code lines... :(
}
Solved! Go to Solution.
2022-03-01 07:13 AM
You're right, there are two VCAP pins and a 1.2uF cap is connected to each one (so no mistake in this part). I made a little change in my code and I think the problem is solved (Actually I wrote the value of the PWR_CR3 register equal to its reset value! (I don't know why but it works!):
int main(void)
{
PWR->CR3=0x00000004; //Activating single write enabled to supply configuration
PWR->CR3=0x00000002; //Normal operation and LDO is enable
PWR->D3CR=0x0000C000; //changing voltage scaling to VOS1
while(((PWR->CSR1)&(0x00002000))==0); //Waiting for voltage scaling
while(((PWR->D3CR)&(0x00002000))==0); //Waiting for voltage scaling
}
2022-03-01 06:15 AM
Custom board? How is VCORE supplied? What is voltage on VCAP pins if you measure them with multimeter?
2022-03-01 06:21 AM
Yes, a custom board. VCORE is supplied from internal LDO (1.2uF capacitor is connected to VCAP pin). The voltage is 1.01V
2022-03-01 06:36 AM
> The voltage is 1.01V
That's below the VOS1 threshold, so bits not being set is the correct behavior.
Not real sure.
There are two VCAP pins, both should have a 2.2uF cap.
2022-03-01 07:13 AM
You're right, there are two VCAP pins and a 1.2uF cap is connected to each one (so no mistake in this part). I made a little change in my code and I think the problem is solved (Actually I wrote the value of the PWR_CR3 register equal to its reset value! (I don't know why but it works!):
int main(void)
{
PWR->CR3=0x00000004; //Activating single write enabled to supply configuration
PWR->CR3=0x00000002; //Normal operation and LDO is enable
PWR->D3CR=0x0000C000; //changing voltage scaling to VOS1
while(((PWR->CSR1)&(0x00002000))==0); //Waiting for voltage scaling
while(((PWR->D3CR)&(0x00002000))==0); //Waiting for voltage scaling
}
2022-03-01 07:45 AM
You should probably mask on new bits/settings, not blindly write the registers.
If you run into issues sanity check with library code to ensure it's not your technique that is failing.
2022-03-01 07:54 AM
Of course that I didn't write blindly to them! I expected these bits to have those values as their reset value, so initiating them with reset value is not a problem.
TNX