I'm trying to figure out if there's a way to remove the SSID and password data that gets automatically stored in the ATWINC1500 module after a provisioning or a successful connection to an AP in client mode. What I have so far is working well: when the my device boots, it tries to connect using m2m_wifi_default_connect, and if this fails (i.e. rejected because of no data, not that the connection attempt times out), then it enters provisioning mode instead.
What I need to do now is allow a way to erase or otherwise disable the SSID/password info from the module if the user decides to go into a re-provisioning mode on purpose. It's obviously not hard to do once, since the application code can simply not call m2m_wifi_default_connect and intentionally go into provisioning mode instead. However, if the provisioning process doesn't complete for some reason and the user reboots the device, the info will still be present in the module and it will try to reconnect to the old AP. I don't want this to happen; rather, once the user triggers re-provisioning mode, I want the module to be in a fresh/blank state until the process succeeds.
I can work around this by storing a flag in MCU flash (I'm using an ATSAMD21 here) to indicate "provision-only mode," but this seems like a messy solution since the module obviously has the capability handle it internally. I've looked for APIs inside the low-level driver source files, but so far no luck.
Can this be done?