We have a low power RTC (a RV-3028) and supercap on my new board.
Following this approach, which is absolutely fine.
https://developer.toradex.com/knowledge-base/building-external-kernel-modules-with-torizon
To provision it we have a driver to add to Torizon
rv3028 (1).zip (1.4 MB)
The issue is that this driver has features that appear in a later version of the kernel
Specifically, the identifier RTC_FEATURE_ALARM has been added in kernel 5.13. That
means that the source code we have is too new for the current Torizon
kernel.
make: Entering directory ‘/workdir/rv3028-mod’
make -C /storage/linux M=/workdir/rv3028-mod
make[1]: Entering directory ‘/storage/linux’
AR /workdir/rv3028-mod/built-in.a
CC [M] /workdir/rv3028-mod/rtc-rv3028.o
/workdir/rv3028-mod/rtc-rv3028.c: In function ‘rv3028_ioctl’:
/workdir/rv3028-mod/rtc-rv3028.c:526:42: error: ‘RTC_VL_DATA_INVALID’
undeclared (first use in this function)
526 | status = status & RV3028_STATUS_PORF ? RTC_VL_DATA_INVALID : 0;
| ^~~~~~~~~~~~~~~~~~~
/workdir/rv3028-mod/rtc-rv3028.c:526:42: note: each undeclared
identifier is reported only once for each function it appears in
/workdir/rv3028-mod/rtc-rv3028.c: In function ‘rv3028_probe’:
/workdir/rv3028-mod/rtc-rv3028.c:844:13: error: ‘RTC_FEATURE_ALARM’
undeclared (first use in this function)
844 | clear_bit(RTC_FEATURE_ALARM, rv3028->rtc->features);
| ^~~~~~~~~~~~~~~~~
/workdir/rv3028-mod/rtc-rv3028.c:844:43: error: ‘struct rtc_device’
has no member named ‘features’
844 | clear_bit(RTC_FEATURE_ALARM, rv3028->rtc->features);
| ^~
/workdir/rv3028-mod/rtc-rv3028.c:884:8: error: implicit declaration of
function ‘devm_rtc_register_device’; did you mean
‘rtc_register_device’? [-Werror=implicit-function-declaration]
884 | ret = devm_rtc_register_device(rv3028->rtc);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| rtc_register_device
/workdir/rv3028-mod/rtc-rv3028.c:889:2: error: implicit declaration of
function ‘devm_rtc_nvmem_register’; did you mean
‘devm_nvmem_register’? [-Werror=implicit-function-declaration]
889 | devm_rtc_nvmem_register(rv3028->rtc, &nvmem_cfg);
| ^~~~~~~~~~~~~~~~~~~~~~~
| devm_nvmem_register
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:262:
/workdir/rv3028-mod/rtc-rv3028.o] Error 1
make[1]: *** [Makefile:1734: /workdir/rv3028-mod] Error 2
make[1]: Leaving directory ‘/storage/linux’
make: *** [Makefile:6: all] Error 2
make: Leaving directory ‘/workdir/rv3028-mod’
Traceback (most recent call last):
File “/builder/tcbuilder/backend/kernel.py”, line 64, in build_module
subprocess.run(f"""PATH=$PATH:{toolchain} KERNEL_SRC={linux_src}
KDIR={linux_src}
File “/usr/lib/python3.9/subprocess.py”, line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command
‘PATH=$PATH:/storage/toolchain/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin
KERNEL_SRC=/storage/linux KDIR=/storage/linux
CROSS_COMPILE=aarch64-none-linux-gnu- ARCH=arm64 make
-C /workdir/rv3028-mod’ returned non-zero exit status 2.
Error: Error building kernel module(s)!
Can you recommend what we do now? We don’t actually use the “wake up” processor event feature, so do we try to re-write the driver; dump the very smart RTC chip and the design we have; or is there a possibility of a newer Torizon on the horizon ?
Thanks
Fat Linux.