I am trying to use the Real Time Clock of the GD32VF103CB. The first step is just to enable it. I see from the User Manual that after reset the Backup Domain Control register RCU_BDCTL contains 0x18, which the manual says is the default value. But those bits fall in a ‘reserved’ area so I do not know what that means.
The bits I want on are 0x8101, the RTC enable bit, select source LXTAL, and bit 0x01, the LXTALEN enable bit.
I see that bit 0x10000 will force the backup domain to reset. I also see that the Power Management Control Register PMU_CTL has a bit BKPWEN 0x100 that enables writing to the Backup Domain. It would seem that I need to set this bit first. But all my attempts to set it fail. (I am doing this through the Mecrisp-Quintus FORTH language.) I write 0x0100 to PMU_CTL then read it back, getting 0x0000 again.
What is the sequence of operations to enable the RTC?