BPI-R2 boot / power suppy

Yes. I have connected monitor via hdmi and serial console too. On “poweroff” it is the same kernel panic. I check what happens on kernel 4.16 and back with the result.

i have tested on my debian-system (also actual 4.19.16) with installed acpi, no crash…can you enable drm-debug (drm.debug=0x7) via your uenv.txt?

where do you get your image or how have you build it?

you see crash only on serial, right? does it happen after a clean boot? or do you have errors on boot too? anything done between bootup and poweroff?

I haven’t installed acpi on my slackarm. Yes, sure. I can enable drm-debug if you can tell me how.

I’m build the kernel on Virtual Machine with Ubuntu 16.04 using your build.sh script.

I see the crash on hdmi and serial console too. But only from serial console I will be able to put it here :slight_smile:

On kernel 4.16.18 I have the same kernel panic on poweroff and shutdown commands :expressionless:

just add “drm.debug=0x7” to your bootargs (uboot-config uEnv.txt)

i expected that fbcon is closed so you see the error only on serial…as you said, you see it on hdmi too fbcon is not killed at this moment

you do not get the last “Power down”-mesage right? means your device stays powered on

this is how it looks on my debian-system

[  840.177708] systemd-shutdown[1]: All filesystems unmounted.                                                                        
[  840.189043] systemd-shutdown[1]: Deactivating swaps.                                                                               
[  840.199807] systemd-shutdown[1]: All swaps deactivated.                                                                            
[  840.210666] systemd-shutdown[1]: Detaching loop devices.                                                                           
[  840.227518] systemd-shutdown[1]: All loop devices detached.                                                                        
[  841.258544] reboot: Power down

i guess slackarm does anything different which causes the crash

I try recorded shutdown process :slight_smile: and before the kernel panic I see:

The system is going down for system halt NOW!

I’m not see “Power down” message :frowning:

kernel panic message with enabled drm debug:

[  113.978089] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[  113.978089] 
[  114.060928] CPU: 0 PID: 1 Comm: init Not tainted 4.16.18-bpi-r2-main #7
[  114.105429] Hardware name: Mediatek Cortex-A7 (Device Tree)
[  114.148972] [<c0113d94>] (unwind_backtrace) from [<c010e4d8>] (show_stack+0x20/0x24)
[  114.195234] [<c010e4d8>] (show_stack) from [<c09e123c>] (dump_stack+0x90/0xa4)
[  114.240854] [<c09e123c>] (dump_stack) from [<c012cf08>] (panic+0x100/0x284)
[  114.285869] [<c012cf08>] (panic) from [<c01315d8>] (complete_and_exit+0x0/0x2c)
[  114.331287] [<c01315d8>] (complete_and_exit) from [<c013258c>] (do_group_exit+0x50/0xe0)
[  114.377686] [<c013258c>] (do_group_exit) from [<c013e860>] (get_signal+0x35c/0x6b0)
[  114.424116] [<c013e860>] (get_signal) from [<c010d4b4>] (do_signal+0xe8/0x468)
[  114.470536] [<c010d4b4>] (do_signal) from [<c010da20>] (do_work_pending+0xbc/0xcc)
[  114.517797] [<c010da20>] (do_work_pending) from [<c010106c>] (slow_work_pending+0xc/0x20)
[  114.566194] Exception stack(0xde911fb0 to 0xde911ff8)
[  114.611719] 1fa0:                                     00000000 bef32228 00000005 b6eda0c8
[  114.661275] 1fc0: bef323bc bef32480 b6f0c000 00000092 00000001 b6ec0292 bef32480 bef32500
[  114.710653] 1fe0: 00000000 bef32338 bef32228 b6d8efb8 600f0010 ffffffff
[  114.758144] CPU2: stopping
[  114.801271] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.16.18-bpi-r2-main #7
[  114.849307] Hardware name: Mediatek Cortex-A7 (Device Tree)
[  114.895959] [<c0113d94>] (unwind_backtrace) from [<c010e4d8>] (show_stack+0x20/0x24)
[  114.945506] [<c010e4d8>] (show_stack) from [<c09e123c>] (dump_stack+0x90/0xa4)
[  114.994975] [<c09e123c>] (dump_stack) from [<c0111b8c>] (handle_IPI+0x2b0/0x2d0)
[  115.044348] [<c0111b8c>] (handle_IPI) from [<c01022a8>] (gic_handle_irq+0x9c/0xa0)
[  115.093732] [<c01022a8>] (gic_handle_irq) from [<c0101a0c>] (__irq_svc+0x6c/0x90)
[  115.143015] Exception stack(0xde937f38 to 0xde937f80)
[  115.189933] 7f20:                                                       00000000 000038bc
[  115.240568] 7f40: df7c23d8 c01206a0 de936000 c0f04c6c c0f04cd8 00000004 c0f8b3a9 c0bef150
[  115.291372] 7f60: 00000000 de937f94 de937f98 de937f88 c010a2d8 c010a2dc 60000013 ffffffff
[  115.342684] [<c0101a0c>] (__irq_svc) from [<c010a2dc>] (arch_cpu_idle+0x48/0x4c)
[  115.393309] [<c010a2dc>] (arch_cpu_idle) from [<c09fd958>] (default_idle_call+0x30/0x3c)
[  115.445025] [<c09fd958>] (default_idle_call) from [<c0170e6c>] (do_idle+0xe4/0x158)
[  115.495713] [<c0170e6c>] (do_idle) from [<c01711a0>] (cpu_startup_entry+0x28/0x2c)
[  115.545616] [<c01711a0>] (cpu_startup_entry) from [<c0111650>] (secondary_start_kernel+0x16c/0x190)
[  115.597604] [<c0111650>] (secondary_start_kernel) from [<801026cc>] (0x801026cc)
[  115.647355] CPU3: stopping
[  115.691453] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.16.18-bpi-r2-main #7
[  115.740401] Hardware name: Mediatek Cortex-A7 (Device Tree)
[  115.788034] [<c0113d94>] (unwind_backtrace) from [<c010e4d8>] (show_stack+0x20/0x24)
[  115.838458] [<c010e4d8>] (show_stack) from [<c09e123c>] (dump_stack+0x90/0xa4)
[  115.888500] [<c09e123c>] (dump_stack) from [<c0111b8c>] (handle_IPI+0x2b0/0x2d0)
[  115.938176] [<c0111b8c>] (handle_IPI) from [<c01022a8>] (gic_handle_irq+0x9c/0xa0)
[  115.988481] [<c01022a8>] (gic_handle_irq) from [<c0101a0c>] (__irq_svc+0x6c/0x90)
[  116.039229] Exception stack(0xde939f38 to 0xde939f80)
[  116.087952] 9f20:                                                       00000000 0000d0f8
[  116.140718] 9f40: df7d33d8 c01206a0 de938000 c0f04c6c c0f04cd8 00000008 c0f8b3a9 c0bef150
[  116.192875] 9f60: 00000000 de939f94 de939f98 de939f88 c010a2d8 c010a2dc 600d0013 ffffffff
[  116.244736] [<c0101a0c>] (__irq_svc) from [<c010a2dc>] (arch_cpu_idle+0x48/0x4c)
[  116.295289] [<c010a2dc>] (arch_cpu_idle) from [<c09fd958>] (default_idle_call+0x30/0x3c)
[  116.346876] [<c09fd958>] (default_idle_call) from [<c0170e6c>] (do_idle+0xe4/0x158)
[  116.398172] [<c0170e6c>] (do_idle) from [<c01711a0>] (cpu_startup_entry+0x28/0x2c)
[  116.422914] SMP: failed to stop secondary CPUs
[  116.497294] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[  116.[  116.497294] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[  116.497294] 
[  116.551157] [<c0111650>] (secondary_start_kernel) from [<801026cc>] (0x801026cc)
[  116.603597] CPU1: stopping
[  116.651188] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.16.18-bpi-r2-main #7
[  116.704013] Hardware name: Mediatek Cortex-A7 (Device Tree)
[  116.755751] [<c0113d94>] (unwind_backtrace) from [<c010e4d8>] (show_stack+0x20/0x24)
[  116.810399] [<c010e4d8>] (show_stack) from [<c09e123c>] (dump_stack+0x90/0xa4)
[  116.864637] [<c09e123c>] (dump_stack) from [<c0111b8c>] (handle_IPI+0x2b0/0x2d0)
[  116.918972] [<c0111b8c>] (handle_IPI) from [<c01022a8>] (gic_handle_irq+0x9c/0xa0)
[  116.973716] [<c01022a8>] (gic_handle_irq) from [<c0101a0c>] (__irq_svc+0x6c/0x90)
[  117.028676] Exception stack(0xde935f38 to 0xde935f80)
[  117.080990] 5f20:                                                       00000000 00005368
[  117.136422] 5f40: df7b13d8 c01206a0 de934000 c0f04c6c c0f04cd8 00000002 c0f8b3a9 c0bef150
[  117.191647] 5f60: 00000000 de935f94 de935f98 de935f88 c010a2d8 c010a2dc 60060013 ffffffff
[  117.246899] [<c0101a0c>] (__irq_svc) from [<c010a2dc>] (arch_cpu_idle+0x48/0x4c)
[  117.301467] [<c010a2dc>] (arch_cpu_idle) from [<c09fd958>] (default_idle_call+0x30/0x3c)
[  117.356760] [<c09fd958>] (default_idle_call) from [<c0170e6c>] (do_idle+0xe4/0x158)
[  117.411624] [<c0170e6c>] (do_idle) from [<c01711a0>] (cpu_startup_entry+0x28/0x2c)
[  117.466587] [<c01711a0>] (cpu_startup_entry) from [<c0111650>] (secondary_start_kernel+0x16c/0x190)
[  117.523375] [<c0111650>] (secondary_start_kernel) from [<801026cc>] (0x801026cc)

And content of my uEnv.txt file:

#
## uEnv.txt
#
bpi=bananapi
board=bpi-r2
chip=mt7623n
service=linux
#
##
#
kernel=uImage-4.16.18
#
##
#
kaddr=0x84000000
rdaddr=0x86000000
#
##
#
#root=/dev/ram
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
console=earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200
bootopts=vmalloc=496M debug=7 initcall_debug=0 video=1280x1024-32 drm.debug=0x7
#
##
#
abootargs=setenv bootargs board=${board} console=${console} root=${root} service=${service} ${bootopts}
#
##
#
ahello=echo Banana Pi ${board} chip: $chip Service: $service
#
##
#
aboot=if fatload $device $partition $rdaddr ${bpi}/berryboot.img; then bootm $kaddr $rdaddr ; else bootm $kaddr; fi
#
##
#
aload_kernel=fatload $device $partition $kaddr ${bpi}/${board}/${service}/${kernel}
#
##
#
uenvcmd=run ahello abootargs aload_kernel aboot
#
## END
#

Nothing from drm.debug? how do you get slack-image?

Please verify your drm.debug option is passed to kernel

uname -r
cat /proc/cmdline

please attach full log…i need to see whats happen directly before crash

The arm image of slack is downloadable from here: http://arm.slackware.com/installation/ At the bottom of this page is " click here to download the root filesystem images." and on “here” is link to minirootfs: ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-devtools/minirootfs/roots I use slackware-current image because this provide hardware float support. How can I grab the full log which will help to find the reason of this issue?

[email protected]:~# uname -r
4.16.18-bpi-r2-main
[email protected]:~# cat /proc/cmdline 
board=bpi-r2 console=earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait service=linux vmalloc=496M debug=7 initcall_debug=0 video=1280x1024-32 drm.debug=0x7

bootup-log you can write to file

dmesg > file.txt

for power-down log just select in your terminal-application (putty/minicom) and copy to a textfile on client like you did for crash, but not only the crash…also lines before (starting at your poweroff-command)

OK, BootUP log is here: https://drive.google.com/file/d/1-w5Nr1ZIVx7s2CKsF-GlZzn7Zio3uNxY/view?usp=sharing

But power-down log is not easy to have as a part of messages I have on serial console but other part on hdmi port. So firstly will be good to fix this issue. What I should change in my uEnv.txt file to have all messages on serial console. Now, I’m not able to login to the OS on serial console. Login screen is only on hdmi port.

bootup-log looks clear so far…

you should see all messages also on serial-console. you could try

dmesg -E

before running poweroff-command, i have no other idea because i see all messages also on serial (and some additional after fbcon is disabled)…

for login on serial, maybe its hidden because of drm-messages…just press enter and you should see login-prompt on serial

it seems that there is a process that prevent you to login from console (after starting xserver).

my bootargs are similar for console

[email protected]:~# cat /proc/cmdline                                                                                                               
board=bpi-r2 console=earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 kgdboc=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait vmalloc=496M debug=7 initcall_debug=0 video=1280x1024 drm.debug=0x7

After enter I’m not see login prompt on serial console. I see:

Starting OpenSSH SSH daemon:  /usr/sbin/sshd
Enabled CPU frequency scaling governor:  ondemand
Starting crond:  /usr/sbin/crond -l notice
Loading /usr/share/kbd/keymaps/i386/qwerty/uk.map.gz

as a last commands from boot process and then I’m able to logon only on hdmi. And when I run poweroff/shutdown on serial console I got:

INIT: Switching to run[ 2168.352919] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[ 2168.352919] 
...

for serial-problem you should ask in slacks forum and maybe for process of powerdown…there seems to be a difference to debian-systems

there is a crash on killing init-process, with drm.debug the fbcon-lines are missing…strange.

[  112.696153] [<c0101a0c>] (__irq_svc) from [<c0550664>] (cfb_imageblit+0x2fc/0x4e4)
[  112.696172] [<c0550664>] (cfb_imageblit) from [<c05bdf98>] (drm_fb_helper_cfb_imageblit+0x24/0x44)
[  112.696187] [<c05bdf98>] (drm_fb_helper_cfb_imageblit) from [<c054ed7c>] (bit_putcs+0x280/0x42c)

i guess it tries to display a bootlogo or splash-screen which is not available in my kernel…imho you should ask in slackware-forum for serial-problem and kernel-crash

maybe @DeadMeat can help here, currently he tries to change framebuffer-driver to new generic framework…maybe in old driver the bitblt-functions are missing

I checked again with Raspbian (stretch) : -> on kernel 4.4.70 after powerdown command I got

[  OK  ] Reached target Shutdown.
[  275.514617] reboot: System halted

and BPI is not powered off.

-> on kernel 4.19.16 after powerdown command I got

[email protected]:~# poweroff 
[  OK  ] Started Show Plymouth Power Off Screen.
[  OK  ] Deactivated swap /var/swap.
[  OK  ] Stopped LSB: Autogenerate and use a swap file.
[  OK  ] Unmounted /run/user/1000/gvfs.
[  OK  ] Unmounted RPC Pipe File System.
[  OK  ] Stopped User Manager for UID 1000.
[  OK  ] Stopped User Manager for UID 0.
[  OK  ] Removed slice User Slice of root.
[  OK  ] Removed slice User Slice of pi.
         Stopping Permit User Sessions...
         Stopping Login Service...
[  OK  ] Stopped Login Service.
[  OK  ] Stopped Permit User Sessions.
[  OK  ] Stopped target Network.
         Stopping Raise network interfaces...
         Stopping dhcpcd on all interfaces...
[  OK  ] Stopped target Remote File Systems.
[  OK  ] Stopped target Remote File Systems (Pre).
[  OK  ] Stopped target NFS client services.
[  OK  ] Stopped Raise network interfaces.
[  OK  ] Stopped dhcpcd on all interfaces.
[  OK  ] Stopped target Basic System.
[  OK  ] Stopped target Sockets.
[  OK  ] Closed D-Bus System Message Bus Socket.
[  OK  ] Closed Avahi mDNS/DNS-SD Stack Activation Socket.
[  OK  ] Closed triggerhappy.socket.
[  OK  ] Closed Syslog Socket.
[  OK  ] Stopped target System Initialization.
[  OK  ] Stopped target Swap.
[  OK  ] Stopped Apply Kernel Variables.
[  OK  ] Stopped target Encrypted Volumes.
         Stopping Update UTMP about System Boot/Shutdown...
         Stopping Load/Save Random Seed...
         Stopping Restore / save the current clock...
         Stopping Network Time Synchronization...
[  OK  ] Stopped Load Kernel Modules.
[  OK  ] Stopped target Slices.
[  OK  ] Removed slice User and Session Slice.
[  OK  ] Stopped Forward Password Requests to Plymouth Directory Watch.
[  OK  ] Stopped target Paths.
[  OK  ] Stopped Forward Password Requests to Wall Directory Watch.
[  OK  ] Stopped Load/Save Random Seed.
[  OK  ] Stopped Restore / save the current clock.
[  OK  ] Stopped Update UTMP about System Boot/Shutdown.
[  OK  ] Stopped Network Time Synchronization.
[  OK  ] Stopped Create Volatile Files and Directories.
[  OK  ] Stopped target Local File Systems.
         Unmounting /boot...
         Unmounting /media/pi/BPI-BOOT...
         Unmounting /run/user/1000...
         Unmounting /run/user/0...
[  OK  ] Unmounted /run/user/1000.
[  OK  ] Unmounted /media/pi/BPI-BOOT.
[  OK  ] Unmounted /run/user/0.
[  OK  ] Unmounted /boot.
[  OK  ] Reached target Unmount All Filesystems.
[  OK  ] Stopped File System Check on /dev/mmcblk0p1.
[  OK  ] Removed slice system-systemd\x2dfsck.slice.
[  OK  ] Stopped target Local File Systems (Pre).
[  OK  ] Stopped Create Static Device Nodes in /dev.
[  OK  ] Stopped Remount Root and Kernel File Systems.
[  OK  ] Reached target Shutdown.
[  OK  ] Reached target Final Step.
         Starting Power-Off...

Here, after wait a few seconds:

[   91.252329] reboot: Power down
[   92.259992] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
[   92.259992] 
[   92.273118] CPU: 0 PID: 1 Comm: systemd-shutdow Tainted: G        W         4.19.16-bpi-r2-main #1
[   92.286032] Hardware name: Mediatek Cortex-A7 (Device Tree)
[   92.295587] [<c0114bbc>] (unwind_backtrace) from [<c010ea18>] (show_stack+0x20/0x24)
[   92.307376] [<c010ea18>] (show_stack) from [<c0b51c30>] (dump_stack+0x90/0xa4)
[   92.318713] [<c0b51c30>] (dump_stack) from [<c01286ac>] (panic+0x100/0x284)
[   92.329801] [<c01286ac>] (panic) from [<c012df00>] (complete_and_exit+0x0/0x2c)
[   92.341331] [<c012df00>] (complete_and_exit) from [<c014ece0>] (sys_reboot+0x170/0x218)
[   92.353621] [<c014ece0>] (sys_reboot) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[   92.365650] Exception stack(0xde913fa8 to 0xde913ff0)
[   92.375103] 3fa0:                   ffffffff 00000000 fee1dead 28121969 4321fedc 4321fedc
[   92.387799] 3fc0: ffffffff 00000000 00495038 00000058 bef56c88 00495028 fffff000 bef56e74
[   92.400551] 3fe0: 00493f20 bef56ba0 0048fb18 b6c9e598
[   92.410235] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
[   92.410235]  ]---

and BPI is not powered off. My BPI-R2 is rev V1.1

I have soldered power-button so I blacklist mtk_pmic_keys module to avoid boot loop.

I done more tests - distribution the same as in my previous post: Raspbian with kernel 4.19.16 and two BPI-R2 motherboards: 1st MB - on this I have burned BPI-R2-EMMC-boot0-DDR1600-0k-0905.img.gz to /dev/mmcblk1boot0 to be able to boot from eMMC (it was described here: BPI-R2 new image : ubuntu 16.04 V1.2.1 BT and WIFI AP mode are working fine 2017-11-27 in point “5. FAQ” subpoint “g”) 2nd MB - really new one, eMMC not touched only SD with OS inserted

and on the 1st MB I have kernel panic but the 2nd MB orrectly powered off on poweroff command.

Which one image I can use to test (for mmcblk1boot0) but having the possibility to boot from eMMC too?

as i have not soldered my power-switch i cannot test this…

is your second board also hw rev 1.1? if it is rev 1.2 you have a switch for selecting boot-device if both having a valid preloader installed.

in rev 1.1 emmc is only used, if sd-boot is not possible (not inserted or at least no preloader).

to boot from emmc you need preloader on emmc (boot0-partition) and uboot with pointing to emmcs-root-device (depending on kernel used). official and my kernel have mmc swapped (sd=mmcblk0,emmc=mmcblk1). so you need to load kernel with uboot from right device (in uboot sd=mmc dev 1, emmc=mmc dev 0) and set your root in bootargs to right partition (from kernel view)

The new MB is rev 1.2

you can try my debian (https://drive.google.com/open?id=1oP7jy1KrrIOifvImo2nQ59wx3_9hHkgk 4.14.80) burn to mmcblk1+ preloader to boot0 but you need to change in uenv.txt partition 1:1 to 0:1 and root to /dev/mmcblk1p2 (should be mmcblk0p2) and in root-partition/etc/fstab (mountpoint for /) also to /dev/mmcblk1p2

New few test. Slackarm updated to the fresh current version, kernel the same: 4.19.16 and two BPI-R2 MB: 1st rev 1.1 with soldered power-switch and second rev 1.2 without soldered power-switch.

On both now I haven’t kernel panic but on the 1st a have:

INIT: Switching to runlevel: 0
INIT: Sending proceRunning shutdown script /etc/rc.d/rc.0:
INIT: version 2.93 reloading
Saving system time to the hardware clock (localtime).
Stopping system message bus...
Unmounting remote filesystems:
Stopping udevd
Sending all processes the SIGTERM signal.
Sending all processes the SIGKILL signal.
Saving random seed from /dev/urandom in /etc/random-seed.
Turning off swap.
Unmounting local file systems:
/sys                     : ignored
/proc                    : ignored
/                        : successfully unmounted
Remounting root filesystem read-only:
mount: /dev/mmcblk0p2 mounted on /.
[   60.111412] reboot: Power down

and MB no powering off - still on.

The 2nd powered off correctly after poweroff command.

If something from mmcblk1boot0 (eMMC boot part) can have impact on this situation on 1st BPI-R2?

I done one more test with 2nd MB (BPI-R2 rev v1.2) without soldered power-switch and not touched eMMC. But, to UP it automatically when power back I connected 5V to otg. And, on poweroff command I have the same result as on the 1st MB with soldered power-switch. MB was not powered off but keep stay on [.................] reboot: Power down message :slight_smile:

Result are the same with and without acpid.

Thank you for your tests,but currently i have no idea how to “fix” it. Maybe it’s impossible to power it off if it is externally “forced” to power-on (with bridged power-switch/otg-power).

How do you want to power it on if you have it powered off (disabled power-switch)? I think there can be no solution.

Yes @frank-w, you have right, it is true. I’m awareness about this circle :slight_smile: