Toshiba Corp. and its joint venture partner Western Digital have made peace over the embattled Japanese electronics giant's plan to sell its flash memory unit to raise cash to stay afloat. The agreement allows Western Digital to participate in future investments in their joint venture, clearing the way for a consortium led by Bain Capital to buy Toshiba Memory Corp., the companies said Wednesday. The deal also addresses concerns over protection of valuable patents and other intellectual property in the highly competitive field of flash memory products used in many high-tech products. The two companies said it settles all disputes in litigation and arbitration over Western Digital's objections to the planned sale of the companies' NAND flash-memory SanDisk joint venture. ''The settlement represents the best possible outcome for all parties, clearing the way for the Bain Capital-led consortium to complete its acquisition of TMC as planned,'' Yuji Sugimoto, managing director in Japan of Bain Capital, said in a statement. The two companies said they will jointly invest in a new computer chip fabrication unit at their joint venture in central Japan and in another facility in northeastern Japan's Iwate prefecture. The plan calls for Toshiba Memory Corp. to eventually sell shares through an initial public offering. ''With the concerns about litigation and arbitration removed, we look forward to renewing our collaboration with Western Digital, and accelerating TMC's growth to meet growing global demand for flash memory,'' said Yasuo Naruke, a Toshiba senior executive vice president and president and CEO of Toshiba Memory. He said the plan will ensure Toshiba Memory has the resources it needs to compete in the flash memory market, which is growing quickly with advances in artificial intelligence and networks for products that have internet connections, known broadly as the ''internet of things.'' Western Digital's CEO Steve Milligan said the arrangement with Toshiba adequately protects its own interests. Toshiba has said it hopes the sale, estimated at 2 trillion yen ($18 billion), will close by the end of March. It may have to clear further hurdles, such as possible anti-trust concerns. Toshiba is inundated with losses related to its U.S. nuclear operations at Westinghouse Electric Co., which filed for bankruptcy earlier this year. Its decline, worsened earlier scandals over bookkeeping and corporate governance, is one of the most dramatic downfalls of a modern Japanese company. But the company has said it expects to return to the black by the end of this fiscal year, in March. In the meantime, it has struggled to avoid being delisted. Last week it raised 600 billion yen ($5.3 billion) by issuing new shares with 60 overseas investment funds. Bain Capital Private Equity, based in Boston, is one of the world's leading investment firms. The consortium it is leading includes the government-backed Development Bank of Japan and the Innovation Network Corp. of Japan, which is made up of 26 big-name Japanese corporate investors, including Sony Corp., Canon Inc., Toyota Motor Corp. and Sumitomo Mitsui Banking Corp. The consortium also includes South Korea's SK Hynix.