Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: syang on June 16, 2017, 08:08:18 AM
-
Setup
- RPI 2 B+ and RPI3
- piFace SHIM RTC (MCP7941x, DS1307 compatible)
- piCore v9.0.1
- Installed rtc-4.9.22-piCore-v7.tcz
Symptom
- When trying load driver rtc-ds1307 by "sudo modprobe rtc-ds1307", got "unknown symbol" error
- dmesg showed the symbol name is "hwmon_device_register_with_group" implemented in hwmon.ko which is not included in piCore v9.0.1's default kernel drivers
- In fact grep shows there are 3 drivers depending hwmon:
Binary file input/touchscreen/ads7846.ko matches
Binary file rtc/rtc-ds1307.ko matches
Binary file rtc/rtc-rv3029c2.ko matches
Possible Fix
Since so far I couldn't find an existed extension including hwmon drivers(I might miss something?), I've made/tested and submitted a new extension "hwmon-4.9.22-piCore-v7.tcz".
-
hwmon is a new requirement for some of the rtc modules in the 4.9 kernels. I'm sure Bela will fix it.
For the record, there is an overlay to load the drivers.
Name: i2c-rtc
Info: Adds support for a number of I2C Real Time Clock devices
Load: dtoverlay=i2c-rtc,<param>=<val>
Params: abx80x Select one of the ABx80x family:
AB0801, AB0803, AB0804, AB0805,
AB1801, AB1803, AB1804, AB1805
ds1307 Select the DS1307 device
ds1339 Select the DS1339 device
ds3231 Select the DS3231 device
mcp7940x Select the MCP7940x device
mcp7941x Select the MCP7941x device
pcf2127 Select the PCF2127 device
pcf8523 Select the PCF8523 device
pcf8563 Select the PCF8563 device
trickle-diode-type Diode type for trickle charge - "standard" or
"schottky" (ABx80x only)
trickle-resistor-ohms Resistor value for trickle charge (DS1339,
ABx80x)
wakeup-source Specify that the RTC can be used as a wakeup
source
-
hwmon is a new requirement for some of the rtc modules in the 4.9 kernels. I'm sure Bela will fix it.
For the record, there is an overlay to load the drivers.
Name: i2c-rtc
Info: Adds support for a number of I2C Real Time Clock devices
Load: dtoverlay=i2c-rtc,<param>=<val>
Params: abx80x Select one of the ABx80x family:
AB0801, AB0803, AB0804, AB0805,
AB1801, AB1803, AB1804, AB1805
ds1307 Select the DS1307 device
ds1339 Select the DS1339 device
ds3231 Select the DS3231 device
mcp7940x Select the MCP7940x device
mcp7941x Select the MCP7941x device
pcf2127 Select the PCF2127 device
pcf8523 Select the PCF8523 device
pcf8563 Select the PCF8563 device
trickle-diode-type Diode type for trickle charge - "standard" or
"schottky" (ABx80x only)
trickle-resistor-ohms Resistor value for trickle charge (DS1339,
ABx80x)
wakeup-source Specify that the RTC can be used as a wakeup
source
Thanks Paul, yes same RTC works on piCore 6 without hwmon installed, although I can use the ext for myself now but still would like to see it can be fixed in official repo.
Sent from my iPhone using Tapatalk
-
Thanks for noting, will fix it.
-
hwmon.ko added to base in piCore-9.0.2, please update.
-
That's quick ;D, thanks bmarkus!
-
Hi folks;
Just had some partial success with the DS1307. I bought the DS1307 breakout board from Adafruit, wired it to the RasPi-2B board that I have, as that has easy Internet access.
After manually configuring things, I entered at the terminal the command 'sudo hwclock -w' to set the time in the DS1307. Next, I used the editor to insert into the end of /opt/bootlocal.sh the following lines. Then keep the edit, I entered, "filetool.sh -b". After booting the RasPi 2B with no Internet, the command 'date' produces the correct time... good.
modprobe rtc-ds1307
echo ds1307 0x68 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s
The issue is that after moving the micro-SD card to my RasPi-zero, the 'date' command produces the incorrect time. So...
o I double checked that the rtc-4.9.220piCore-v7.tcz is set for on-boot
o Next, in a terminal I entered, "sudo modprobe rtc-ds1307" and received the following error:
modprobe: module rtc-ds1307 not found in modules.dep
Not sure what's up or different between the boards. I suspect that I missed something minor. Your input will be appreciated.
-
Hi kmhill
First you said:
modprobe rtc-ds-1307
echo ds1307 0x68 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s
Then you say you get an error from:
o Next, in a terminal I entered, "sudo modprobe rtc-ds1307" and received the following error:
modprobe: module rtc-ds1307 not found in modules.dep
The second quote seems to have one less dash in the module name.
-
Thanks for catching the transcription error I made from /opt/bootlocal.sh. ... I went back and looked. The following are the lines that I inserted at the end. Now I'm not sure at the moment how to go back and edit or delete the prior note.
modprobe rtc-ds1307
echo ds1307 0x68 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s
In any case, the RasPi-2B boots with the correct time from the RTC. The RasPi-zero doesn't.
-
Hi kmhill
Now I'm not sure at the moment how to go back and edit or delete the prior note.
The extra dash has been removed from your post. After about 30 minutes posts become locked so you cannot make any
more changes.
-
Okay, think I have a clue. I do have a USB hub, but given that I don't yet have a USB2-ethernet adapter or have wifi setup for the RasPi-zero, out of convenience, I thought it might be easier to set things up using another machine. In looking at the repo, I see there are two rtc-4.9.22-piCore TCZ files... One for the arm6 and another for the arm7.
Apologies to everyone, I suspect this topic may have been discussed before. Now, I'm off to the store... :-)
-
Also, thanks Rich for editing the prior note
-
Change of plans... I manually moved .tcz files. The RTC almost works with the RasPi zero. The odd thing is that following boot, the "hwclock" shows the RTC time but the date command doesn't. Here are the latest steps I took:
(1) downloaded the rtc-4.9.22-piCore.tcz* files from the following URL and put them into a compressed tar file using my desktop Linux machine
http://distro.ibiblio.org/tinycorelinux/9.x/armv6/tcz/
(2) I used a USB Flash drive to move the compressed tar file to the RasPi-zero, where I unpacked the file to the "optional" folder. Then I inserted into the onboot.lst file, the line " rtc-4.9.22-piCore.tcz", then did the backup.
(3) I noticed that the bootlocal.sh file already has the "hwclock -s" command to set the system time from the RTC, but it doesn't take. But then when I type in the same command as "sudo hwclock -s" the system takes the time.
Perhaps a short delay would help the RasPi-zero along? I'm not sure how to do that...
-
Did you remove nortc from command line?
-
Hi Bela;
Before your note I had not removed nortc from cmdline.txt.
In looking about the TinyCore page I saw two reports, one said that the keyword nortc directs a system to set the time and date from an Internet time server. Without the keyword nortc the system should load time from an RTC. I also saw a report of a system that wouldn't boot without the code. So, I'm wondering maybe the nortc code is a carry-over from the x86 distro that doesn't make sense for the RasPi-zero?
In any case, my RasPi-zero appears to want the nortc code. Without the nortc code the system locks up on the raspberry page. I tried this twice. I noticed that in booting the RasPi-zero only one raspberry appears on the screen.
-
Okay, I just tried having a sleep delay in and the RasPi-zero appears to be booting with the correct time. The edited code is as follows.
modprobe rtc-ds1307
echo ds1307 0x68 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device
sleep 1s
hwclock -s
I'm not fully happy with it... resetting the RTC is a somewhat of a pain.