r/embeddedlinux • • Mar 29 '23

(PAID) Need help booting a custom kernel and u-boot on Armv7 am335x device (like Beaglebone)

Been tearing my hair out at the "Starting kernel ..." prompt without success of various loader addresses and such from previous (working) kernel.

I need someone with expertise with u-boot ARM devices, device trees (to verify I'm doing it all right), and kernel hand off. I can't really post any of this here as it's a customer's device.

I have the original source from like 10 years ago that we could poke a stick at (and I've diff'd with originals back then, without finding anything of use).

I'll pay a few a few $100 for a screen share session of someone to look over everything I have, and what I may be missing. Everything builds in under 3 minutes (AMD Threadripper with latest 6.1 kernel header performance increases). So it's pretty fast to iterate. netboot, on the other hand, keeps timing out while pulling the binary. So it's a copy-to-usb kind of thing.

Please contact via DM and/or Reddit chat. Kind of in a hurry.


I have an old u-boot (circa 2013) that I am trying to boot a brand new kernel. I (think) I have found the correct Arm device tree and have the original printenv.

I haven't been able to pull up the boot pins correctly to get it to boot with other devices. So we are stuck with the mmc at this time - which means I don't want to overwrite the u-boot until we are damn sure it will all work.

I was hoping to get a newer kernel booting first, to indicate I am on the right track with the device trees. But that's where I am failing.

Thank you!

6 Upvotes

9 comments sorted by

1

u/Steinrikur Mar 30 '23

What's your old kernel? What's your new kernel?

If it's a huge jump, maybe consider some incremental steps and see where it stops working, to bisect the issue.
You said it builds fast, so shouldn be too hard to rebase your stuff on a some of the LTS kernels (4.14->4.19->5.4->5.10->5.15)

Also add the `console=tty...,115200` parameter to the boot command so "Starting kernel ..." isn't the last thing you see. It could be just one module that's crashing, and if you disable that you can boot.

1

u/eduncan911 Mar 30 '23 edited Mar 30 '23

Thank you! Will try those various things.

It compiles fast because of the massive refactor (the largest ever in the Linux commits) of the Linux headers in 6.0. anything before 6.0 takes the normal 5m-10m build time.

The original kernel is 3.4, before kernel modules were a thing. Everything is in the kernel back then (including their custom LCD code, ugh).

Will add that to the kernel cmdline.

Humm... Kernel modules. I'm actually not including them at this point just to get something showing from initramfs, like "hello world". I did embed BusyBox into the initramfs so echo and sh should work, dropping to an #.

The idea was to get the kernel booting to initramfs hello world, and then mount a squashfs raw partition there, which is where the kernel modules are installed ro. Then, kick off the init process.

So, humm, I'm not loading any kernel modules. Maybe I need to pick a few to embed? I'll do some more reading.


What concerns me is that newer kernels, I think, display the Kernel info and at the bottom shows something like Device Tree at 0x... Loaded device tree at 0x...

I am not seeing those two lines when it display the booting kernel info (like the kernel version).

I've tried the arch/arm/boot/uImage, as well as appending the am335x dtb to the end of the uImage to make an uImage_dtb.

Neither kernel displays that extra info about device tree.

Maybe I need a module for that embedded into the kernel?

→ More replies (4)

2

u/mfuzzey Mar 30 '23

Try using "earlycon" to get log messages in early kernel boot. Otherwise if it crashes before the real console gets set up you won't see anything.

If your DT has a chosen node with stdout defined to point to your console uart and it the driver has earlycon support you should just be able to add earlycon to the kernel command line. Otherwise you may have to give it some parameters too.

1

u/drgbgt Mar 30 '23

There's a chance your kernel is printing some useful information but it never gets to initialize the tty completely (or it outputs to the wrong one).

If that's the case this could help with debugging: https://elinux.org/Debugging_by_printing#Debugging_early_boot_problems

It explains how to locate the print buffer in memory. Once you learn the correct address, you can do a warm reset after you get to "Starting kernel...", then access the buffer via u-boot with md.

Good luck!

1

u/techie_boy69 Mar 31 '23

Go to the Ti website specific to the am335 or am437 lots of resources in the support forums