User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mission:log:2015:02:06:patching-kernel-ntp-to-fix-odroid-armv7a-chrony-adjtimex-bug [2015/02/07 17:50]
chrono [Fixing the kernel]
mission:log:2015:02:06:patching-kernel-ntp-to-fix-odroid-armv7a-chrony-adjtimex-bug [2015/02/08 09:17] (current)
chrono [Fixing the kernel]
Line 32: Line 32:
         }         }
 </sxh> </sxh>
-After patching the odroid sources with the recommended one from the bugtracker chronyd is working like a charm again. So if you're having issues with newer kernels (at least from an embedded perspective), that use dynamic or idle tick-less clocks, you might want to patch your kernel as well.+ 
 +After patching the odroid sources with the recommended one from the bugtracker chronyd is working like a charm again
 + 
 +**Update** 
 + 
 +After linking the issue on github, kukabu delivered the link to the  [[https://bugzilla.kernel.org/attachment.cgi?id=165631&action=diff|upstream kernel bug]]: 
 + 
 +<sxh c; toolbar:false; highlight: [7,8,10,11];
 +--- a/kernel/time/ntp.c 
 ++++ b/kernel/time/ntp.c 
 +@@ -634,9 +634,9 @@ int ntp_validate_timex(struct timex *txc) 
 +                return -EPERM; 
 +  
 +        if (txc->modes & ADJ_FREQUENCY) { 
 +-               if (LONG_MIN / PPM_SCALE > txc->freq) 
 ++               if (LLONG_MIN / PPM_SCALE > txc->freq) 
 +                        return -EINVAL; 
 +-               if (LONG_MAX / PPM_SCALE < txc->freq) 
 ++               if (LLONG_MAX / PPM_SCALE < txc->freq) 
 +                        return -EINVAL; 
 +        } 
 +</sxh> 
 + 
 +This patch was tested and is solving chrony's sync problems as well. So if you're experiencing NTP issues with newer kernels (at least from an embedded perspective), that use dynamic or idle tick-less clocks, you might want to check/patch your kernel with this one.
  
 ===== Hacking a new RTC power supply with a goldcap capacitor ===== ===== Hacking a new RTC power supply with a goldcap capacitor =====
  
-The Odroid C1 also comes with another not so obvious pitfall: The RTC power supply. The optional RTC battery, you can usually buy wherever you can buy the Odroid itself, is the only power supply for the RTC. Meaning: When you don't have this battery, the RTC will not get powered at all (not even when your system is powered and running) so in order to get the RTC working, you need to feed power to the RTC Header. +The Odroid C1 also came with another not so obvious pitfall: The RTC power supply. The optional RTC battery, you can usually buy wherever you can buy the Odroid itself, is the only power supply for the RTC. Meaning: When you don't have this battery, the RTC will not get powered at all (not even when your system is powered and running) so in order to get the RTC working at all, you need to feed power to the RTC Header. A quick glance into the schematics quickly revealed the secret:  
 + 
 +U15 (XC6215B0927R-G) is a highly precise, low noise, positive voltage LDO regulator and it supplies the power to the VDD_RTC rail. And it's **only** connected to the RTC Battery PIN Header. So what to do now, when no battery is available? Just a quick hack to solve it:
  
-A quick glance in the schematics revealed the secret: U15 (XC6215B0927R-G) is a highly precise, low noise, positive voltage LDO regulator, to feed the RTC the voltage it needs. Since using a battery seemed kinda backwards and there was a 5.5V 1F goldcap fyling around here, [[http://www.mikrocontroller.net/attachment/9903/RTC.GIF|this hack]] (second from the left minus the resistor) was used to supply 3.3V from Pin 1 of the Odroid C1 40 pin header through a 0.4V drop schottky diode (to get to about 2.9V which emulates a CR2032 Battery closely enough) and then fed to the goldcap to charge it and supply the RTC power header of the Odroid C1 board while running. GND is the pin towards the UART where it says RTC on the silkscreen, connected to (-) of the goldcap and also to GND of the 40 pin header. The PIN closer to the IR Receiver is connected to the goldcaps (+).+Since using a battery seemed kinda backwards and there was a 5.5V 1F goldcap flying around here, [[http://www.mikrocontroller.net/attachment/9903/RTC.GIF|this hack]] (second from the left minus the resistor) was used to supply 3.3V from Pin 1 of the Odroid C1 40 pin header through a 0.4V drop schottky diode (to get to about 2.9V which emulates a CR2032 Battery closely enough) and then fed to the goldcap to charge it and supply the RTC power header of the Odroid C1 board while running. GND is the pin towards the UART where it says RTC on the silkscreen, connected to (-) of the goldcap and also to GND of the 40 pin header. The VDD_RTC PIN is the one closer to the IR Receiver and is directly connected to the goldcap'(+).
  
 {{tag>picofab picoprint software chrony kernel bug patch}} {{tag>picofab picoprint software chrony kernel bug patch}}