opencomputeproject / Time-Appliance-Project

Develop an end-to-end hypothetical reference model, network architectures, precision time tools, performance objectives and the methods to distribute, operate, monitor time synchronization within data center and much more...
MIT License
1.34k stars 110 forks source link

GPS module UART baud mismatch in code and TimeCard on sale? #113

Open regymm opened 1 week ago

regymm commented 1 week ago

Please forgive me if this has already been issued. I'm kinda new to this project, and is working on a Verilog (instead of VHDL) version of the Time Card's FPGA codebase.

In the current open-source version, the GNSS baud rate is 19200 as specified in the block design (the parameter 4):

  set TC_TodSlave_0 [ create_bd_cell -type ip -vlnv nettimelogic.com:TimeCardLib:TC_TodSlave TC_TodSlave_0 ]
  set_property -dict [ list \
   CONFIG.UartDefaultBaudRate_Gen {4} \
 ] $TC_TodSlave_0

But on the time card I purchased (https://www.makerfabs.com/ocp-tap-time-card.html), the baud rate is 115200, and this parameter to 7 in order to function properly.

regymm commented 1 week ago

However, after the baud rate config change, the ToDSlave registers are still different from the stock v1.2.0 firmware ones.

On stock firmware:

todslave: enablecontrol: 10000001
todslave: errorstatus: 00000000
todslave: uartpolarity: 00000001
todslave: version: 02020001
todslave: correction: 00000000
todslave: uartbaudrate: 00000007
todslave: utcstatus: 00000025 (was 00000125 for a short moment)
todslave: attennastatus: 32000442
todslave: satellitenumber: 00010206

On open source firmware:

todslave: enablecontrol: 10000001
todslave: errorstatus: 00000001 (00000000 then quickly becomes 00000001)
todslave: uartpolarity: 00000001 
todslave: version: 00020003
todslave: correction: 00000000
todslave: uartbaudrate: 00000007
todslave: utcstatus: 00000000
todslave: attennastatus: 32070422
todslave: satellitenumber: 00011b2e

A UART parse error seems to occur, and utcstatus is always zero. With this open-source firmware, if I run phc2sys like sudo phc2sys -c CLOCK_REALTIME -s /dev/ptp4 -O0 -m, I can still see the time from GPS be updated to the system clock and the 37s difference between TAI and UTC. No difference is visible between the stock firmware.

I wonder if this will affect something or if it's OK to ignore it?