[U-Boot-Users] errors in using DS1337

Ben Warren biggerbadderben at gmail.com
Wed Jan 30 15:23:00 CET 2008


Hi lxg,

xiangguo_li at hotmail.com wrote:
> hello,
>
> when I choose to use DS1337, I add definitions in header file:
>
> #define CONFIG_RTC_DS1337
> #define CFG_I2C_RTC_ADDR    0x68
> but, during making process, error appears:
>
> rtc/librtc.a(ds1337.o): in function 'rtc_read':
> .../rtc/ds1337.c: 172: undefined reference to 'i2c_reg_read'
> rtc/librtc.a(ds1337.o): in function 'rtc_write':
> .../rtc/ds1337.c: 178: undefined reference tp 'i2c_reg_write'
>
> how to solve this error?
>
It would help to know what platform you're building for.  The functions 
mentioned are prototyped in 'i2c.h', but don't appear in all  I2C 
drivers (I'm thinking of the ARM ones that are in drivers/i2c).  If 
you're using a controller that has these functions implemented, you 
probably don't have your I2C controller properly set up.

Since these functions are always 1-or-2 liner wrappers around 
i2c_read()/i2c_write() and always do the same thing, it would probably 
be helpful to implement them as static inlines in include/i2c.h.  I'll 
post a patch to do this some time soon.

regards,
Ben




More information about the U-Boot mailing list