Recently the customer reflected the RTC clock setting of the WINCE7 system we provided, the power off could not be saved, always back to the 2000 year start year,
Our Industrial touch screen using the AM3354 scheme, view the original WINCE7 system source code, open the file:
C:\WINCE700\PLATFORM\AM33X_BSP\SRC\OAL\OALLIB\init.c
Found in the Oeminit function is called TI own RTC driver function Oal3xx_rtcinit, this function in the path is:
C:\WINCE700\PLATFORM\COMMON\src\soc\COMMON_TI_V1\COMMON_TI_AMXX\OAL\OALRTC
In the: OALRTC.C file is defined, debugging found that the file Rtc_gettime function read out the value of the register is always 0, viewing the online data also has
A lot of people reflect TI's AM3354 RTC Clock has problems, then further check the hardware, backup button battery normal 3.0v,32.768 crystal oscillator
No direct access to the AM3354, but access to the BQ32000 this RTC chip, BQ32000 in an i²c way with AM3354 connection, from
Address for 0x68, so can only write their own BQ32000 WINCE7 driver,
1. Create directories and makefile, first in the directory:
C:\WINCE700\PLATFORM\COMMON\src\soc\COMMON_TI_V1\COMMON_TI_AMXX\OAL
folder under Create:BQ32K_OALRTC
Copy directory:
C:\WINCE700\PLATFORM\COMMON\src\soc\COMMON_TI_V1\COMMON_TI_AMXX\OAL\OALRTC
makefile to BQ32K_OALRTC in
2. Write the sources file and create and write the sources file under the BQ32K_OALRTC directory as follows:
! INCLUDE ". \.. \sources.inc "
TARGETNAME=AM33X_BQ32KRTC
Targettype=library
sources= OALRTC.C
3. Write the source file, write the oalrtc.c file in the BQ32K_OALRTC directory, complete the driver development
the file needs to implement the function: Oalbq32krtcinit
4. Modify the file:
C:\WINCE700\PLATFORM\COMMON\src\soc\COMMON_TI_V1\COMMON_TI_AMXX\OAL\dirs
Add directory BQ32K_OALRTC, the content is as follows;
dirs=\
Cpuidle\
Oali2c\
Timer\
Oalrtc\
Bq32k_oalrtc\
5. Create the header file in the directory:
C:\WINCE700\PLATFORM\COMMON\src\soc\COMMON_TI_V1\COMMON_TI_AMXX\INC
under Create header file:
bq32k_rtc.h
export function: Oalbq32krtcinit
6. Modify the above init.c file and comment out the statement:
Oal3xx_rtcinit (AM33X_RTCSS_REGS_PA, irq_rtcalarm);
New statement:
oalbq32krtcinit (...); /(content skipped)
7. Edit the file:
C:\WINCE700\PLATFORM\AM33X_BSP\SRC\OAL\OALEXE\sources
Comment out the following statement:
# $ (_platcommonlib) \$ (_cpuindpath) \am3xx_oalrtc.lib \
Add the following statement on the next line:
$ (_platcommonlib) \$ (_cpuindpath) \am33x_bq32krtc.lib \
Once the modifications are complete, open the VS2008 SLN project and recompile the solution.
There is a need for this part of the source of friends can + I QQ2362317758
Development of RTC Clock chip bq32k in WINCE7