At idle, the motor has a thump when the pistons fire.
Sounds like a piston misfire.
The engine light may be something else.
If there is a low sounding knock which increases when you idle up a bit you most likely have bad rod bearings.
Try to retrieve the diagnostics trouble codes from the computer to have an idea why the engine light is flashing.