BalenaOS use Raspberry Pi Compute Module 4 IO board's Real-Time Clock inside container.

@VromansN The DS1307 I2C RTC uses I2C addr 0x68 (which is not changeable) and your CM4 IO board is detected @0x51:
This means, your RTC is cannot be an DS1307: Therefore, there is no need to try with ds1307 at all:
Example: Set RTC Time | Adding a Real Time Clock to Raspberry Pi | Adafruit Learning System
In theory, it could be DS1307-look-alike, but not the usual DS1307 using 0x68.

The DS1307 is often used for as an add-on RTC for the Pi4, not the CM4:

Indeed the CM4 IO board uses the pcf85063AT, but more devicetree options should be set than described in the spec sheet:

dtparam=i2c_vc=on
dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi,addr=0x51

You can set both, but the BALENA_HOST_CONFIG_dtoverlay might be sufficient:

BALENA_HOST_CONFIG_dtparam="i2c_vc=on"`
BALENA_HOST_CONFIG_dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi,addr=0x51

addr=0x51 the I²C address without using echo to probe for 0x51: bcm2711_defconfig: include CONFIG_RTC_HCTOSYS=y to automatically set system time from rtc on cm4io · Issue #4205 · raspberrypi/linux · GitHub

In case you need multiple dtoverlay lines in config.txt (e.g. to enable USB host mode) you need to set use quotes like here inside the variable: Advanced boot settings - Balena Documentation
Example:

BALENA_HOST_CONFIG_dtoverlay = "i2c-rtc,pcf85063a,i2c_csi_dsi,addr=0x51","dwc2,dr_mode=host"

PPS: Another link: Raspberry Pi Compute Module 4 Board RTC (pcf85063a) - device - snapcraft.io

2 Likes