BeagleBone Black clock mismatch without pullups

25 views
Skip to first unread message

pbft

unread,
Jan 16, 2019, 3:53:33 PM1/16/19
to BeagleBoard
I've been struggling with clock accuracy for some time. If I don't put pullup resistors on P8-33 and P8-34 (lcd_data14 and lcd_data15) then I get the wrong OMAP clocksource frequency and my system clock runs way too fast for timesync or ntpd to correct it.
Apparently my actual timer speed is 26mHz, but with the two pins floating the system erroneously picks 24mHz:

debian@beaglebone:~$ dmesg | grep -i timer
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000046] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000058] OMAP clocksource: timer1 at 24000000 Hz
[    0.002420] timer_probe: no matching timers found
[    0.629322] clocksource: Switched to clocksource timer1

This is with the latest kernel I can find - 4.14.79-ti-r89 (debian 9.6 2019-01-06). I have the same problem with my original kernel, which is 4.4.21-ti-r47.

It doesn't seem right that I should have to use pullup resistors to get the right clock speed. What could be causing this? My board is plugged into a fairly complex custom cape, but the two pins mentioned above are floating.

If there's a simple software fix, that would be lovely. Creating an overlay with the two pins set to pullup doesn't work. I'm assuming that the overlay is not processed until after the pin states have been read in the boot process.

I have checked out the kernel source for 4.18.20, so I can get into the source and make changes if that's the only way.

pbft

unread,
Jan 16, 2019, 4:25:48 PM1/16/19
to BeagleBoard
Quick update: I've built 4.18.20 from source, and it has the same behavior.

Graham

unread,
Jan 16, 2019, 5:15:24 PM1/16/19
to BeagleBoard
The standard external clock frequency source for the BeagleBone Black is 24 MHz.

Is that what you are referring to?

Are you protecting all the "Boot Pins", so that your "Custom Cape" is not overriding the boot programming resistors on the BBB?

--- Graham

pbft

unread,
Jan 16, 2019, 5:33:06 PM1/16/19
to BeagleBoard
Thanks. I'm not precisely sure of the terminology, but the BeagleBone decides that the 'clocksource' is 24mHz. Its RTC will then gain *exactly* two minutes every 24 minutes if you disable timesyncd. With pullup resistors it will decide that the clocksource is 26mHz and the RTC will be virtually perfect:

debian@arm:~$ dmesg | grep -i timer
[    0.000000] OMAP clockevent source: timer2 at 26000000 Hz
[    0.000029] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 73510017198 ns
[    0.000039] OMAP clocksource: timer1 at 26000000 Hz
[    0.000568] timer_probe: no matching timers found
[    0.463409] clocksource: Switched to clocksource timer1

The custom cape leaves the 'boot pins' floating (unless I add the pullups), and I get the same behavior with the BeagleBone running by itself with no cape.

Graham

unread,
Jan 16, 2019, 6:47:24 PM1/16/19
to Beagle Board
That really does not make a lot of sense.
I have five BBB's and a few Pocket Beagles, and they all free run within 50 ppm of where they are supposed to be at 24.000 MHz.
50 ppm error is about 3.5 seconds per day
You can walk them in closer to 2 ppm(at least at room temperature), by changing C25 and C26 to 24 pF, rather than the factory supplied 18 pF.
NTPD or timesyncd do not have any problem holding time on my Beagles within 20 milliseconds or so

I would look at the lid of Y2, the main 24 MHz crystal with a magnifying glass or microscope.  
The frequency is usually laser engraved in the metal lid.

Where did you get your Beagle?

--- Graham

==


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/iZxmejC9750/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/040ea632-065a-4332-801a-794df698384b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pbft

unread,
Jan 16, 2019, 7:51:05 PM1/16/19
to BeagleBoard


On Wednesday, January 16, 2019 at 6:47:24 PM UTC-5, Graham wrote:
That really does not make a lot of sense.
I have five BBB's and a few Pocket Beagles, and they all free run within 50 ppm of where they are supposed to be at 24.000 MHz.
50 ppm error is about 3.5 seconds per day
You can walk them in closer to 2 ppm(at least at room temperature), by changing C25 and C26 to 24 pF, rather than the factory supplied 18 pF.
NTPD or timesyncd do not have any problem holding time on my Beagles within 20 milliseconds or so

On mine, timesyncd gives up. I get periodic step changes. With the pullups to force 26mHz, it's really accurate even without timesyncd.
 
I would look at the lid of Y2, the main 24 MHz crystal with a magnifying glass or microscope.  
The frequency is usually laser engraved in the metal lid.


I'll try that tomorrow. I know that I have at least a half-dozen with this problem, and maybe many more.
 
Where did you get your Beagle?

I think these came from Newark. All of them are Rev C from mainstream suppliers - not Seeed, for instance.

 
Reply all
Reply to author
Forward
0 new messages