It hang again after about ~30 more hours. Here is my conclusion after a day of isolating the problem and how to trigger it:
Insert the Movistar sim-card into the GSM-shield. (I can't trigger this hang with my local Swedish operator Telia and their sim-cards.).
Upload the following dummy sketch to the board:
void setup() {
pinMode(0,INPUT); //The CPU should not drive any pins, so make input
pinMode(1,INPUT);
pinMode(2,INPUT);
pinMode(3,INPUT);
pinMode(13,OUTPUT); //Only for visualization
}
void loop() {
digitalWrite(13,HIGH); //Blink to show we are ok.
delay(5000);
digitalWrite(13,LOW);
delay(200);
}
Now, press the POWER-button on the GSM-shield in the same patterna as the LED blinks, that is: Hold it down for five seconds, then release button for a short time. Repeat this about ten times.
Try to turn off the GSM-module and it's STATUS-led by pressing the POWER-button as usual (2 seconds). It is not possible to turn it off.
-----
Here is a way to test out AT-commands on the module, and also showing that the communication with the GSM-module has been completely lost.
After the above code has been uploaded to the Arduino UNO (or similar), connect digital pin 0 to digital pin 3 and connect digital pin 1 to digital pin 2. Now a terminal program (i.e the Serial Monitor) can talk directly to the modem. In the normal state power on the GSM module by holding the POWER-button for 2 seconds so the STATUS-led lights up. Type "AT" and press the enter-key, you should se an "OK" from the modem.
Now do the above POWER-button toggling ten times with the timing described. Once the STATUS-led is not turning off, try to type "AT"+Enter. It is not possible to communicate with the modem.
----
How did we trigger this in a real test? well, we try to save power and did this after our gprs-connected session. After about 30 hours and 400 successfull times, it locks the modem.
Serial.println("Success! Shutting down...");
while (!gsmAccess.shutdown()); //Shutdown pulls the same line as the POWER-button... and here we repeat it, repeat it, repeat it...