An Apple engineer who died when his Tesla Model X slammed into a concrete barrier had previously complained about the SUV malfunctioning on the same stretch of Silicon Valley freeway.

His complaints were detailed in a trove of documents released Tuesday by federal investigators in two Tesla crashes involving Autopilot, one in the Bay Area and the other in Florida.

The National Transportation Safety Board is investigating the March 2018 crash that killed Walter Huang, 38, near Mountain View. It's also probing a crash in Delray Beach, Florida, that happened about a year later and killed driver Jeremy Banner.

The documents say Huang told his wife that Autopilot had previously veered his SUV toward the same barrier on U.S. 101 near Mountain View where he later crashed. Huang died at a hospital from his injuries.

"Walter said the car would veer toward the barrier in the mornings when he went to work," the Huang family's attorney wrote in a response to NTSB questions.

Records from an iPhone recovered from the crash site showed that Huang may have been using it before the accident. Records obtained from AT&T showed that data had been used while the vehicle was in motion, but the source of the transmissions couldn't be determined, the NTSB wrote. One transmission was less than one minute before the crash.

Huang had described Autopilot's previous malfunctioning to his brother, the Huang family attorney wrote, in addition to talking with a friend who owns a Model X. Huang, a software engineer, discussed with the friend how a patch to the Autopilot software affected its performance and made the Model X veer, according to the attorney.