Custom u-boot configuration fails to initialize timer (err 19)

Just what the title says. I’m using a custom configuration for u-boot, but when I try to boot the system I get an error.

CPU : AM335X-GP rev 2.1
Model: TI AM335x PocketBeagle
DRAM: 1 GiB
Core: 155 devices, 16 uclasses, devicetree: separate
Could not initialize timer (err -19)

I started by checking our u-boot configuration, and nothing stuck out; timers are configured the same as they are in am335x_evm_defconfig.

There haven’t been any changes to the device tree. We’re using the stock one for the am335x_evm I believe.

I’ve used changed things like that my using the device tree - rather than modifying uboot to bit bang certain ports. Device tree makes it easier to follow. What timings are you changing? Let me see if you can do the same in device tree.

I need to dig a bit more into this and will update soon. Since I’m inheriting our port of u-boot, I can’t be certain about the extent of our modifications.

Presently, I am unaware of any modifications to the timing. Our configuration is relatively close to stock; the largest change would be to allow u-boot to find it’s own fdt using a preprogrammed boot string.

pretty sure it’s a variation of: am335x-osd335x-common.dtsi: set tick-timer = &timer2;, to fix Could n… · beagleboard/u-boot@d0771d5 · GitHub

Hmmm, I see this in am335x_evm.dts. Maybe it’s not getting used?

	chosen {
		stdout-path = &uart0;
		tick-timer = &timer2;
	};

I assume this is configured one of these tags.

CONFIG_SYS_ARCH="arm"
CONFIG_SYS_CPU="armv7"
CONFIG_SYS_SOC="am33xx"
CONFIG_SYS_VENDOR="ti"
CONFIG_SYS_BOARD="am335x"
CONFIG_SYS_CONFIG_NAME="am335x_evm"

I found a patch from Janurary that adds tick-timer to all the upstream device trees.

https://lists.denx.de/pipermail/u-boot/2026-January/608684.html

I think this is the think I’m missing.

edit: I tried manually adding this information, but no luck.

I have since confirmed that my u-boot device tree container a reference to tick-timer. Here is a snippet.

/ {
	compatible = "ti,am335x-evm", "ti,am33xx";
	interrupt-parent = <0x01>;
	#address-cells = <0x01>;
	#size-cells = <0x01>;
	model = "TI AM335x EVM";

	chosen {
		stdout-path = "/ocp/l4_wkup@44c00000/segment@200000/target-module@9000/serial@0";
		tick-timer = "/ocp/interconnect@48000000/segment@0/target-module@40000/timer@0";
	};

Maybe it isn’t related to the device tree?

Look at the file model name and what serial output shows, your comparing two different files..

1 Like

Hmm. Probably worth going over how uboot works, as the background is part of what is discussed here. Assuming that uboot has managed to get running in the first place (an art form in itself) - it then has to work out how to bring up the kernel. Now this is dependent on several factors, for all boards, and the am335x in particular.

E.g. a generic am335x may be booting off MMC chip, or an sD card, these may be wired on certain pins (different for each am335x type), and there may be provisos (early EVM boards and initially you could only access the sD card in 1 bit mode). In particular the am335x pinmux needs to be configured so that which ever pins the mmc/sD is wired to are configured in the am335x to use the part of the chip that handles such devices (e.g. they probably aren’t a general GPIO pin, but have a specific am335x driver).

Now historically uboot would have a different configuration for each board, that would give the configuration needed. Some when in the past (about 2020) there we a lot of am33x boards, each of which in eeprom had a signature for that board. So uboot merged all of these into am335x_env_defconfig. In order to give the different configuration of each of these boards, uboot has a fragment of the device tree in uboot, for all the boards. This fragment gives how the pins need to be accessed for each board. So first uboot identifies the board through the eeprom, then selects the right device tree fragment, and then applies whatever is there for accessing the kernel and deice root.

The uboot loads the kernel, with the right device tree (both taken from the mmc/sd) and boots the machine. Then linux when coming up, does the proper am335x configuration, with the proper device tree.

Why this is relevant, is it sounds like some of the timings, in you case have been messed with. This could be in uboot (so how its identified the board), or in the device tree that uboot tells the kernel to use when it boots (usually it selects the correct one).

You’ll need to identify which of these has been messed with. Has uboot identified the correct board time from the eeprom. Has uboot set the right am335x configuration to load the kernel and device tree? Has uboot selected the right device tree to use?

Each of these could have been messed with in modifying uboot - you’ll need to understand which. The crux is why not use a generic uboot, and the just have it boot the correct device tree, with whatever overlays you need for your particular configuration.

1 Like

Thank you for the background!

It seems like I underestimated the scope of this project. I’ll have to do some more RCA to figure out where our setup has diverged.

Where can I find the configuration that the official beagle board images use for building u-boot? I don’t currently have a baseline.

I think I should probably start from am335x_evm_defconfig though, right?

The target I’m building for is an OSD335x. We have a few original PBGLs supporting the SOM on hand.

Still this branch: GitHub - beagleboard/u-boot at v2022.04-bbb.io-am335x-am57xx

Full Changes: Commits · beagleboard/u-boot · GitHub

Sometime after EW in March, i’ll look at updating this again to v2025.x/v2026.x era…

Regards,

Do you know what’s up with the $BOARD-u-boot.dtsi files? I can’t seem to find any dts files that import them. I assume these are meant to be used as the minimum device tree, specifying just boot-critical on-chip and on-board peripherals.

What about it? they aren’t used in the v2022.04 branch for am335x/beagle… yet..

anything … board-u-boot.dtsi is ‘local’ u-boot changes on top of the base device-tree… no where to import them from…

1 Like

Just a curiosity. I just don’t see where they hook into the build.

Two updates:

I changed the default device tree to am335x-pocketbeagle after implementing changes to am335x-osd335x-common.dtsi from your linked commit above. Here’s the diff from the am335x_evm_defconfig.

cullen@thnkPD $ diff defconfig configs/am335x_evm_defconfig 
8c8
< CONFIG_DEFAULT_DEVICE_TREE="am335x-pocketbeagle"
---
> CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
21d20
< CONFIG_BOOTDELAY=0

This is the device tree I get now

/ {
        compatible = "ti,am335x-pocketbeagle", "ti,am335x-bone", "ti,am33xx";
        interrupt-parent = <0x01>;
        #address-cells = <0x01>;
        #size-cells = <0x01>;
        model = "TI AM335x PocketBeagle";

        chosen {
                tick_timer = "/ocp/interconnect@48000000/segment@0/target-module@40000/timer@0";
                stdout-path = "/ocp/l4_wkup@44c00000/segment@200000/target-module@9000/serial@0";
        };

Still no luck. Maybe it’s related to how to board is detected via the bootstring?

U-Boot SPL 2024.10-00003-g369ff7cf8cc9-dirty (Feb 27 2026 - 11:17:38 -0800)
Trying to boot from MMC1


U-Boot 2024.10-00003-g369ff7cf8cc9-dirty (Feb 27 2026 - 11:17:38 -0800)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x PocketBeagle
DRAM:  1 GiB
Core:  155 devices, 16 uclasses, devicetree: separate
Could not initialize timer (err -19)

U-Boot 2024.10 I’ll look at that after EW

1 Like

Yes the device tree selected will depend on the board type detected in the eeprom. In your case it has already identified that its a pocketbeagle - so should have already identified the correct device tree. I’ll see if I can find where it is in the uboot source code - so you can see.

Your problem seems very early in uboot - suspect if you interrupt it you probably can’t even see the sd card, can you confirm. Think the command is “mmc list” and “mmc dev” and “mmc dev 0” or something like that, then can use “ext4ls mmc 0 /boot” or something like that.

If its wrong in the uboot device tree, this to me suggests you have a timing problem on your board (I had that with a machine that had emmc once, where you couldn’t run at the advertised 400MHz speed, so needed to down clock to 200MHz). If so will need to work out how to modify it, e.g. can you even see the sd card (and so can have some uboot startup script to modify it), or do we need to hack the uboot source code (ugly as anything).

Anyway crux is to interrupt uboot - and see what you can see from the command line with the cryptic uboot command line …

OK its worth reading these bits of u-boot mainline source code:

am335x_evm.h - this is where it matches the bits read from eeprom to the device tree used.
Device Trees and more - Think these are the device trees that uboot has in the code, just so it can bring up the board enough to access the kernel and proper device trees
General stuff for am335x - this does the pin mux, just to see the mmc and uart; And more of the code for looking up which type of am335x it is. And various other initialisations.

It shows how much uboot has to bring up, just to be able to load the kernel proper …

1 Like

Nice, thanks for the through tips. It seems like I’ll need to dig into this issue a bit more.