This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/BEAGLEBK: External RTC overwritten on power-up

Part Number: BEAGLEBK

Tool/software: Linux

Hi Pavel,

beaglebone black with TI linux 4.9.41 RT.

An external MCP79410 connected as rtc1 on  our development board overwritten on power up. I have tried 3 BBB and 3 development boards with SD cards and problem same.

root@am335x-evm:~# dmesg | grep rtc

[    1.462824] hctosys: unable to open rtc device (rtc0)

[    6.091636] rtc rtc0: 44e3e000.rtc: dev (253:0)

[    6.091681] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0

[    6.776695] Modules linked in: rtc_ds1307(+) edt_ft5x06(+) spidev(+) rtc_omap musb_am335x ti_am335x_tscadc omap_wdt sch_fq_codel uio_module_drv(O) uio cryptodev(O)

[    6.937900] rtc-ds1307 2-006f: read: b5 08 16 2c 07 03 18

[    6.937913] rtc-ds1307 2-006f: read secs=35, mins=8, hours=16, mday=7, mon=2, year=118, wday=3      ## CURRENT DATE AND TIME##

[    6.938273] rtc-ds1307 2-006f: read: b5 08 16 2c 07 03 18

[    6.938283] rtc-ds1307 2-006f: read secs=35, mins=8, hours=16, mday=7, mon=2, year=118, wday=3

[    6.938571] rtc rtc1: mcp7941x: dev (253:1)

[    6.938580] rtc-ds1307 2-006f: rtc core: registered mcp7941x as rtc1

[    6.938600] rtc-ds1307 2-006f: 64 bytes nvram

[   10.482313] PM: bootloader does not support rtc-only!

[   10.482622] Modules linked in: pm33xx wkup_m3_ipc wkup_m3_rproc remoteproc pvrsrvkm(O) omap_aes_driver omap_sham pruss_soc_bus crypto_engine ti_emif_sram rtc_ds1307 edt_ft5x06 spidev(+) rtc_omap musb_am335x ti_am335x_tscadc omap_wdt sch_fq_codel uio_module_drv(O) uio cryptodev(O)

[   19.094109] rtc-ds1307 2-006f: write secs=41, mins=6, hours=15, mday=5, mon=2, year=118, wday=1    ## OLD DATE PUT BACK IN##

[   19.094130] rtc-ds1307 2-006f: write: c1 06 15 0a 05 03 18

[   19.095405] rtc-ds1307 2-006f: read: c1 06 15 2a 05 03 18

[   19.095421] rtc-ds1307 2-006f: read secs=41, mins=6, hours=15, mday=5, mon=2, year=118, wday=1

No need to unplug power. To replicate, powerdown button held down for 8 seconds. Then powerdown button pressed again booting to SD card. The date written back is the date the SD card was created.

The rtc is battery backed as microchip datasheet. I can check the rtc using i2cget and i2cset commands and verify crystal is running.

The full dmesg attached.

Look forward to hear from you.

best regards

Naseer

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.41-rt23-gc038d21a22 (multisensor@ubuntu) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #5 PREEMPT RT Mon Nov 13 14:25:32 GMT 2017
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: TI AM335x BeagleBone Black
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 48 MiB at 0x9d000000
[    0.000000] Memory policy: Data cache writeback
[    0.000000] On node 0 totalpages: 131072
[    0.000000] free_area_init_node: node 0, pgdat c0c47768, node_mem_map dcb61000
[    0.000000]   Normal zone: 1152 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 131072 pages, LIFO batch:31
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.0 (sgx neon)
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttyO0,115200n8 consoleblank=0 root=PARTUUID=4ebfbacb-02 rw rootfstype=ext4 rootwait
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 457916K/524288K available (7168K kernel code, 291K rwdata, 2344K rodata, 1024K init, 324K bss, 17220K reserved, 49152K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
                   lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
                   pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
                   modules : 0xbf000000 - 0xbfe00000   (  14 MB)
                     .text : 0xc0008000 - 0xc0800000   (8160 kB)
                     .init : 0xc0b00000 - 0xc0c00000   (1024 kB)
                     .data : 0xc0c00000 - 0xc0c48ee0   ( 292 kB)
                      .bss : 0xc0c48ee0 - 0xc0c99f60   ( 325 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  RCU kthread priority: 1.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000015] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000026] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000032] OMAP clocksource: timer1 at 24000000 Hz
[    0.000175] clocksource_probe: no matching clocksources found
[    0.000329] Console: colour dummy device 80x30
[    0.000452] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    0.000454] This ensures that you still see kernel messages. Please
[    0.000455] update your kernel commandline.
[    0.089246] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
[    0.089251] pid_max: default: 32768 minimum: 301
[    0.089374] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.089379] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090172] CPU: Testing write buffer coherency: ok
[    0.090484] Setting up static identity map for 0x80100000 - 0x80100060
[    0.091547] EFI services will not be available.
[    0.092715] devtmpfs: initialized
[    0.103538] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.103863] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.103892] futex hash table entries: 256 (order: 1, 8192 bytes)
[    0.107210] pinctrl core: initialized pinctrl subsystem
[    0.108384] NET: Registered protocol family 16
[    0.110411] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.123436] omap_hwmod: debugss: _wait_target_disable failed
[    0.180097] gpio gpiochip0: (gpio): added GPIO chardev (254:0)
[    0.180432] gpiochip_setup_dev: registered GPIOs 0 to 31 on device: gpiochip0 (gpio)
[    0.181938] OMAP GPIO hardware version 0.1
[    0.182643] gpio gpiochip1: (gpio): added GPIO chardev (254:1)
[    0.182967] gpiochip_setup_dev: registered GPIOs 32 to 63 on device: gpiochip1 (gpio)
[    0.184883] gpio gpiochip2: (gpio): added GPIO chardev (254:2)
[    0.185179] gpiochip_setup_dev: registered GPIOs 64 to 95 on device: gpiochip2 (gpio)
[    0.187182] gpio gpiochip3: (gpio): added GPIO chardev (254:3)
[    0.187498] gpiochip_setup_dev: registered GPIOs 96 to 127 on device: gpiochip3 (gpio)
[    0.197039] No ATAGs?
[    0.197065] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.211432] edma 49000000.edma: TI EDMA DMA engine driver
[    0.211774] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulator0[0]'
[    0.214421] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[    0.214478] omap_i2c 4802a000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c1_pins, deferring probe
[    0.214514] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring probe
[    0.214627] media: Linux media interface: v0.10
[    0.214679] Linux video capture interface: v2.00
[    0.214718] pps_core: LinuxPPS API ver. 1 registered
[    0.214724] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.214746] PTP clock support registered
[    0.214781] EDAC MC: Ver: 3.0.0
[    0.215849] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[    0.216169] Advanced Linux Sound Architecture Driver Initialized.
[    0.217363] clocksource: Switched to clocksource timer1
[    0.226931] NET: Registered protocol family 2
[    0.227759] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.227819] TCP bind hash table entries: 4096 (order: 4, 98304 bytes)
[    0.227974] TCP: Hash tables configured (established 4096 bind 4096)
[    0.228041] UDP hash table entries: 256 (order: 2, 16384 bytes)
[    0.228071] UDP-Lite hash table entries: 256 (order: 2, 16384 bytes)
[    0.228240] NET: Registered protocol family 1
[    0.228694] RPC: Registered named UNIX socket transport module.
[    0.228707] RPC: Registered udp transport module.
[    0.228713] RPC: Registered tcp transport module.
[    0.228718] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.228733] PCI: CLS 0 bytes, default 64
[    0.229583] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    0.231719] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.238712] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.239608] NFS: Registering the id_resolver key type
[    0.239649] Key type id_resolver registered
[    0.239656] Key type id_legacy registered
[    0.239698] ntfs: driver 2.1.32 [Flags: R/O].
[    0.241427] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    0.241446] io scheduler noop registered
[    0.241452] io scheduler deadline registered
[    0.241596] io scheduler cfq registered (default)
[    0.242820] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[    0.302417] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
[    0.305596] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250
[    0.905269] console [ttyS0] enabled
[    0.910663] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
[    0.917529] [drm] Initialized
[    0.921460] panel panel: GPIO lookup for consumer enable
[    0.921468] panel panel: using device tree for GPIO lookup
[    0.921479] of_get_named_gpiod_flags: can't parse 'enable-gpios' property of node '/panel[0]'
[    0.921485] of_get_named_gpiod_flags: can't parse 'enable-gpio' property of node '/panel[0]'
[    0.921490] panel panel: using lookup tables for GPIO lookup
[    0.921497] panel panel: lookup for GPIO enable failed
[    0.922414] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    0.929071] [drm] No driver support for vblank timestamp query.
[    0.961919] Console: switching to colour frame buffer device 100x30
[    0.973047] tilcdc 4830e000.lcdc: fb0:  frame buffer device
[    0.991755] brd: module loaded
[    1.001138] loop: module loaded
[    1.008253] libphy: Fixed MDIO Bus: probed
[    1.087403] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[    1.093541] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[    1.100606] libphy: 4a101000.mdio: probed
[    1.104652] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[    1.114538] cpsw 4a100000.ethernet: Detected MACID = 90:59:af:5c:cc:b1
[    1.121287] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
[    1.129846] PPP generic driver version 2.4.2
[    1.134714] mousedev: PS/2 mouse device common for all mice
[    1.140727] i2c /dev entries driver
[    1.145772] omap_hsmmc 48060000.mmc: GPIO lookup for consumer cd
[    1.145781] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
[    1.145808] of_get_named_gpiod_flags: parsed 'cd-gpios' property of node '/ocp/mmc@48060000[0]' - status (0)
[    1.145883] omap_hsmmc 48060000.mmc: Got CD GPIO
[    1.150617] omap_hsmmc 48060000.mmc: GPIO lookup for consumer wp
[    1.150623] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
[    1.150632] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@48060000[0]'
[    1.150638] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@48060000[0]'
[    1.150643] omap_hsmmc 48060000.mmc: using lookup tables for GPIO lookup
[    1.150651] omap_hsmmc 48060000.mmc: lookup for GPIO wp failed
[    1.207974] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer cd
[    1.207986] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
[    1.207995] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@481d8000[0]'
[    1.208000] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/ocp/mmc@481d8000[0]'
[    1.208006] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
[    1.208013] omap_hsmmc 481d8000.mmc: lookup for GPIO cd failed
[    1.208021] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer wp
[    1.208025] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
[    1.208030] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@481d8000[0]'
[    1.208035] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@481d8000[0]'
[    1.208040] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
[    1.208044] omap_hsmmc 481d8000.mmc: lookup for GPIO wp failed
[    1.267937] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led2[0]' - status (0)
[    1.268153] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led3[0]' - status (0)
[    1.268283] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led4[0]' - status (0)
[    1.268384] of_get_named_gpiod_flags: parsed 'gpios' property of node '/leds/led5[0]' - status (0)
[    1.274238] NET: Registered protocol family 10
[    1.280429] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    1.290172] NET: Registered protocol family 17
[    1.294908] Key type dns_resolver registered
[    1.299459] omap_voltage_late_init: Voltage driver support not added
[    1.316791] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.327827] mmc0: new high speed SDHC card at address aaaa
[    1.332691] mmc1: new high speed MMC card at address 0001
[    1.337797] mmcblk1: mmc1:0001 MMC02G 1.79 GiB
[    1.339057] mmcblk1boot0: mmc1:0001 MMC02G partition 1 1.00 MiB
[    1.345276] mmcblk1boot1: mmc1:0001 MMC02G partition 2 1.00 MiB
[    1.346271] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[    1.346740] random: fast init done
[    1.346948] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    1.346987] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    1.347340]  mmcblk1: p1 p2
[    1.358146] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 400 kHz
[    1.394080] mmcblk0: mmc0:aaaa SU04G 3.69 GiB
[    1.400367]  mmcblk0: p1 p2
[    1.449377] at24 2-0057: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    1.456598] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 400 kHz
[    1.462809] hctosys: unable to open rtc device (rtc0)
[    1.468380] ALSA device list:
[    1.471369]   No soundcards found.
[    1.576237] EXT4-fs (mmcblk0p2): recovery complete
[    1.582640] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.590842] VFS: Mounted root (ext4 filesystem) on device 179:50.
[    1.600475] devtmpfs: mounted
[    1.604991] Freeing unused kernel memory: 1024K (c0b00000 - c0c00000)
[    1.857680] systemd[1]: System time before build time, advancing clock.
[    1.933673] systemd[1]: systemd 230 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN)
[    1.952384] systemd[1]: Detected architecture arm.
[    1.988739] systemd[1]: Set hostname to <am335x-evm>.
[    2.265552] systemd[1]: [/lib/systemd/system/gadget-init.service:15] Unknown lvalue 'ExecStopPre' in section 'Service'
[    2.525441] systemd[1]: sysinit.target: Found ordering cycle on sysinit.target/start
[    2.533357] systemd[1]: sysinit.target: Found dependency on alignment.service/start
[    2.541091] systemd[1]: sysinit.target: Found dependency on basic.target/start
[    2.548365] systemd[1]: sysinit.target: Found dependency on sysinit.target/start
[    2.555806] systemd[1]: sysinit.target: Breaking ordering cycle by deleting job alignment.service/start
[    2.565259] systemd[1]: alignment.service: Job alignment.service/start deleted to break ordering cycle starting with sysinit.target/start
[    3.293816] cryptodev: loading out-of-tree module taints kernel.
[    3.308292] cryptodev: driver 1.8 loaded.
[    3.368391] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    4.108409] systemd-journald[123]: Received request to flush runtime journal from PID 1
[    5.919945] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[    6.077834] rtc rtc0: 44e3e000.rtc: dev (253:0)
[    6.077872] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
[    6.504335] edt_ft5x06 2-0038: GPIO lookup for consumer reset
[    6.504352] edt_ft5x06 2-0038: using device tree for GPIO lookup
[    6.504379] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/ocp/i2c@4819c000/edt-ft5x06@38[0]' - status (0)
[    6.504399] edt_ft5x06 2-0038: GPIO lookup for consumer wake
[    6.504404] edt_ft5x06 2-0038: using device tree for GPIO lookup
[    6.504410] of_get_named_gpiod_flags: can't parse 'wake-gpios' property of node '/ocp/i2c@4819c000/edt-ft5x06@38[0]'
[    6.504416] of_get_named_gpiod_flags: can't parse 'wake-gpio' property of node '/ocp/i2c@4819c000/edt-ft5x06@38[0]'
[    6.504420] edt_ft5x06 2-0038: using lookup tables for GPIO lookup
[    6.504427] edt_ft5x06 2-0038: lookup for GPIO wake failed
[    6.603651] spidev spi1.0: buggy DT: spidev listed directly in DT
[    6.640172] ------------[ cut here ]------------
[    6.712091] WARNING: CPU: 0 PID: 164 at drivers/spi/spidev.c:757 spidev_probe+0x1e4/0x204 [spidev]
[    6.791956] Modules linked in: spidev(+) rtc_ds1307(+) edt_ft5x06(+) rtc_omap musb_am335x omap_wdt ti_am335x_tscadc sch_fq_codel uio_module_drv(O) uio cryptodev(O)
[    6.841959] input: EP0790M09 as /devices/platform/ocp/4819c000.i2c/i2c-2/2-0038/input/input0
[    6.845038] rtc-ds1307 2-006f: read: 94 28 16 2c 07 03 18
[    6.845053] rtc-ds1307 2-006f: read secs=14, mins=28, hours=16, mday=7, mon=2, year=118, wday=3
[    6.845414] rtc-ds1307 2-006f: read: 94 28 16 2c 07 03 18
[    6.845423] rtc-ds1307 2-006f: read secs=14, mins=28, hours=16, mday=7, mon=2, year=118, wday=3
[    6.845746] rtc rtc1: mcp7941x: dev (253:1)
[    6.845755] rtc-ds1307 2-006f: rtc core: registered mcp7941x as rtc1
[    6.845775] rtc-ds1307 2-006f: 64 bytes nvram
[    7.073033] CPU: 0 PID: 164 Comm: systemd-udevd Tainted: G           O    4.9.41-rt23-gc038d21a22 #5
[    7.216967] Hardware name: Generic AM33XX (Flattened Device Tree)
[    7.285679] Backtrace:
[    7.317919] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
[    7.373209] [<c010b6fc>] (dump_backtrace) from [<c010b9b8>] (show_stack+0x18/0x1c)
[    7.396364] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
[    7.405561] omap-aes 53500000.aes: will run requests pump with realtime priority
[    7.639704]  r7:00000009 r6:00000000 r5:bf047428 r4:00000000
[    7.645440] [<c010b9a0>] (show_stack) from [<c03ae174>] (dump_stack+0x24/0x28)
[    7.659249] [drm] Initialized pvr 1.14.3699939 20110701 on minor 1
[    7.822279] remoteproc remoteproc0: wkup_m3 is available
[    7.881655] [<c03ae150>] (dump_stack) from [<c012adb4>] (__warn+0xe8/0x100)
[    7.968868] [<c012accc>] (__warn) from [<c012ae84>] (warn_slowpath_null+0x28/0x30)
[    8.013166]  r9:0000000f r8:bf04747c r7:00000000 r6:dc546400 r5:bf04746c r4:dc546400
[    8.130815] [<c012ae5c>] (warn_slowpath_null) from [<bf04632c>] (spidev_probe+0x1e4/0x204 [spidev])
[    8.213771] remoteproc remoteproc0: powering up wkup_m3
[    8.216827] PM: Cannot get wkup_m3_ipc handle
[    8.231318] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 224352
[    8.231597] remoteproc remoteproc0: remote processor wkup_m3 is now up
[    8.231666] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192
[    8.587972] [<bf046148>] (spidev_probe [spidev]) from [<c055bfa0>] (spi_drv_probe+0x84/0xb4)
[    8.632692]  r8:bf04747c r7:00000000 r6:00000000 r5:bf04746c r4:dc546400
[    8.738614] [<c055bf1c>] (spi_drv_probe) from [<c05018d0>] (driver_probe_device+0x20c/0x2d4)
[    8.862852]  r7:00000000 r6:c0c863b0 r5:c0c863a0 r4:dc546400
[    8.893718] [<c05016c4>] (driver_probe_device) from [<c0501a58>] (__driver_attach+0xc0/0xc4)
[    8.953343]  r10:00000000 r9:e0b87000 r8:db07d780 r7:00000000 r6:dc546434 r5:bf04747c
[    9.052990]  r4:dc546400 r3:00000000
[    9.080113] [<c0501998>] (__driver_attach) from [<c04ffbc0>] (bus_for_each_dev+0x70/0xa4)
[    9.189984]  r7:00000000 r6:c0501998 r5:bf04747c r4:00000000
[    9.226069] [<c04ffb50>] (bus_for_each_dev) from [<c050129c>] (driver_attach+0x24/0x28)
[    9.247605] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    9.428509]  r6:c0c35f44 r5:db111b00 r4:bf04747c
[    9.433187] [<c0501278>] (driver_attach) from [<c0500ddc>] (bus_add_driver+0x110/0x21c)
[    9.525738] [<c0500ccc>] (bus_add_driver) from [<c0502158>] (driver_register+0x80/0xfc)
[    9.591540]  r7:db07d840 r6:00000000 r5:bf047460 r4:bf04747c
[    9.675846] [<c05020d8>] (driver_register) from [<c055bedc>] (__spi_register_driver+0x60/0x64)
[    9.753270]  r5:bf047460 r4:bf047680
[    9.805954] [<c055be7c>] (__spi_register_driver) from [<bf049098>] (spidev_init+0x98/0xcc [spidev])
[    9.815624] [<bf049000>] (spidev_init [spidev]) from [<c010172c>] (do_one_initcall+0x4c/0x178)
[    9.994812]  r6:bf0474c0 r5:ffffe000 r4:bf049000
[   10.021639] [<c01016e0>] (do_one_initcall) from [<c01b677c>] (do_init_module+0x68/0x3b4)
[   10.097006]  r10:db07d7a4 r9:e0b87000 r8:db07d780 r7:db07d840 r6:bf0474c0 r5:00000001
[   10.125105]  r4:bf0474c0
[   10.190347] [<c01b6714>] (do_init_module) from [<c0192c00>] (load_module+0x1e0c/0x21a0)
[   10.264852]  r7:00000001 r6:bf0474c0 r5:00000001 r4:db01df44
[   10.291772] [<c0190df4>] (load_module) from [<c01931b4>] (SyS_finit_module+0xb0/0xc0)
[   10.403669]  r10:00000000 r9:db01c000 r8:c0107dc4 r7:0000017b r6:b6e80f60 r5:00000007
[   10.493159]  r4:00000000
[   10.522517] FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[   10.660388] [<c0193104>] (SyS_finit_module) from [<c0107c00>] (ret_fast_syscall+0x0/0x44)
[   10.760018]  r6:00000000 r5:00000000 r4:0047c4b8
[   10.764668] ---[ end trace 0000000000000002 ]---
[   10.896324] PM: bootloader does not support rtc-only!
[   10.903586] spidev spi1.1: buggy DT: spidev listed directly in DT
[   10.951364] ------------[ cut here ]------------
[   10.956054] WARNING: CPU: 0 PID: 164 at drivers/spi/spidev.c:757 spidev_probe+0x1e4/0x204 [spidev]
[   11.036892] Modules linked in:
[   11.040878] EXT4-fs (mmcblk1p2): warning: mounting fs with errors, running e2fsck is recommended
[   11.044013] EXT4-fs (mmcblk1p2): recovery complete
[   11.045524] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
[   11.346527]  pm33xx wkup_m3_ipc wkup_m3_rproc remoteproc pvrsrvkm(O) omap_aes_driver crypto_engine omap_sham ti_emif_sram pruss_soc_bus spidev(+) rtc_ds1307 edt_ft5x06 rtc_omap musb_am335x omap_wdt ti_am335x_tscadc sch_fq_codel uio_module_drv(O) uio cryptodev(O)
[   11.561532] CPU: 0 PID: 164 Comm: systemd-udevd Tainted: G        W  O    4.9.41-rt23-gc038d21a22 #5
[   11.625048] Hardware name: Generic AM33XX (Flattened Device Tree)
[   11.697517] Backtrace:
[   11.700051] [<c010b6fc>] (dump_backtrace) from [<c010b9b8>] (show_stack+0x18/0x1c)
[   11.776085]  r7:00000009 r6:00000000 r5:bf047428 r4:00000000
[   11.810162] [<c010b9a0>] (show_stack) from [<c03ae174>] (dump_stack+0x24/0x28)
[   11.904848] [<c03ae150>] (dump_stack) from [<c012adb4>] (__warn+0xe8/0x100)
[   11.953625] [<c012accc>] (__warn) from [<c012ae84>] (warn_slowpath_null+0x28/0x30)
[   12.023008]  r9:0000001a r8:bf04747c r7:00000000 r6:dc546800 r5:bf04746c r4:dc546800
[   12.104013] [<c012ae5c>] (warn_slowpath_null) from [<bf04632c>] (spidev_probe+0x1e4/0x204 [spidev])
[   12.198327] [<bf046148>] (spidev_probe [spidev]) from [<c055bfa0>] (spi_drv_probe+0x84/0xb4)
[   12.314860]  r8:bf04747c r7:00000000 r6:00000000 r5:bf04746c r4:dc546800
[   12.314900] [<c055bf1c>] (spi_drv_probe) from [<c05018d0>] (driver_probe_device+0x20c/0x2d4)
[   12.314905]  r7:00000000 r6:c0c863b0 r5:c0c863a0 r4:dc546800
[   12.314916] [<c05016c4>] (driver_probe_device) from [<c0501a58>] (__driver_attach+0xc0/0xc4)
[   12.314924]  r10:00000000 r9:e0b87000 r8:db07d780 r7:00000000 r6:dc546834 r5:bf04747c
[   12.314927]  r4:dc546800 r3:00000000
[   12.314936] [<c0501998>] (__driver_attach) from [<c04ffbc0>] (bus_for_each_dev+0x70/0xa4)
[   12.314941]  r7:00000000 r6:c0501998 r5:bf04747c r4:00000000
[   12.314950] [<c04ffb50>] (bus_for_each_dev) from [<c050129c>] (driver_attach+0x24/0x28)
[   12.314954]  r6:c0c35f44 r5:db111b00 r4:bf04747c
[   12.314962] [<c0501278>] (driver_attach) from [<c0500ddc>] (bus_add_driver+0x110/0x21c)
[   12.314972] [<c0500ccc>] (bus_add_driver) from [<c0502158>] (driver_register+0x80/0xfc)
[   12.314978]  r7:db07d840 r6:00000000 r5:bf047460 r4:bf04747c
[   12.314985] [<c05020d8>] (driver_register) from [<c055bedc>] (__spi_register_driver+0x60/0x64)
[   12.314989]  r5:bf047460 r4:bf047680
[   12.315017] [<c055be7c>] (__spi_register_driver) from [<bf049098>] (spidev_init+0x98/0xcc [spidev])
[   12.315033] [<bf049000>] (spidev_init [spidev]) from [<c010172c>] (do_one_initcall+0x4c/0x178)
[   12.315037]  r6:bf0474c0 r5:ffffe000 r4:bf049000
[   12.315054] [<c01016e0>] (do_one_initcall) from [<c01b677c>] (do_init_module+0x68/0x3b4)
[   12.315062]  r10:db07d7a4 r9:e0b87000 r8:db07d780 r7:db07d840 r6:bf0474c0 r5:00000001
[   12.315064]  r4:bf0474c0
[   12.315077] [<c01b6714>] (do_init_module) from [<c0192c00>] (load_module+0x1e0c/0x21a0)
[   12.315083]  r7:00000001 r6:bf0474c0 r5:00000001 r4:db01df44
[   12.315091] [<c0190df4>] (load_module) from [<c01931b4>] (SyS_finit_module+0xb0/0xc0)
[   12.315098]  r10:00000000 r9:db01c000 r8:c0107dc4 r7:0000017b r6:b6e80f60 r5:00000007
[   12.315101]  r4:00000000
[   12.315114] [<c0193104>] (SyS_finit_module) from [<c0107c00>] (ret_fast_syscall+0x0/0x44)
[   12.315118]  r6:00000000 r5:00000000 r4:0047c4b8
[   12.315124] ---[ end trace 0000000000000003 ]---
[   14.075094] am335x-phy-driver 47401300.usb-phy: GPIO lookup for consumer reset
[   14.075112] am335x-phy-driver 47401300.usb-phy: using device tree for GPIO lookup
[   14.075126] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
[   14.075133] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
[   14.075138] am335x-phy-driver 47401300.usb-phy: using lookup tables for GPIO lookup
[   14.075146] am335x-phy-driver 47401300.usb-phy: lookup for GPIO reset failed
[   14.075154] am335x-phy-driver 47401300.usb-phy: GPIO lookup for consumer vbus-detect
[   14.075158] am335x-phy-driver 47401300.usb-phy: using device tree for GPIO lookup
[   14.075164] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpios' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
[   14.075169] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpio' property of node '/ocp/usb@47400000/usb-phy@47401300[0]'
[   14.075174] am335x-phy-driver 47401300.usb-phy: using lookup tables for GPIO lookup
[   14.075179] am335x-phy-driver 47401300.usb-phy: lookup for GPIO vbus-detect failed
[   14.075240] 47401300.usb-phy supply vcc not found, using dummy regulator
[   14.105240] usbcore: registered new interface driver usbfs
[   14.105314] usbcore: registered new interface driver hub
[   14.143867] usbcore: registered new device driver usb
[   14.325649] am335x-phy-driver 47401b00.usb-phy: GPIO lookup for consumer reset
[   14.325667] am335x-phy-driver 47401b00.usb-phy: using device tree for GPIO lookup
[   14.325680] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/usb@47400000/usb-phy@47401b00[0]'
[   14.325687] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/usb@47400000/usb-phy@47401b00[0]'
[   14.325693] am335x-phy-driver 47401b00.usb-phy: using lookup tables for GPIO lookup
[   14.325700] am335x-phy-driver 47401b00.usb-phy: lookup for GPIO reset failed
[   14.325708] am335x-phy-driver 47401b00.usb-phy: GPIO lookup for consumer vbus-detect
[   14.325713] am335x-phy-driver 47401b00.usb-phy: using device tree for GPIO lookup
[   14.325718] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpios' property of node '/ocp/usb@47400000/usb-phy@47401b00[0]'
[   14.325723] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpio' property of node '/ocp/usb@47400000/usb-phy@47401b00[0]'
[   14.325728] am335x-phy-driver 47401b00.usb-phy: using lookup tables for GPIO lookup
[   14.325733] am335x-phy-driver 47401b00.usb-phy: lookup for GPIO vbus-detect failed
[   14.325796] 47401b00.usb-phy supply vcc not found, using dummy regulator
[   14.413725] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
[   14.462116] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1
[   14.519464] ti-pruss 4a300000.pruss: creating PRU cores and other child platform devices
[   14.520905] irq: no irq domain found for /ocp/pruss_soc_bus@4a326000/pruss@4a300000/intc@4a320000 !
[   14.521408] irq: no irq domain found for /ocp/pruss_soc_bus@4a326000/pruss@4a300000/intc@4a320000 !
[   14.726631] remoteproc remoteproc1: 4a334000.pru0 is available
[   14.726737] pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a334000 probed successfully
[   14.738295] remoteproc remoteproc2: 4a338000.pru1 is available
[   14.738393] pru-rproc 4a338000.pru1: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a338000 probed successfully
[   14.840396] hub 1-0:1.0: USB hub found
[   14.849049] hub 1-0:1.0: 1 port detected
[   16.720552] using random self ethernet address
[   16.728515] using random host ethernet address
[   16.768326] using host ethernet address: 90:59:AF:5C:CC:B3
[   16.799269] using random self ethernet address
[   16.836949] using random host ethernet address
[   16.880356] using host ethernet address: 90:59:AF:5C:CC:B3
[   16.912402] Bluetooth: Core ver 2.22
[   16.946431] usb0: HOST MAC 90:59:af:5c:cc:b3
[   16.962918] NET: Registered protocol family 31
[   16.990282] usb0: MAC ca:a6:54:37:ae:c7
[   17.005522] Bluetooth: HCI device and connection manager initialized
[   17.062749] Bluetooth: HCI socket layer initialized
[   17.093593] Mass Storage Function, version: 2009/09/11
[   17.093603] LUN: removable file: (no medium)
[   17.093822] LUN: removable read only file: /dev/mmcblk0p1
[   17.093826] Number of LUNs=1
[   17.104389] g_multi gadget: Multifunction Composite Gadget
[   17.104399] g_multi gadget: g_multi ready
[   17.336652] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[   17.439539] Bluetooth: L2CAP socket layer initialized
[   17.508067] Bluetooth: SCO socket layer initialized
[   17.654598] net eth0: initializing cpsw version 1.12 (0)
[   17.660031] net eth0: initialized cpsw ale version 1.4
[   17.665195] net eth0: ALE Table size 1024
[   17.908597] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=-1)
[   18.092780] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   19.170292] NET: Registered protocol family 15
[   19.238710] rtc-ds1307 2-006f: write secs=41, mins=6, hours=15, mday=5, mon=2, year=118, wday=1
[   19.238732] rtc-ds1307 2-006f: write: c1 06 15 0a 05 03 18
[   19.240757] rtc-ds1307 2-006f: read: c1 06 15 2a 05 03 18
[   19.240777] rtc-ds1307 2-006f: read secs=41, mins=6, hours=15, mday=5, mon=2, year=118, wday=1
[   19.879805] Initializing XFRM netlink socket
[   20.266292] random: crng init done
[   24.170636] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
[   30.448654] gpio-60 (sysfs): gpiod_request: status -16
[   30.448671] export_store: status -16
[   30.448834] gpio-114 (sysfs): gpiod_request: status -16
[   30.448840] export_store: status -16
[   30.455208] gpio-117 (sysfs): gpiod_request: status -16
[   30.455222] export_store: status -16
[   30.455324] gpio-116 (sysfs): gpiod_request: status -16
[   30.455329] export_store: status -16
[   30.455416] gpio-44 (sysfs): gpiod_request: status -16
[   30.455420] export_store: status -16
[   30.455503] gpio-117 (sysfs): gpiod_request: status -16
[   30.455506] export_store: status -16
[   30.455581] gpio-116 (sysfs): gpiod_request: status -16
[   30.455585] export_store: status -16
[   30.455662] gpio-44 (sysfs): gpiod_request: status -16
[   30.455666] export_store: status -16
[   30.455745] gpio-117 (sysfs): gpiod_request: status -16
[   30.455749] export_store: status -16
[   30.455826] gpio-116 (sysfs): gpiod_request: status -16
[   30.455830] export_store: status -16
[   30.455906] gpio-44 (sysfs): gpiod_request: status -16
[   30.455909] export_store: status -16
[   30.455990] gpio-117 (sysfs): gpiod_request: status -16
[   30.455993] export_store: status -16
[   30.456069] gpio-116 (sysfs): gpiod_request: status -16
[   30.456073] export_store: status -16
[   30.456147] gpio-44 (sysfs): gpiod_request: status -16
[   30.456151] export_store: status -16
[   30.456232] gpio-117 (sysfs): gpiod_request: status -16
[   30.456236] export_store: status -16
[   30.456309] gpio-116 (sysfs): gpiod_request: status -16
[   30.456313] export_store: status -16
[   30.456388] gpio-44 (sysfs): gpiod_request: status -16
[   30.456391] export_store: status -16
[   30.456469] gpio-117 (sysfs): gpiod_request: status -16
[   30.456473] export_store: status -16
[   30.456547] gpio-116 (sysfs): gpiod_request: status -16
[   30.456551] export_store: status -16
[   30.456626] gpio-44 (sysfs): gpiod_request: status -16
[   30.456629] export_store: status -16
[   30.456710] gpio-117 (sysfs): gpiod_request: status -16
[   30.456713] export_store: status -16
[   30.456788] gpio-116 (sysfs): gpiod_request: status -16
[   30.456791] export_store: status -16
[   30.456866] gpio-44 (sysfs): gpiod_request: status -16
[   30.456869] export_store: status -16
[   30.494998] gpio-60 (sysfs): gpiod_request: status -16
[   30.495014] export_store: status -16
[   30.495114] gpio-114 (sysfs): gpiod_request: status -16
[   30.495119] export_store: status -16
[   30.523731] gpio-60 (sysfs): gpiod_request: status -16
[   30.523747] export_store: status -16
[   30.523859] gpio-114 (sysfs): gpiod_request: status -16
[   30.523864] export_store: status -16

  • Hi Naseer,

    I suspect this default value is set within the MCP79410 RTC driver. You should debug that driver to find where exactly this value is set.

    linux-4.9.41/drivers/rtc/rtc-ds1307.c

    You can also check with your RTC chip supplier support team.

    Regards,
    Pavel
  • Hi,
    I don't know how I can debug rtc-ds1307.c. I have walked through the code and I don't think the problem is there. The read_time and set time is called from another file that makes the decision.
    I can't see microchip helping on this, the clock is working, programming and running.

    From the dmseg all I can deduce is
    hctosys fails on rtc0 ---> I don't program rtc0
    module init rtc_ds1307
    ...
    mcp79410 registered as rtc1 ---> so has hctosys worked on rtc1?
    ...
    module init rtc_ds1307 ----> module init again? This can't be right?

    best regards

    Naseer
  • Naseer Nazar said:
    beaglebone black with TI linux 4.9.41 RT.

    From what I understand you are using ti-processor-sdk-linux-rt-am335x-evm-04.01.00.06 PSDK. But note that Linux-RT SDK is NOT supported for BeagleBone Black board:

    Please try if you can reproduce this issue with ti-processor-sdk-linux-am335x-evm-04.01.00.06

    Regards,
    Pavel

  • Hi Pavel,
    www.ti.com/.../beaglebk lists the linux-RT version. Also it was recommended by Yordan Kovachev to resolve some ioctl latency issues I was having with the beaglebone black. e2e.ti.com/.../519311 way back at version 2.00.02.11.

    Can we gain some further clarification please.

    best regards

    Naseer Nazar
  • Naseer,

    I will check that with the Linux team and come back to you. Meanwhile you can try to reproduce the issue with ti-processor-sdk-linux-am335x-evm-04.01.00.06.

    Regards,
    Pavel
  • Hi Pavel,
    In the end I went for the latest sdk 04.02.00.09. Updated the dtb and set tisdk_am335x-evm-rt-defconfig
    CONFIG_RTC_HCTOSYS_DEVICE="rtc1"
    CONFIG_RTC_SYSTOHC_DEVICE="rtc1"

    boot from sdcard and rtc dmesg reports current time

    root@am335x-evm:~# dmesg | grep rtc
    [ 1.608076] hctosys: unable to open rtc device (rtc1)
    [ 13.362092] rtc rtc0: 44e3e000.rtc: dev (253:0)
    [ 13.362114] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
    [ 13.966215] Modules linked in: rtc_ds1307(+) edt_ft5x06(+) spidev(+) rtc_omap musb_am335x ti_am335x_tscadc omap_wdt sch_fq_codel uio_module_drv(O) uio cryptodev(O)
    [ 14.162720] rtc-ds1307 2-006f: read: d8 56 11 3c 14 03 18
    [ 14.162734] rtc-ds1307 2-006f: read secs=58, mins=56, hours=11, mday=14, mon=2, year=118, wday=3 ====> CURRENT TIME
    [ 14.163087] rtc-ds1307 2-006f: read: d8 56 11 3c 14 03 18
    [ 14.163098] rtc-ds1307 2-006f: read secs=58, mins=56, hours=11, mday=14, mon=2, year=118, wday=3
    [ 14.163389] rtc rtc1: mcp7941x: dev (253:1)
    [ 14.163411] rtc-ds1307 2-006f: rtc core: registered mcp7941x as rtc1
    [ 14.163430] rtc-ds1307 2-006f: 64 bytes nvram
    [ 14.825904] Modules linked in: omap_aes_driver(+) crypto_engine omap_sham ti_emif_sram pruss_soc_bus rtc_ds1307 edt_ft5x06 spidev(+) rtc_omap musb_am335x ti_am335x_tscadc omap_wdt sch_fq_codel uio_module_drv(O) uio cryptodev(O)
    [ 19.393336] PM: bootloader does not support rtc-only!

    However system date not updated, showing old date

    root@am335x-evm:~# hwclock -r -f /dev/rtc1; date
    Wed Mar 14 11:58:47 2018 0.000000 seconds
    Sat Dec 23 13:47:55 UTC 2017

    So Changed to rtc1 /etc/udev/rules.d/localextra.rules

    # The first rtc device is symlinked to /dev/rtc
    KERNEL=="rtc1", SYMLINK+="rtc"

    reboot

    Back to same problem, current time overwritten with old time

    root@am335x-evm:~# dmesg | grep rtc
    [ 1.608131] hctosys: unable to open rtc device (rtc1)
    [ 6.054670] omap_rtc 44e3e000.rtc: already running
    [ 6.086588] rtc rtc0: 44e3e000.rtc: dev (253:0)
    [ 6.086610] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
    [ 6.750909] rtc-ds1307 2-006f: read: 96 06 12 3c 14 03 18
    [ 6.750923] rtc-ds1307 2-006f: read secs=16, mins=6, hours=12, mday=14, mon=2, year=118, wday=3 ====> CURRENT TIME READ
    [ 6.751277] rtc-ds1307 2-006f: read: 96 06 12 3c 14 03 18
    [ 6.751287] rtc-ds1307 2-006f: read secs=16, mins=6, hours=12, mday=14, mon=2, year=118, wday=3
    [ 6.751628] rtc rtc1: mcp7941x: dev (253:1)
    [ 6.751650] rtc-ds1307 2-006f: rtc core: registered mcp7941x as rtc1
    [ 6.751670] rtc-ds1307 2-006f: 64 bytes nvram
    [ 6.856153] Modules linked in: spidev(+) rtc_ds1307 edt_ft5x06 rtc_omap omap_wdt ti_am335x_tscadc musb_am335x sch_fq_codel uio_module_drv(O) uio cryptodev(O)
    [ 9.060818] PM: bootloader does not support rtc-only!
    [ 12.089673] Modules linked in: pm33xx wkup_m3_ipc bluetooth wkup_m3_rproc remoteproc pvrsrvkm(O) omap_aes_driver pruss_soc_bus crypto_engine omap_sham ti_emif_sram spidev(+) rtc_ds1307 edt_ft5x06 rtc_omap omap_wdt ti_am335x_tscadc musb_am335x sch_fq_codel uio_module_drv(O) uio cryptodev(O)
    [ 21.702344] rtc-ds1307 2-006f: write secs=13, mins=46, hours=13, mday=23, mon=11, year=117, wday=6 =====> OLD TIME WRITTEN
    [ 21.702365] rtc-ds1307 2-006f: write: 93 46 13 0f 23 12 17
    [ 21.707461] rtc-ds1307 2-006f: read: 93 46 13 2f 23 12 17
    [ 21.707483] rtc-ds1307 2-006f: read secs=13, mins=46, hours=13, mday=23, mon=11, year=117, wday=6
    root@am335x-evm:~# date;hwclock -r -f /dev/rtc1
    Sat Dec 23 13:47:26 UTC 2017
    Sat Dec 23 13:47:26 2017 0.000000 seconds

    The dmesg first line suggests where the problem is "hctosys: unable to open rtc device (rtc1)". rtc1 is not registered yet. hctosys needs to occur after rtc0 and rtc1 is registered.

    Have I missed as step?

    best regards
    Naseer

  • Naseer Nazar said:
    www.ti.com/.../beaglebk lists the linux-RT version. Also it was recommended by Yordan Kovachev to resolve some ioctl latency issues I was having with the beaglebone black. e2e.ti.com/.../519311 way back at version 2.00.02.11.

    Can we gain some further clarification please.

    I checked BBB with latest ti-processor-sdk-linux-rt-am335x-evm-04.02.00.09 (4.9.59-rt23) and it boot fine. I suspect Linux-RT is not fully validated on BBB, but only on AM335x EVM and AM335x ICE boards, that is why missing in wiki page provided in my previous post. Check the below wiki regarding Linux-RT validation on AM335x EVM:

    Since you were able to reproduce the issue with the non-RT Linux SDK, then the issue is not specific for Linux-RT. For more information regarding Linux-RT, see below presentation:

    I will investigate further on the RTC overwrite issue and came back to you.

    Regards,
    Pavel

  • Naseer Nazar said:
    The dmesg first line suggests where the problem is "hctosys: unable to open rtc device (rtc1)". rtc1 is not registered yet.

    This error comes from within the below file:

    linux-kernel/drivers/rtc/hctosys.c

    Refer to the below e2e threads for info about how to fix that error.

    Regards,
    Pavel

  • Hi Pavel,
    Managed to distill all that information. The key to solving this was to make the external rtc as rtc0 and rtc omap as rtc1. So in tisdk_am335x-evm-rt-defconfig
    CONFIG_RTC_DRV_DS1307=y
    CONFIG_RTC_DRV_OMAP=m

    menuconfig -> Device drivers -> Real time clock
    <*> Dallas/Maxim DS1307/37....

    This changed the order of rtc registration. The rest of the configuration file were referred back to rtc0 along with localextra.rules
    In the end I did not need rtc omap so commented it out and report only for rtc0.
    The changes made for this are as follows in tisdk_am335x-evm-rt-defconfig

    CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
    CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
    CONFIG_RTC_DRV_DS1307=y
    # CONFIG_RTC_DRV_OMAP=m

    menuconfig -> Device drivers -> Real time clock
    (rtc0) RTC used to set the system time
    (rtc0) RTC used to synchronise NTP adjustment
    <*> Dallas/Maxim DS1307/37....

    /etc/udev/rules.d/localextra.rules
    KERNEL=="rtc0", SYMLINK+="rtc"

    on boot the dmesg
    root@am335x-evm:~# dmesg | grep rtc
    [ 1.488379] rtc-ds1307 2-006f: read: a3 34 13 3d 15 03 18
    [ 1.488392] rtc-ds1307 2-006f: read secs=23, mins=34, hours=13, mday=15, mon=2, year=118, wday=4
    [ 1.488731] rtc-ds1307 2-006f: read: a3 34 13 3d 15 03 18
    [ 1.488740] rtc-ds1307 2-006f: read secs=23, mins=34, hours=13, mday=15, mon=2, year=118, wday=4
    [ 1.489023] rtc rtc0: mcp7941x: dev (253:0)
    [ 1.489050] rtc-ds1307 2-006f: rtc core: registered mcp7941x as rtc0
    [ 1.495448] rtc-ds1307 2-006f: 64 bytes nvram
    [ 1.506504] rtc-ds1307 2-006f: read: a3 34 13 3d 15 03 18
    [ 1.506518] rtc-ds1307 2-006f: read secs=23, mins=34, hours=13, mday=15, mon=2, year=118, wday=4
    [ 1.506551] rtc-ds1307 2-006f: setting system clock to 2018-03-15 13:34:23 UTC (1521120863)
    [ 17.693169] rtc-ds1307 2-006f: write secs=39, mins=34, hours=13, mday=15, mon=2, year=118, wday=4
    [ 17.693190] rtc-ds1307 2-006f: write: b9 34 13 0d 15 03 18
    [ 17.697076] rtc-ds1307 2-006f: read: b9 34 13 2d 15 03 18
    [ 17.697098] rtc-ds1307 2-006f: read secs=39, mins=34, hours=13, mday=15, mon=2, year=118, wday=4
    [ 35.563879] rtc-ds1307 2-006f: write secs=58, mins=34, hours=13, mday=15, mon=2, year=118, wday=4
    [ 35.563899] rtc-ds1307 2-006f: write: d8 34 13 0d 15 03 18
    [ 35.564521] rtc-ds1307 2-006f: read: d8 34 13 2d 15 03 18
    [ 35.564533] rtc-ds1307 2-006f: read secs=58, mins=34, hours=13, mday=15, mon=2, year=118, wday=4

    Consider this issue resolved

    thank you for your support

    best regards

    Naseer Nazar