My wife’s 2007 Mazda CX-7 is having an issue with both key fobs not locking the/ unlocking or allowing the horn panic button to operate. Both key fobs have new batteries in them. When I open the driver’s door a key in ignition sound chimes without the key in the ignition (this only happens with the driver’s door). I have already reset the ECM by disconnecting the battery and hitting the brake and waiting ½ hour. The red dash key ignition immobilize light flashes on the dash until I put the key in the ignition and the car will start normally. I have replaced ignition switch and returned it to AutoZone because that did not solve the problem this was the electrical portion of the ignition.
Your keys need to be synchronized with the entry system. Your owners manual should have the procedure. I found this description for Mazda but it might not work for your model.
A call to the Dealer might be in order.