The input range of the LDO on the blue pill is severely restricted. 5.5V is maximum.Piter_de_Vries wrote: Thu Oct 06, 2022 8:17 am If I disconnect the power from the battery before connecting to USB, I will lose the data in the RAM.
You will need to correctly isolate both of your power sources in order to use both of them at the same time.