#linuxcnc-devel Logs
May 19 2018
#linuxcnc-devel Calendar
06:59 AM hannan: help
10:50 AM jepler: "The Xilinx Virtex 7 FPGA bitstream has been reverse engineered by Clifford Wolf." https://github.com/SymbiFlow/prjxray
04:32 PM rene-dev_: pcw_home Im not sure I understand how the watchdog in the mesa cards works. why is the has_bit not always set on startup? should they not always start in bitten state?
04:35 PM pcw_home: The watchdog bites when it times out
04:38 PM rene-dev_: yeah, I get that. but does it not then stay in stat state?
04:39 PM pcw_home: The status bit stays set but the bite is transient
04:40 PM rene-dev_: so on the next startup of linuxcnc the bit is cleared by writing the cookie?
04:41 PM pcw_home: the status bit is not cleared by writing the cookie
04:42 PM rene-dev_: so what clears it?
04:42 PM rene-dev_: Im guessing, a mesa card, just sitting there with linuxcnc not running is always in watchdog state?
04:42 PM rene-dev_: bitten state, I mean
04:43 PM pcw_home: the driver clears the status on startup or when requested
04:45 PM pcw_home: (newer Ethernet firmware lights the init light on WD bite and you can see this happen when you stop linuxcnc)
04:46 PM pcw_home: The driver also does a force-write of the FPGA regs when the WD bite flag is cleared
04:47 PM pcw_home: (Tormach just found a bug in that the DPLL force-write was incomplete so you could not recover from a power cycled Ethernet FPGA card without restarting LinuxCNC)
04:48 PM pcw_home: (if you used the DPLL)
04:51 PM pcw_home: I didn't know that was even possible (to recover from a totaly lost connection without restarting LinuxCNC)
04:51 PM pcw_home: but it is!
04:52 PM rene-dev_: how? doesnt the ethernet driver give up on a lost connection?
04:53 PM pcw_home: Yes, but you can recover by 1. setting ioerror false, 2. setting wd-has bit false
04:54 PM pcw_home: it was a surprise to me...
04:54 PM rene-dev_: ah! so you could have a button for that. and probably need to restart any sserial slaves...
04:55 PM pcw_home: yes sserial needs similar treatment
04:55 PM rene-dev_: toggling the run pin...
04:55 PM rene-dev_: what and when is the dpll exactly used?
04:55 PM pcw_home: I expect there are more driver modules that may have bugs like the DPLL but still surprising
04:56 PM rene-dev_: yeah, like the crc bug in sserial that I discovered ;D
04:56 PM rene-dev_: bugs everywhere
04:57 PM pcw_home: the DPLL retimes encoder and stepgen position sampling and allows things like pre-trigger on absolute encoder reads
04:57 PM pcw_home: gets 200 usec jitter down to about 200 ns
04:58 PM pcw_home: pretrigger so say a SSI encoder read start can begin 100 usec before the nominal LinuxCNC read time
05:00 PM pcw_home: The DPLL depends on the host jitter statistics (the statistical rareness of really bad latency)
05:04 PM rene-dev_: so on the stepgen for example it will just sample the position not when the host reads it, but when the pll says so?
05:13 PM pcw_home: yes
05:14 PM pcw_home: typically 50 usec before the nominal read time
05:18 PM pcw_home: setp hm2_[HOSTMOT2](BOARD).0.dpll.01.timer-us -50
05:18 PM pcw_home: setp hm2_[HOSTMOT2](BOARD).0.stepgen.timer-number 1
05:34 PM rene-dev_: ah
05:34 PM rene-dev_: https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/drivers/mesa-hostmot2/watchdog.c#L173
05:34 PM rene-dev_: so the watchdog turns off when it bites?
05:35 PM rene-dev_: wat
05:35 PM rene-dev_: https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/drivers/mesa-hostmot2/watchdog.c#L226
05:49 PM pcw_home: its disabled until the first "pet"
05:51 PM rene-dev_: pet is writing the cookie?
05:51 PM rene-dev_: and it also disables itself when it bites?
05:56 PM pcw_home: Not sure, not sure if it matters since the only thing you can do on a WD bite is restart the WD or LinuxCNC
06:01 PM rene-dev_: yes, but when you restart linuxcnc, the watchdog is still enabled. thats why my guess is that it disables itself when it bites...
06:03 PM pcw_home: Not really, the WD only bites once so its basically disabled any time you start linuxcnc
06:06 PM pcw_home: (disabled from biting)
06:08 PM rene-dev_: ah, that answers my question... and then enabled again on startup by the magic sequence...
06:10 PM pcw_home: So I guess you can look at its as being disabled when it bites, though thats inherent in the hardware
06:13 PM pcw_home: basically its enabled by the first pet
06:13 PM pcw_home: (and a reasonable timeout)
06:16 PM pcw_home: so I just tested (pull Ethernet cable) recover = set ioerror false, set wd-has-bitten false, set sserial run false then true