I notice that setting SYS_COMPANION to something different from default 57600 leads to extremely unstable flight in HIL in mission mode. Apparently there are not many options to choose from with baudrate higher than 57600, so I use 921600. With that setting vehicle starts shaking very rapidly immediately after takeoff especially in mission mode (it is noticeable in other modes, but doesn't appear to be so severe). When on the route the vehicle even flips around multiple times until it is unable to stabilize anymore in which case it just falls. I tried with several versions of the firmware, this behavior is consistent in 1.5.4, 1.6.1, 1.6.3, 1.6.5 and the current master.
The crash is easy to reproduce: set SYS_COMPANION to 921600, set up mission, run HIL@jmavsim (I use pixhack, fwiw). Here is an example of such crash log: http://logs.px4.io/plot_app?log=645cc0dc-ab83-4887-abfb-afa439756b1b
So what do I do to fix this? What is the actual reason of this problem? What more testing can be done? I got scared about this 100% crash chance up to the point when I can not test setting SYS_COMPANION on the real hardware.