Kernel Config BPI-M4

Hello Banana Pi team,

Can you please help me to understand the Kernel build and install process the Banana Pi M4, and verify that the Kernel posted in GitHub actually works?

Here are the steps I take:

  1. Download an official Banana Pi M4 image (I choose Ubuntu, but it does not matter really), and flash it to SD Card. Insert into BPI M4, and power up, to confirm that the board is good, and, the BPI-M4 image file got burned to SD Card correctly. This works fine, so we know that the image is good. Now, I try a custom kernel, using a default kernel configuration, no changes made:

  2. git clone

  3. ./build 1 This process takes a long time of course, but, it completes successfully.

  4. Remove the SD Card I already burned and tested from the BPI-M4, and insert it back into my PC, and it get’s mounted at ‘/dev/sdc’

  5. ./build 7 This process completes successfully, it writes the kernel and u-boot to the SD Card.

  6. Insert the SD Card back into the M4 board, and try to boot it again. It will not successfully boot, failing with kernel panics after a couple of seconds. Specifically, it makes it through the u-boot, the kernel begins to load, and it reaches a point where it attempts to perform an ‘fsck’. This always fails, and will either cause a kernel panic, or sometimes just drop to ‘initramfs’

So, as you can see in this process, I have not modified the kernel, it is simply cloned from GitHub, built, and then installed. And it does not work.

Or, am I missing a step and doing it incorrectly?

Thanks for any help you can provide.

I had the same problem when compiling the kernel. Looks like the memory@0 settings in the device tree cause the kernel pancis.

Try changing the boot config to use the 1GB version instead of the 2GB dtb in /boot/bananapi/bpi-m4/linux/uEnv.txt.

Will give that a try today, thanks @f0i! I’ll update the thread with results once I have them.

@f0i Yes, that change fixed it, and I am now able to boot with my custom kernel! Oddly, I have now lost onboard Wi-Fi, but that is a different problem to track down. Thanks for the pointer!

1 Like