Maybe Hire Professional Software Engineers
How about starting by hiring actual professional software engineers, who have been formally trained in a university environment? Yeah, how about that instead of incompetents who have read one book on C++ and miraculously know everything there is to know about software systems design, complex data structures, bug-reducing coding practices, concurrent task issues (and other mind-blowing critical timing issues), error-proof inter-task communications, proper coding techniques, COMMENTS IN THE CODE!, small unit module design, object oriented DESIGN (not just coding), and did I mention data structures?
I've been a professional software engineer (with a Computer Science degree) for more than 40 years, and it continues to amaze me that companies STILL think that they can save money by hiring astonishingly incompetent 'coders' who know literally NOTHING about formal computer software design techniques. And then the company managers are all naively surprised when their products fail in fantastically spectacular fashion.
Oh yeah, and one more thing: stop letting electrical engineers write software! You wouldn't have a plumber fix your electrical wiring in your house, would you? He probably could, but you wouldn't want to have to make any modifications to the resulting horror show.