I chip shouldn't affect the emission, as long as you are running high octane gas. I took my 535i all tricked out to the emission test and it passed perfectly. (Many people have the EAT chip when they go to the e-test).
I would suspenct bad cats maybe... The 540i seems to burn cats and O2 sensor rather quickly, good thing that it is easy to change.
'85 Euro 635csi Race Turbo, megasquirt, Group A
'92 525i Touring 5 speed, 3.46 diff, UUC 8.5lb flywheel, soon to be turbo.
'02 Subaru WRX Wagon with STI springs, bigger sway bars