Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Where did mkknlimg go?
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Sat Jan 11, 2020 10:29 am    Post subject: Where did mkknlimg go? Reply with quote

Hi All,

I'm using a raspberry pi 2B with a custom kernel compiled from sys-kernel/raspberrypi-sources. So far i've been using sys-kernel/raspberrypi-sources-4.19.9999, and now i'm updating to 5.4.9999.
With kernel 4.19 i had to compile the kernel and run scripts/mkknlimg to create an image which i could use under /boot. With kernel 5.4 mkknlimg is gone, what is the correct way of working with 5.4?

Thanks in advance.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Sat Jan 11, 2020 10:45 am    Post subject: Reply with quote

pa4wdh,

mkknlimg has not been required for a long time.

You install the kernel modules the normal way.
The *.dtb go into /boot (I think mkknlimg combines them)

On ARM (32 bit) I think bzImage works for your kernel, if not, its Image.
Depending on how you load the kernel, you may need to rename it. What to depends on how you load the kernel,

You can use any name you like if you have kernel= line in config.txt
If you use bootcode.bin autodetect, it needs to be kernel7.img

Don't forget to update your firmware before you install the kernel bits and pieces.
The firmware update will provide everything your kernel build does and more. You do the firmware update first, so your own build overwrites the provided firmware when there is a name collision.
You can prevent the name collision if you want to.

Did you know that later Pi2s have 64 bit CPUs?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Sat Jan 11, 2020 11:05 am    Post subject: Reply with quote

NeddySeagoon wrote:
pa4wdh,

mkknlimg has not been required for a long time.

8O oops ...

Quote:

You install the kernel modules the normal way.
The *.dtb go into /boot (I think mkknlimg combines them)

As far as i know mkknlimg did nothing with the dtb's, i used make dtbs_install to get them to /boot/dtbs/<kernel version> from where i copied them to /boot and /boot/overlays

Quote:

On ARM (32 bit) I think bzImage works for your kernel, if not, its Image.
Depending on how you load the kernel, you may need to rename it. What to depends on how you load the kernel,

You can use any name you like if you have kernel= line in config.txt
If you use bootcode.bin autodetect, it needs to be kernel7.img

I'll experiment with the, so far i've been using Images. I named them /boot/gentoo.img and have kernel=gentoo.img config.txt

Quote:

Don't forget to update your firmware before you install the kernel bits and pieces.
The firmware update will provide everything your kernel build does and more. You do the firmware update first, so your own build overwrites the provided firmware when there is a name collision.
You can prevent the name collision if you want to.

I'm not really sure which firmware you are referring to, can you please elaborate?

Quote:

Did you know that later Pi2s have 64 bit CPUs?

No i didn't, and it sounds good :) Do you know how to find out if it's 64bit capable?
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Sat Jan 11, 2020 11:36 am    Post subject: Reply with quote

pa4wdh,

Read the text along the GPIO pins. If if says "Raspberry Pi 2 Model B V1.1", Its a BCM2836 which was an expensive Pi2 only CPU. Its 32 bit only.
Later Pi 2s are fitted with the 64 bit BCM2837. With very good eyesight you can read the numbers on the top of the CPU, unless you have a heatsink on it :)

Code:
raspberrypi-firmware
provides all the kernel, dtbs, dtb and kernel modules, for all the Pis as well as bootcode.bin and the other files that run on the GPU at startup.
There is even a 64 bit kernel, called kernel8.img.
If that boots, you have a 64 bit Pi.

Code:
$ eix raspberrypi-firmware
* sys-boot/raspberrypi-firmware
     Available versions:  ~*1.20190215^bs ~*1.20190709^bs ~*1.20190925^bs **9999*l^bs


git log boot/kernel8.img says
Code:
commit d21cd6bbab22bba1615df15354015bc50b085ddc
Author: popcornmix <popcornmix@gmail.com>
Date:   Tue Sep 3 23:38:20 2019 +0100

    kernel: Build 64-bit kernel8.img for testing
So kernel8.img was added on 3 Sep.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Sat Jan 11, 2020 1:31 pm    Post subject: Reply with quote

Thanks for all the info Neddy.

The text(s) on the hardware are very hard to read, it's all covered by a HAT (a GPS HAT, i use it as a NTP server).
The firmware seems useful :) The firmware i'm using now is dated 23rd of july 2017 when got them from github. So i'll give that (and kernel8.img) a try.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Sat Jan 11, 2020 1:51 pm    Post subject: Reply with quote

pa4wdh,

I use the kernel and firmware from the Foundation git tree.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Sat Jan 11, 2020 2:33 pm    Post subject: Reply with quote

Some things worked, some things didn't.

I installed the raspberrypi-firmware package, and after the obvious file collisions have been resolved and I placed back my original cmdline.txt and config.txt my 4.19 kernel booted without a problem. Also when i replaced it with a zImage of the 4.19 kernel (so without using mkknlimg) it worked.
When i copied a zImage of my 5.4 kernel and all dtb(o)'s to the correct places it didn't boot at all, so for now i'm back to 4.19.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Sat Jan 11, 2020 4:31 pm    Post subject: Reply with quote

pa4wdh,

pa4wdh wrote:
... it didn't boot at all ...


Did the rainbow appear and disappear?
After that it will seem like a long time until the console appears. Its about 20 sec.
To get an early console, enable Simple Framebuffer in the kernel.

How did you configure your 5.4 kernel?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Sun Jan 12, 2020 11:52 am    Post subject: Reply with quote

Thanks for your help Neddy. I was trying to find my way info troubleshooting and come to similar questions.

Quote:

Did the rainbow appear and disappear?

It does appear, it does not disappear and both leds are off.
As far as i understand now that indicates trouble loading the kernel. I found some remarks to add "boot_delay=1" to config.txt bit that didn't change the results.

Quote:

After that it will seem like a long time until the console appears. Its about 20 sec.
To get an early console, enable Simple Framebuffer in the kernel.

With the 4.19 kernel the rainbow disappears and i immediately see the kernel booting. I'd expect the same with the 5.4 kernel.
Is that correct?

Quote:

How did you configure your 5.4 kernel?

I configured the 4.19 kernel starting from the provided default config and stripping out everything i didn't need and building into the kernel what i do need so i could switch off module support. The 5.4 config is based on that after copying that config and running make oldconfig.
You can see the resulting configuration over here: https://ernstagn.home.xs4all.nl/gentoo/logs/kernel-5.4.config
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Sun Jan 12, 2020 12:14 pm    Post subject: Reply with quote

pa4wdh,

That the rainbow never goes away shows that one of the files need to boot is not found.
As swapping kernels make it work, its down to the kernel and its matching .dtb.

You mostly get away with not updating the .dtb but every now and again ...

Check for mismatching kernel and *dtb filenames in /boot and config.txt.

You get a console right away as you have CONFIG_FB_BCM2708=y and its a module by default.
I use the default config with a few tweaks, so its a module here.

You have all the CPU frequency governors built
Code:
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
and you use
Code:
CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
unless you change it somehow.
That runs your CPU at 600MHz (its lowest possible speed) all the time. There is nothing wrong with that. You will need a CPU heatsink to go faster and avoid thermal throttling.

There is not much to say about your kernel yet as it never gets started.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Sun Jan 12, 2020 1:10 pm    Post subject: Reply with quote

NeddySeagoon wrote:
pa4wdh,
You mostly get away with not updating the .dtb but every now and again ...

Check for mismatching kernel and *dtb filenames in /boot and config.txt.

I thought i already did that, but to be sure i tried again, but no result.

Quote:

You have all the CPU frequency governors built
Code:
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
and you use
Code:
CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
unless you change it somehow.
That runs your CPU at 600MHz (its lowest possible speed) all the time. There is nothing wrong with that. You will need a CPU heatsink to go faster and avoid thermal throttling.

As said i use it as a GPS based NTP server, so unless it's updating (compiling) even the Pi is overpowered for this task :D
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Sun Jan 12, 2020 1:23 pm    Post subject: Reply with quote

pa4wdh,

I have kernels on Pi3 and Pi4 in 64 bit mode. I also have the cross compile toolchains for the Pi1 and Pi2 up to date.
My Pi1 is running my GPS clock. Its an early one, with only 256M RAM. As you say, at 600MHz its seriously overpowered. :)

I've dug out a Pi2 and I'll try to reproduce your kernel here. It won't be for 5 hours or so until I start.
Its sunny, I'm told I need to tidy up the garden right now. :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Sun Jan 12, 2020 6:08 pm    Post subject: Reply with quote

Thanks for you help Neddy.
Take your time, there's no need to hurry. i understand that sometimes there are other thinks more important than gentoo 8O
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Sun Jan 12, 2020 6:56 pm    Post subject: Reply with quote

pa4wdh,

Your kernel starts for me. Here's what I did.
Updated my git repos for the kernel and firmware.

Put your .config at the top of the kernel tree
Code:
ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- make oldconfig
Just in case. It did not ask any questions.

Code:
ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- make -j10
to cross compile the kernel.

Found a 4G SD card I forgotten I had, It has one partition on it for boot, so no attempt to provide or mount root. Mount the SD card to /mnt/cdrom/ and wipe it.
Go back to pi_firmware and
Code:
cp -r boot/* /mnt/cdrom/
to get all the Foundation provided files for /boot.
Move the Foundation kernel out of the way
Code:
mv /mnt/cdrom/kernel7.img /mnt/cdrom/kernel7_pi.img

Go back to the kernel tree and
Code:
cp arch/arm/boot/zImage /mnt/cdrom/kernel7.img
using the default name saves me providing a config.txt.
then
Code:
cp arch/arm/boot/dts/bcm*.dtb /mnt/cdrom
to get all the .dtb files that match the kernel.

The SD card then looked like
Code:
# ls /mnt/cdrom -al
total 58084
drwxr-xr-x  3 root root    32768 Jan  1  1970 .
drwxr-xr-x 12 root root     4096 Feb 19  2018 ..
-rwxr-xr-x  1 root root    23977 Jan 12 18:26 bcm2708-rpi-b.dtb
-rwxr-xr-x  1 root root    24240 Jan 12 18:26 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x  1 root root    23758 Jan 12 18:26 bcm2708-rpi-cm.dtb
-rwxr-xr-x  1 root root    23682 Jan 12 18:26 bcm2708-rpi-zero.dtb
-rwxr-xr-x  1 root root    24418 Jan 12 18:26 bcm2708-rpi-zero-w.dtb
-rwxr-xr-x  1 root root    25304 Jan 12 18:26 bcm2709-rpi-2-b.dtb
-rwxr-xr-x  1 root root    25433 Jan 12 18:26 bcm2710-rpi-2-b.dtb
-rwxr-xr-x  1 root root    26474 Jan 12 18:26 bcm2710-rpi-3-b.dtb
-rwxr-xr-x  1 root root    24240 Jan 12 18:21 bcm2710-rpi-3-b.dtb_32
-rwxr-xr-x  1 root root    27093 Jan 12 18:26 bcm2710-rpi-3-b-plus.dtb
-rwxr-xr-x  1 root root    24503 Jan 12 18:21 bcm2710-rpi-3-b-plus.dtb_32
-rwxr-xr-x  1 root root    25288 Jan 12 18:26 bcm2710-rpi-cm3.dtb
-rwxr-xr-x  1 root root    40717 Jan 12 18:26 bcm2711-rpi-4-b.dtb
-rwxr-xr-x  1 root root    18610 Jan 12 18:26 bcm2835-rpi-a.dtb
-rwxr-xr-x  1 root root    18730 Jan 12 18:26 bcm2835-rpi-a-plus.dtb
-rwxr-xr-x  1 root root    18756 Jan 12 18:26 bcm2835-rpi-b.dtb
-rwxr-xr-x  1 root root    19017 Jan 12 18:26 bcm2835-rpi-b-plus.dtb
-rwxr-xr-x  1 root root    18889 Jan 12 18:26 bcm2835-rpi-b-rev2.dtb
-rwxr-xr-x  1 root root    18721 Jan 12 18:26 bcm2835-rpi-cm1-io1.dtb
-rwxr-xr-x  1 root root    18682 Jan 12 18:26 bcm2835-rpi-zero.dtb
-rwxr-xr-x  1 root root    19038 Jan 12 18:26 bcm2835-rpi-zero-w.dtb
-rwxr-xr-x  1 root root    20009 Jan 12 18:26 bcm2836-rpi-2-b.dtb
-rwxr-xr-x  1 root root    20185 Jan 12 18:26 bcm2837-rpi-3-a-plus.dtb
-rwxr-xr-x  1 root root    20701 Jan 12 18:26 bcm2837-rpi-3-b.dtb
-rwxr-xr-x  1 root root    21498 Jan 12 18:26 bcm2837-rpi-3-b-plus.dtb
-rwxr-xr-x  1 root root    19878 Jan 12 18:26 bcm2837-rpi-cm3-io3.dtb
-rwxr-xr-x  1 root root    31776 Jan 12 18:26 bcm2838-rpi-4-b.dtb
-rwxr-xr-x  1 root root    52304 Jan 12 18:21 bootcode.bin
-rwxr-xr-x  1 root root    18693 Jan 12 18:21 COPYING.linux
-rwxr-xr-x  1 root root     3105 Jan 12 18:21 fixup4cd.dat
-rwxr-xr-x  1 root root     6197 Jan 12 18:21 fixup4.dat
-rwxr-xr-x  1 root root     9189 Jan 12 18:21 fixup4db.dat
-rwxr-xr-x  1 root root     9189 Jan 12 18:21 fixup4x.dat
-rwxr-xr-x  1 root root     2656 Jan 12 18:21 fixup_cd.dat
-rwxr-xr-x  1 root root     6745 Jan 12 18:21 fixup.dat
-rwxr-xr-x  1 root root     9817 Jan 12 18:21 fixup_db.dat
-rwxr-xr-x  1 root root     9819 Jan 12 18:21 fixup_x.dat
-rwxr-xr-x  1 root root  4140120 Jan 12 18:23 kernel7.img
-rwxr-xr-x  1 root root  5754904 Jan 12 18:21 kernel7l.img
-rwxr-xr-x  1 root root  5420824 Jan 12 18:21 kernel7_pi.img
-rwxr-xr-x  1 root root 13521408 Jan 12 18:21 kernel8.img
-rwxr-xr-x  1 root root  5143096 Jan 12 18:21 kernel.img
-rwxr-xr-x  1 root root     1594 Jan 12 18:21 LICENCE.broadcom
drwxr-xr-x  2 root root    32768 Jan 12 18:21 overlays
-rwxr-xr-x  1 root root   782812 Jan 12 18:21 start4cd.elf
-rwxr-xr-x  1 root root  4591396 Jan 12 18:21 start4db.elf
-rwxr-xr-x  1 root root  2782688 Jan 12 18:21 start4.elf
-rwxr-xr-x  1 root root  3544324 Jan 12 18:21 start4x.elf
-rwxr-xr-x  1 root root   690788 Jan 12 18:21 start_cd.elf
-rwxr-xr-x  1 root root  4859848 Jan 12 18:21 start_db.elf
-rwxr-xr-x  1 root root  2883140 Jan 12 18:21 start.elf
-rwxr-xr-x  1 root root  3797320 Jan 12 18:21 start_x.elf

All the files with a timestamp of Jan 12 18:21 are from the Foundation firmware repo. All the later files were produced by building the kernel.

Just to demonstrate I was doing it right, I renamed all the kernels except kernel7.img, which is what a Pi2 uses by default.

It booted as far as waiting for root, which is what I expected.
I can host the above if you want.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Sun Jan 12, 2020 9:48 pm    Post subject: Reply with quote

Thanks for the test Neddy, good to see the kernel boots on your Pi.

There are two differences in what we're doing:
1) I'm compiling native on the Pi with gcc 9.2.0, you seem to cross-compile, which version are you using?
2) You stick with the default filename (kernel7.img), just to be 100% sure i did the same and it did not make any difference.

It would be nice if you could share the compiled kernel with me to see how it works on my Pi.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Sun Jan 12, 2020 10:17 pm    Post subject: Reply with quote

pa4wdh,

My Pi2 boot is online.
I built the kernel and dtb files with the gcc-9.2 cross compiler.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Mon Jan 13, 2020 9:35 am    Post subject: Reply with quote

Thanks for providing all the files.

I've tried a few different steps:
First i thought i'd do a quick fix and just loaded your kernel7.img to my Pi and rebooted. This gave the same result as my own binary.
Then i downloaded your complete /boot and placed it on my sdcard and booted the Pi ... still the same result.
Now the only difference was my cmdline.txt and config.txt so i moved them out ... still the same result.

Is there a way to get more information from the Pi so see why it doesn't boot?
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Mon Jan 13, 2020 10:20 am    Post subject: Reply with quote

pa4wdh,

If its really not loading the kernel, you can get very little.
If you have a 3.3v USB to serial cable, then the serial port on the Pi is available but that will only show messages after the kernel has started.

The way the green LED flickers provides some diagnostic information. It all varies from model to model though.
Its on the Foundation website.

Can you try another SD card, or remaking the /boot filesystem on the one you have?
Only /boot matters until you get to Waiting for rootfs ...
The rainbow is gone by then, so that's enough to test that the /boot filesystem in OK.

I think that there is a debug option for config.txt but I've never used it.
I don't know where the debug info is emitted.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Mon Jan 13, 2020 11:50 am    Post subject: Reply with quote

I actually cleaned and re-created /boot after i experimented with your /boot files.

I cleaned /boot, re-emerged rastberrypi-firmware, copied the dtb(o)'s, copied config.txt, cmdline.txt and of course the kernels. Still, same result. The only think i can do to have a more from-scratch start is to actually format the partition and start over.

On a failed boot this is what the LED's do:
1) First, the red led lights
2) The green led gives a few (very) short blinks, i guess this is from accessing the sdcard for it's files in /boot.
3) Then there is one distinctive longer blink of the green led, this might be an indication for the problem
4) Both leds turn off and the system becomes unresponsive to anything but a power-cycle.

All documentation i found describe multiple flashes of the lights and the sequence repeats, both don't seem to happen in my case.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Mon Jan 13, 2020 12:27 pm    Post subject: Reply with quote

pa4wdh,

The on a Pi2, the Red LED is power good. Its lit when the supply voltage is above about 4.6v.
Try a different PSU.

This page is worth a read. In particular,
elinux.org/R-Pi_Troubleshooting wrote:
With current firmware, a coloured splash screen (actually its just four pixels "blown up" by the GPU to full screen) is displayed after GPU firmware (start.elf) is loaded. This should be replaced by linux console a second later. However if the coloured screen remains, it suggests the kernel.img file is failing to boot. Try replacing it with a known good one.


The Pi reads the SD card as you see the rainbow.

elinux.org/R-Pi_Troubleshooting wrote:
Immediately after displaying the splash screen, the PI starts consuming a little more current. If the PI resets at that moment, it is an indication that the power supply isn't able to deliver the full current your PI requires, but dips its output voltage below a minimum when loaded with the full current the PI needs.


It looks like the PSU never recovers to above about 4.6v. If the Pi reset, it would cycle, reset reboot ... and flash the LEDs over and over.
Well, it would if the PSU recovered. Remove the GPS HAT. The will reduce the power requirement.
Then again, if it were PSU, it would be kernel independent.

Remove/rename the kernel, so its not found. The Pi will not start the ARM CPU. Does the Red LED stay lit?
Again, this reduces the power requirement.

With a marginal PSU, like a random mobile phone charger, wear and tear on the power connector is enough to make the difference between working and not working.
Mobile phone chargers are usually 4.7v, not the 5v they actually marked, to suit lithium battery charging, so there is less than 0.1v of margin.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Tue Jan 14, 2020 10:01 am    Post subject: Reply with quote

It would indeed be strange for a newer kernel to cause such a change in the power requirements, but to be sure i did some tests.

I have tried 3 "power supplies":
1) A dual charger 5V/2A which i normally use to power the Pi
2) My regular phone charger 5V/1A
3) A USB 3 port on my laptop which should be capable to providing enough power for the Pi

I have tried 2 cables:
1) The cable i usually use to power the Pi (which advertises itself as a high-quality power-only cable)
2) The USB cable i usually use to power/connect my phone

All combinations gave the same result: Kernel 4.19 boots perfectly, kernel 5.4 doesn't.

Then i removed the ethernet cable (lower power consumption), removed the GPS hat and connected a multimeter to the 5V and GND pins on the GPIO connector. The USB port on my laptop provided the best results, keeping it around 5V regardless of the load. The power supplies both dropped to about 4.85V, even when ethernet and the GPS hat are connected and all 4 cores are fully loaded.

Long story short, i don't think this is a power supply problem.

I also tested the scenario where i configured a kernel in config.txt which does not exist. In that case i saw the green led blinking (forgot the number of times it blinked) and the pattern repeated.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Tue Jan 14, 2020 10:32 am    Post subject: Reply with quote

pa4wdh,

OK, we have learned lots of things that it isn't. That's a start.
Don't be too taken in by multimeter readings. That tells the average voltage, so its useful but not conclusive.
5v with 1.0v of ripple (4.5v to 5.5v) is worse than 4.8v with 0.2v ripple (4.7v to 4.9v).
Its good to know that when the Red LED goes off, its not the power failed. The Pi has shut down.

That you get repeated attempts to boot when the kernel is not found is good. That's the repeating flashing Green LED.
It indicates SD card reads.

Lets rule out a corrupt kernel file.

On the SD card I booted from, I get
Code:
# md5sum kernel7.img
8c597e979d4ae5379d08d6372117c3ba  kernel7.img


and its the same on my server, which in good.
Code:
$ md5sum kernel7.img
8c597e979d4ae5379d08d6372117c3ba  kernel7.img


Test it on your SD card ... just in case.

While the HAT is off, can you read the model and version of the Pi?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Tue Jan 14, 2020 1:37 pm    Post subject: Reply with quote

NeddySeagoon wrote:
pa4wdh,
OK, we have learned lots of things that it isn't. That's a start.
Don't be too taken in by multimeter readings. That tells the average voltage, so its useful but not conclusive.
5v with 1.0v of ripple (4.5v to 5.5v) is worse than 4.8v with 0.2v ripple (4.7v to 4.9v).

I actually grabbed my oscilloscope (actually a GBDSO: http://www.radanpro.com/Radan2400/TestShematics/GameBoyScope.pdf :D ) and measured. The ripple is about 0.05V when in use (Linux running, HAT and ethernet attached). Well within margins I think.

Quote:

Lets rule out a corrupt kernel file.

On the SD card I booted from, I get
Code:
# md5sum kernel7.img
8c597e979d4ae5379d08d6372117c3ba  kernel7.img


and its the same on my server, which in good.
Code:
$ md5sum kernel7.img
8c597e979d4ae5379d08d6372117c3ba  kernel7.img


Test it on your SD card ... just in case.

I actually downloaded again, md5 matches, and rebooted, but no success.

Quote:

While the HAT is off, can you read the model and version of the Pi?

That something i indeed could have done .... but forgot and the HAT is on again :roll:
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47055
Location: 56N 3W

PostPosted: Tue Jan 14, 2020 2:54 pm    Post subject: Reply with quote

pa4wdh,

I'm sort of running out of ideas.
Post
Code:
ls -l /boot
and the content of your config.txt.

It bothers me that my kernel works for me but not for you. My Pi2 is 32 bit only. If you have a 64 bit capable Pi2, yo need a different dtb, but with no config.txt, bootcode.bin should do the right thing.
Code:
bcm2709-rpi-2-b.dtb
bcm2710-rpi-2-b.dtb
the first one is for 32 bit only Pi2s.

If I can't spot anything in boot, the next thing to try is the default kernel. It fact, that's in the pi_firmware repo, so maybe try that first.
You won't get a console until the modules load, so you need to install the modules too.

I like that 'scope :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 418

PostPosted: Tue Jan 14, 2020 6:04 pm    Post subject: Reply with quote

It's sort-of nice to see i'm not the only one puzzled by this ... :)

The outputs you requested:
Code:

ntp-server /boot # ls -l
total 36060
-rwxr-xr-x 1 root root   23481 Jan 14 18:58 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x 1 root root   23222 Jan 14 18:58 bcm2708-rpi-b.dtb
-rwxr-xr-x 1 root root   22999 Jan 14 18:58 bcm2708-rpi-cm.dtb
-rwxr-xr-x 1 root root   23683 Jan 14 18:58 bcm2708-rpi-zero-w.dtb
-rwxr-xr-x 1 root root   22947 Jan 14 18:58 bcm2708-rpi-zero.dtb
-rwxr-xr-x 1 root root   24549 Jan 14 18:58 bcm2709-rpi-2-b.dtb
-rwxr-xr-x 1 root root   26422 Jan 14 18:58 bcm2710-rpi-3-b-plus.dtb
-rwxr-xr-x 1 root root   25803 Jan 14 18:58 bcm2710-rpi-3-b.dtb
-rwxr-xr-x 1 root root   24601 Jan 14 18:58 bcm2710-rpi-cm3.dtb
-rwxr-xr-x 1 root root   17921 Jan 14 18:58 bcm2835-rpi-a-plus.dtb
-rwxr-xr-x 1 root root   17805 Jan 14 18:58 bcm2835-rpi-a.dtb
-rwxr-xr-x 1 root root   18208 Jan 14 18:58 bcm2835-rpi-b-plus.dtb
-rwxr-xr-x 1 root root   18084 Jan 14 18:58 bcm2835-rpi-b-rev2.dtb
-rwxr-xr-x 1 root root   17951 Jan 14 18:58 bcm2835-rpi-b.dtb
-rwxr-xr-x 1 root root   17999 Jan 14 18:58 bcm2835-rpi-cm1-io1.dtb
-rwxr-xr-x 1 root root   18347 Jan 14 18:58 bcm2835-rpi-zero-w.dtb
-rwxr-xr-x 1 root root   17873 Jan 14 18:58 bcm2835-rpi-zero.dtb
-rwxr-xr-x 1 root root   18764 Jan 14 18:58 bcm2836-rpi-2-b.dtb
-rwxr-xr-x 1 root root   20181 Jan 14 18:58 bcm2837-rpi-3-b-plus.dtb
-rwxr-xr-x 1 root root   19392 Jan 14 18:58 bcm2837-rpi-3-b.dtb
-rwxr-xr-x 1 root root   52296 Jan 13 10:30 bootcode.bin
-rwxr-xr-x 1 root root      59 Jan 13 10:25 cmdline.txt
-rwxr-xr-x 1 root root      61 Jan 14 18:58 config.txt
drwxr-xr-x 5 root root    2048 Jan 12 22:46 dtbs
-rwxr-xr-x 1 root root    6736 Jan 13 10:30 fixup.dat
-rwxr-xr-x 1 root root    6167 Jan 13 10:30 fixup4.dat
-rwxr-xr-x 1 root root    3073 Jan 13 10:30 fixup4cd.dat
-rwxr-xr-x 1 root root    9247 Jan 13 10:30 fixup4db.dat
-rwxr-xr-x 1 root root    9249 Jan 13 10:30 fixup4x.dat
-rwxr-xr-x 1 root root    2657 Jan 13 10:30 fixup_cd.dat
-rwxr-xr-x 1 root root    9808 Jan 13 10:30 fixup_db.dat
-rwxr-xr-x 1 root root    9810 Jan 13 10:30 fixup_x.dat
-rwxr-xr-x 1 root root 3890272 Dec  7 15:43 gentoo4.img
-rwxr-xr-x 1 root root 4135024 Jan 11 16:22 gentoo5.img
-rwxr-xr-x 1 root root 4140120 Jan 12 23:14 kernel7.img
drwxr-xr-x 2 root root    2048 Jan 13 10:24 org
drwxr-xr-x 2 root root   16384 Jan 14 18:58 overlays
-rwxr-xr-x 1 root root 2877988 Jan 13 10:30 start.elf
-rwxr-xr-x 1 root root 2769540 Jan 13 10:30 start4.elf
-rwxr-xr-x 1 root root  770816 Jan 13 10:30 start4cd.elf
-rwxr-xr-x 1 root root 4733128 Jan 13 10:30 start4db.elf
-rwxr-xr-x 1 root root 3683816 Jan 13 10:30 start4x.elf
-rwxr-xr-x 1 root root  685668 Jan 13 10:30 start_cd.elf
-rwxr-xr-x 1 root root 4854728 Jan 13 10:30 start_db.elf
-rwxr-xr-x 1 root root 3792232 Jan 13 10:30 start_x.elf
ntp-server /boot # cat config.txt
gpu_mem=16

dtoverlay=pps-gpio,gpiopin=4

kernel=gentoo4.img
ntp-server /boot #

kernel7.img is your kernel, gentoo4.img is my 4.19 kernel, gentoo5.img is my 5.4 kernel.

The bcm2709-rpi-2-b.dtb and bcm2710-rpi-2-b.dtb file made me aware that the bcm2710 variant is not available for kernel 4.19 and is available for 5.4. Maybe it's worth a try to remove it to sort of force the bootloader to the bcm2709 file. And indeed, using the precompiled kernel is worth a try.

Edit: Removing the 2710 file didn't work.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum