pocket beagle not clean shutdown?

Using the serial connection to bacon bits cape to pocket beagle, it seems that it doesn’t shut down cleanly?

debian@beaglebone:~/src$ sudo shutdown -h now
[85060.880449] reboot: Power down
[85063.372620] rtc_power_off failed, bailing out.
[85063.398178] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00
[85063.407436] CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 4.9.82-ti-r102 #1
[85063.414625] Hardware name: Generic AM33XX (Flattened Device Tree)
[85063.420846] [] (unwind_backtrace) from [] (show_stack+0x)
[85063.428686] [] (show_stack) from [] (dump_stack+0x80/0x9)
[85063.436003] [] (dump_stack) from [] (panic+0x100/0x28c)
[85063.443055] [] (panic) from [] (complete_and_exit+0x0/0x)
[85063.450450] [] (complete_and_exit) from [] (SyS_reboot+0)
[85063.458545] [] (SyS_reboot) from [] (ret_fast_syscall+0x)
[85063.466330] —[ end Kernel panic - not syncing: Attempted to kill init! exi0

It's fine, the mmc/drive was already down.

We just need to figure out the proper way to tell the RTC to power off
the unit..


The problem seems to be, that the rtc has no active oscillator:
If I set RTC_OSC_REG to 0x40 (internal oscillator) shutdown works normal.
But I’m not sure whether this is the correct way to solve this issue.

Beat Bieler

Thanks guys, with the help of Matthijs, we have this implement in
u-boot and the kernel..

My PocketBeagle now shut's down..

You can get the updated bootloader via:

debian@beaglebone:~$ sudo /opt/scripts/tools/developers/update_bootloader.sh

I've also add a print statement about the RTC

U-Boot 2018.03-00002-gac9cce7c6a (Apr 05 2018 - 13:07:46 -0500),
Build: jenkins-github_Bootloader-Builder-47

CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: Internal. <-------------------

Pocket: Internal
BeagleBone Black: External

Right now only v4.16.0-bone7 has the kernel change, and it's building right now


I'll start the backport shortly to previous kernels..


How exactly do i change the value of the register? I have no idea which file to look for

onsdag den 4. april 2018 kl. 15.55.41 UTC+2 skrev beatb...@gmail.com:

The default BeagleBoard images already take care of this issue now..

Are you trying to modify that register in a non-u-boot, non-linux OS?


Well it's a two part fix.

1: u-boot has to set the correct rtc bit:


2: the kernel has to have the correct bit set:


When those two are set, it'll properly shutdown.