System version: Ubuntu18.04-64
Compiler version: gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)
uboot version: 2018.07-linux4sam_6.0
Board model: at91sama5d3x-xplained
MCU model: sama5d36
RTC model: RX8025T
[Datasheet] RX8025T clock chip interpretation
There are some differences between RX8025T and RX8025SA, mainly in the shift of the time register;
It is a design of Epson, EPSON. This information is very helpful for the kernel to find the corresponding driver.
1. Start the board to view the kernel startup information
The system clock rtc, as can be seen from the printed information, uses the rtc register inside the cpu, rather than the external RX8025 chip, as rtc0 for the system to read and call;
qt1070 1-001b: ID 206 not supported
at91_rtc fffffeb0.rtc: registered as rtc0
at91_rtc fffffeb0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
The system calls /dev/rtc0, which is a soft link, is equivalent to calling the rtc register inside at91, which is not what we want.
2. If you don't know which file is the function that calls the internal rtc, there is a very simple method. Go to the rtc folder and see which file is compiled into a .o file.
cd drivers/rtc
ls *.o
The file linux-at91-linux-4.19-at91driversrtcrtc-at91rm9200.c has a corresponding .o;
Open the Makefile
It can be seen that the compilation is selected through the macro CONFIG_RTC_DRV_AT91RM9200;
3. Make this macro ineffective, modify the default configuration file, and perform cropping
arch/arm/configs/sama5_defconfig
CONFIG_RTC_DRV_AT91RM9200=y
to:
# CONFIG_RTC_DRV_AT91RM9200 is not set
4. Enter the graphical configuration interface and select EPSON's 8025 chip selection
make menuconfig
Device Drivers —>
[*] Real Time Clock --->
You can see that the routines given on the official website are for Epson RX-8025SA/NB. If the chip you are using happens to be RX-8025SA, you can use it directly. The chip of RX-8025T needs to be modified, otherwise the time will always be wrong. You will find that it will be messed up after a few hours after calibration.
Save and exit, compile directly, and the 8025 driver will be debugged.
The driver file is in drivers/rtc/rtc-8025.c.
Test it by calling the function in the file system
Read time hwclock -r
Set time hwclock -w
You can also add some print information in the driver to view the corresponding register data.
The difference between the two chips lies mainly in the read data of the register;
The following modifications have been made to the register read operation:
Previous article:[Linux driver] Module loading RTX8025 driver
Next article:[linux kernel] Control IO port timing output during kernel startup
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Please help me find out what type of SOT23 device with silk screen "UB17" and "WB14" is
- I would like to ask if there is any interference noise when measuring the ground line with an oscilloscope
- The microcontroller sends a string to the host
- VirtualBox-5.2.12 Environment Guide
- Working principle and function of encoder
- Help
- MATLAB Design Butterworth Bandpass Filter Parameter Setting
- Op amp circuit PCB design tips
- The benefits of eating noodles for engineers
- 【GD32L233C-START Review】6. Get RTC time and display it through OLED