When connecting Samsung Galaxy S via USB to Hyperterminal, I cannot retrieve any messages from the modem. The commands AT and AT+CMGF=1 work, and <
From 27.005 +CMS ERROR 321 means invalid memory index.
The AT+CPMS command has three parameters with official syntax AT+CPMS=. However I think that the problem is that the phone chokes at having different and values.
So although the official valid syntax would allow for only giving I suspect the syntax to actually be AT+CPMS= on some phones due to some implementation issue, (possibly limited to just certain values/combinations for ). As far as I remember this was the case for phones from SonyEricsson, but I have always given both and with the same value for many years, so my memory might be a bit rusty.
I do think it is might be the case for other phones as well; if you search for example use cases of AT+CPMS you will see that giving both is more common than just (and frankly I have a hard time imagining scenarios where you really want to read/delete from one storage and write/send from another storage). Given that my memory is correct, the described behaviour should be applicable for your phone as well since Samsung uses software from ST-Ericsson in their Galaxy phones.