It is very random. I replaced the crankshaft position sensor and thought that did it but it just came back 2 days later. Some days it will run without a problem and others it’s hard to start or keep running. I checked fuel pressure and spark, all are good. It’s like it just hiccups once an stays on or it will just hiccup until it stalls. The CEL flashes as soon as it hiccups but goes out if it corrects. No codes are thrown and all voltage is constant. My suspicion has been the ECM but was trying to get as much info from other people before pulling the trigger. If and when I replace the ECM, I will let you know how it went.
No way to tell as far as @elantraGLS2 's ecm, but electronic gadgets like that can be damaged by voltage spikes. From a defective alternator, but more likely it would be from jump starting. That kind of damage can wait show up a day or two or even a week later. That said, themost common reason ecm fails is b/c of broken solder joints or broken traces from thermal expansion of the pcb.