Had exactly the same issue myself and just managed to solve it. Originally was told by BMW that it may be the GM5 module (very expensive!!!). I checked all the fuses associated with the alarm (bmw have it listed as theft prevention device). It was a 5 amp fuse gone. I had to re-programme both master keys afterwards. This is easy. Put first key in ignition, ensure all doors and windows are closed but dont lock. Turn to position 1 for a couple of seconds and then take out the key (ensure that you dont turn to position 1 for more than 5 seconds, just a quick flick does it). Take out key. Hold in the button with the arrow on it (the one nearest the metal part of the key) and whilst held in, press the button with the bmw logo on it 3 times in succession, then relaese the button with the arrow on it. Doors should lock and unlock to confirm key has been programmed. If you have another master key, repeat these steps again, except DONT PUT IN IGNITION, just do the button pressing bit. You can do as many keys as you wish.
Deggles, August 2009