User Tools

Site Tools


doc:appunti:hardware:qnap_ts-120

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:hardware:qnap_ts-120 [2022/02/11 10:35] – [Console seriale] niccolodoc:appunti:hardware:qnap_ts-120 [2022/02/12 08:06] (current) – [The Serial Console] niccolo
Line 95: Line 95:
 </code> </code>
  
-===== Console seriale =====+===== The Serial Console =====
  
-Vedere qui: [[http://www.cyrius.com/debian/kirkwood/qnap/ts-119/serial/]]+{{ .:qnap:qnap-ts-120-serial-console-jtag.jpg?direct&400|QNAP TS-120: Console connector}} 
 +{{ .:qnap:qnap-ts-120-serial-console-closeup.jpg?direct&160|Serial Console JTAG Connector}} 
 +On the circuit board of the QNAP TS-120 there is a JTAG connector for the serial console. I used an old CD-ROM audio cable because it had the right connector. I wired only the **GND**, **TX** and **RX** pins from to QNAP to a serial-to-USB adapter. The adapter was inserted intp a GNU/Linux computer running the **minicom** program. The speed of the serial line was set to **115200**. The connector pinout is documented in this page: [[http://www.cyrius.com/debian/kirkwood/qnap/ts-119/serial/|Serial console for QNAP TS-11x/TS-12x]].
  
-I connected only the **GND**, **TX** and **RX** pins from to QNAP to a serial-to-USB adapter. The adapter was inserted intp a GNU/Linux computer running the **minicom** program. The speed of the serial line was set to **115200**.+^ Console Pinout  ^^ 
 +^ 1  | TX        | 
 +^ 2  | VCC +3.3  | 
 +^ 3  | RX        | 
 +^ 4  | GND       |
  
 +This is the boot process captured from the serial line. At the end of the bootstrap you will get a **login prompt**.
  
-===== Tips =====+<code> 
 +         __  __                      _ _ 
 +        |  \/  | __ _ _ ____   _____| | | 
 +        | |\/| |/ _` | '__\ \ / / _ \ | | 
 +        | |  | | (_| | |   \ V /  __/ | | 
 +        |_|  |_|\__,_|_|    \_/ \___|_|_| 
 +       ____              _ 
 +| | | |   | __ )  ___   ___ | |_ 
 +| | | |___|  _ \ / _ \ / _ \| __| 
 +| |_| |___| |_) | (_) | (_) | |_ 
 + \___/    |____/ \___/ \___/ \__|  ** LOADER ** 
 + ** MARVELL BOARD: DB-88F6282A-BP LE TS-120 ,PHY=1.8v 
 + 
 +U-Boot 1.1.4 (Nov  5 2012 - 17:39:47) Marvell version: 3.5.3 
 + 
 +U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CD5C0 
 + 
 +Soc: MV88F6282 Rev 1CPU running @ 1600Mhz L2 running @ 533Mhz 
 +SysClock 533Mhz , TClock 200Mhz 
 +</code> 
 +===== Real Time Clock rtc0 =====
  
 Into the QNAP TS-120 there is a Real Time Clock. You can see the battery on the motherboard and the kernel will print this on the serial console: Into the QNAP TS-120 there is a Real Time Clock. You can see the battery on the motherboard and the kernel will print this on the serial console:
  
 <code> <code>
-hctosys: unable to open rtc device (rtc0) +[    1.262622] hctosys: unable to open rtc device (rtc0) 
-rtc-s35390a 0-0030: rtc core: registered rtc-s35390a as rtc0+[    1.628724] rtc-s35390a 0-0030: rtc core: registered rtc-s35390a as rtc0
 </code> </code>
  
-FIXME Why hctosys is started before the rtc0 device becomes available? Is it a problemCan it be fixed?+The problem is that the rtc support is **compiled as a module** and the kernel executes **hctosys** before the module is loaded, so before the **rtc0** device is available. When the **rtc0** device becomes available, the **udev** subsystem is triggered by the file **/usr/lib/udev/rules.d/85-hwclock.rules**. The rule says to run the script **/usr/lib/udev/hwclock-set**. 
 + 
 +Historically that script does nothing if **systemd** is running, because it assumes that the system clock was already set from the hardware clock. See Debian bug **[[https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855203|#855203 - hwclock-set: Synchronize from hwclock despite systemd presence]]**. 
 + 
 +A quick and dirty solution is to edit the script **/lib/udev/hwclock-set** removing the systemd check: 
 + 
 +<code> 
 +#if [ -e /run/systemd/system ] ; then 
 +#    exit 0 
 +#fi 
 +</code> 
 + 
 +You should also comment-out the **hwclock** commands containing the **%%--systz%%** option, (from the man page: "//It is intended to be used in a startup script on systems with kernels above version 2.6 where you know the System Clock has been set from the Hardware Clock by the kernel during boot//"): 
 + 
 +<code> 
 +  #/sbin/hwclock --rtc=$dev --systz --badyear 
 +... 
 +  #/sbin/hwclock --rtc=$dev --systz 
 +</code>
  
 ===== Upgrading to 4 Tb Hard Disk ===== ===== Upgrading to 4 Tb Hard Disk =====
doc/appunti/hardware/qnap_ts-120.1644572101.txt.gz · Last modified: 2022/02/11 10:35 by niccolo