Hi,
In my program, there is the RTC configuration of AM4379 as below,
/* enable RTC clock */
void init_rtc(void)
{
/* Configure RTC only if it's disabled or needs to be changed */
if ((in32(AM437X_RTC_BASE + AM437X_RTC_CTRL) != (AM437X_RTC_CTRL_AUTO_COMP | AM437X_RTC_CTRL_RUN_RTC))
|| (in32(AM437X_RTC_BASE + AM437X_RTC_OSC) != (AM437X_RTC_OSC_32KCLK_SEL_EXT | AM437X_RTC_OSC_32KCLK_EN)))
{
/*unlock RTC registers*/
out32(AM437X_RTC_BASE + AM437X_RTC_KICK0R, 0x83e70b13);
out32(AM437X_RTC_BASE + AM437X_RTC_KICK1R, 0x95a4f1e0);
/*Start RTC and enable oscillator compensation mode*/
out32(AM437X_RTC_BASE + AM437X_RTC_CTRL, AM437X_RTC_CTRL_AUTO_COMP | AM437X_RTC_CTRL_RUN_RTC);
/*Enable 24-hour mode*/
out32(AM437X_RTC_BASE + AM437X_RTC_CTRL, in32(AM437X_RTC_BASE + AM437X_RTC_CTRL) & ~AM437X_RTC_CTRL_MODE_12_24);
/*Enable 32KHz*/
out32(AM437X_RTC_BASE + AM437X_RTC_OSC, in32(AM437X_RTC_BASE + AM437X_RTC_OSC) | AM437X_RTC_OSC_32KCLK_EN);
/* lock RTC registers */
out32(AM437X_RTC_BASE + AM437X_RTC_KICK0R, 0);
}
}
Why the program stops when excuting these codes?
Does it have something to do with the hardware configuration? Or the registers are just can't reachable? Or the chip is broken?
However, some codes work well on another devleoping board!