If the returned date and time is not correct, or “hwclock” returns an error, use the “-w”
option to set the hardware clock to the current time:
$
sudo hwclock -w
Then recheck the time stored in the hardware clock to ensure it matches. Linux may have
failed to automatically update the hardware clock after the last reboot if its internal
registers contained invalid values.
If the RTC still doesn’t work, you should check if the Pi sees the RTC chip on the I
2
C bus.
Run these two commands:
$
sudo modprobe -r rtc_ds1307
$
sudo i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n]
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- 57 -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 6f
70: -- -- -- -- -- -- -- —
You should see “6f” in the address list. This is the address of the RTC.
If the RTC address is detected, double check your software installation for issues at the
Linux modules level.
Run the “lsmod” command to list the loaded modules and check that “i2c_dev” and
“i2c_bcm2708” are both listed.
If the RTC address is not detected, the cause could be a hardware problem, on the Strato
board or the Raspberry Pi. If you have another Pi or Strato board, try swapping them to
isolate the faulty board.
Configuring the serial port
By default, the Linux serial console is active on the main UART (/dev/ttyAMA0). If you are
using the RS-485 interface for your applications, you should disable it to avoid console
data being sent to the serial port.
To disable the ttyAMA0 console service, run:
$
sudo systemctl disable [email protected]
and edit the /boot/cmdline.txt file to delete the serial console configuration:
console=serial0,115200
Configuring the Ethernet port
Only when using the Compute Module 4S, add the following line in the /boot/config.txt file
to enable the Ethernet port:
dtoverlay=dwc2,dr_mode=host
18
Strato Pi CM User Guide