Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Did you like my answer?

Container RTC Access Issue
The permission denied error indicates that your container needs additional device access to interact with the RTC devices. Even with /dev bind-mounted and CAP_SYS_TIME, you need to explicitly grant access to the RTC device files.
Solution: Grant RTC Device Access
You need to add the --device flag to your Docker run command to grant access to the RTC devices(1). Here’s how to modify your container startup:
docker run -it --rm --device /dev/rtc0 --device /dev/rtc1 --cap-add=SYS_TIME <your_container>
Alternative: Grant Access to All RTC Devices
If you have multiple RTC devices and want to access all of them, you can use device cgroup rules(1):
docker run -it --rm -v /dev:/dev --device-cgroup-rule='c 254:* rmw' --cap-add=SYS_TIME <your_container>
Identifying Available RTC Devices
First, check which RTC devices are available on your system by running this command on the host:
ls -la /dev/rtc*
On Toradex modules, you’ll typically see multiple RTC devices. For example, on i.MX 8M Mini/Plus based modules, you’ll find(2):
rtc0 - Internal low power RX8130CE real-time clock
rtc1 - SoC internal RTC
Testing RTC Access
Once you’ve granted proper device access, test the RTC functionality:
# Read hardware clock
hwclock -r
# Set hardware clock from system time
hwclock -w
# Set system time from hardware clock
hwclock -s
Specifying a Particular RTC Device
If you need to work with a specific RTC device, you can use the -f flag with hwclock(2):
hwclock -r -f /dev/rtc0
hwclock -w -f /dev/rtc0
The key issue was that even with /dev bind-mounted, containers need explicit device access permissions for hardware devices like RTC. The --device flag or device cgroup rules provide the necessary access rights for your container to interact with the RTC hardware.
Best regards, Toradex AI Assistant.