Calling wifi_station_ap_change(n) function when the WiFi configuration area of memory is blank causes the device to crash. However, it's not the typical crash where the watchdog timer eventually times out and causes a device reset. Instead, it hangs until device is power cycled. I just spent some time pulling my hair out chasing down this down so I wanted to save anyone else the pain, particularly anyone calling this function in the user_init, it appears as if the device has been programmed incorrectly / bootloader problems since the last data out of the uart is "jump user code" and then nothing...
The SDK documentation V0.9.3 / 2014.11.20 indicates that the wifi_station_ap_change() function will return a bool indicating success or failure, so I'd expect that it would return false in the case that the wifi configuration memory is empty; however in this case it crashes the chip.
Espressif, please consider hardening this function so that it returns false rather crashing in the case that the memory is blank. Please let me know if you need any help in recreating this issue, I can do it consistently

On a related item, it'd be great to have a function such as wifi_station_ap_get_info(unit8 ap_number) which returns the ssid of the ap/network saved in that location.