When you pull your key out does the chime continue to sound? If it does, replace the ignition switch. There is a TSB for it. Mine started to do that and I could lock or unlock with the fob or the door switch. I had to lock it with the key after closing the doors. Apparently the ignition switch remains in the open position and disables the ability to lock or unlock the doors.
That makes sense - also probably explains why it reset itself - when the key was pulled out, it probably reset the ignition switch. I'll have to check it out, the next time it happens. Too bad I'm out of warranty - could get the TSB done for free. The only difference is that I believe I could lock the doors, just not unlock them. It could be a different problem, I'll have the check the vin number for applicability.
Thanks
edit - found the TSB (google is your friend) reproduced here for reference:
MULTI-MODEL - KEY REMINDER CHIME KEEPS CHIMING OR KEYLESS ENTRY INOPERATIVE
BULLETIN NOTE: This bulletin supercedes the previous bulletin 09-32/06 issued on 7/18/06. The SUBJECT has been revised.
APPLICABLE MODEL(S)/VINS^ 2004 - 2006 Mazda3 vehicles with VINs lower than JM1 BK**** **526084 (produced before April 18, 2006)
^ 2006 Mazda5 vehicles with VINs lower than JM1 CR**** **125853 (produced before April 18, 2006)
DESCRIPTION
On some vehicles, the key reminder chime keeps chiming even though the key is pulled out of the ignition. In addition, the doors cannot be locked with the keyless entry system. This is caused by an internal failure from a contact plate that was not properly molded.
Customers having this concern should have their vehicle repaired using the following repair procedure.
REPAIR PROCEDURE
1. Verify customer concern.
2. Record the customer's radio station presets.
3. Disconnect the negative battery cable.
4. Remove the column cover. Refer to Mazda3 Workshop Manual section 09-17 COLUMN COVER REMOVAL/INSTALLATION or Mazda5 Workshop Manual section 09-17 COLUMN COVER REMOVAL/INSTALLATION.
5. Remove the ignition switch from the steering lock.
6. Disconnect the connector from the ignition switch by pulling down on the lever.
7. Reconnect the connector to the new ignition switch.
8. Install the new ignition switch.
9. Install the column cover.
10. Reconnect the negative battery cable.
11. Verify repair.
12. Reset the customer's radio station presets.
__________________
"Street racing or going to the grocery store, either way the potential of hitting an innocent bystander is the same, just one is more fun than the other."
Active Officer of street racing unit