If the car is idling rough at low rpms and check engine light is flashing it could possibly be an exhaust valve. Either cracked valve seat or broken spring. Recommend taking it for a compression check.
So I changed my intake manifold and reset the code. And when I was driving same code came out p1004 but this time it says ECU Battery Feed & Power Ground. Can anyone help and let me know what this mean.