Statistics: Posted by Aleix — Thu Nov 24, 2016 4:04 pm
Fatal exception 9(LoadStoreAlignmentCause):
epc1=0x40100c79, epc2=0x00000000, epc3=0x00000000, excvaddr=0x31313036, de
pc=0x00000000
Attempt to read/write memory with an unaligned address (for example, trying to read/write a 32-bit word at an address that is not a multiple of 4)
Statistics: Posted by Guest — Thu Nov 17, 2016 5:24 pm
Code:
void ICACHE_FLASH_ATTR flashmem_save_network_settings (const phoneap_network_settings_t *settings) {
/*
struct station_config *config = (struct station_config *)os_zalloc(sizeof(struct station_config));
os_strncpy (config->ssid, settings->ap_ssid, sizeof(settings->ap_ssid)-1);
os_strncpy (config->password, settings->ap_wpa2_key, sizeof(settings->ap_wpa2_key)-1);
*/
char ssid[32] = "";
char pwd[64] = "";
os_strncpy (ssid, settings->ap_ssid, sizeof(ssid));
os_strncpy (pwd, settings->ap_wpa2_key, sizeof(ssid));
wifi_set_opmode(STATION_MODE);
struct station_config st_conf;
st_conf.bssid_set = 0;
os_memcpy (&st_conf.ssid, ssid, 32);
os_memcpy (&st_conf.password, pwd, 64);
//os_delay_us(500);
//os_printf ("WILL NOW SAVE: %s, %s\r\n", st_conf.ssid, st_conf.password);
if (wifi_station_set_config (&st_conf)) {
os_printf ("[flashmem_save_network_settings] Saved new network settings: SSID = %s, PWD = %s\r\n", 0x3ffffe30, st_conf.password);
}
else {
os_printf ("[flashmem_save_network_settings] ERROR saving new network settings: SSID = %s, PWD = %s\r\n", 0x3ffffe50, st_conf.password);
}
}
void ICACHE_FLASH_ATTR flashmem_clear_network_settings () {
char ssid[32] = "phoneap";
char pwd[64] = "0000";
struct station_config config;
config.bssid_set = 0;
os_memcpy (&config.ssid, ssid, 32);
os_memcpy (&config.password, pwd, 64);
if (wifi_station_set_config (&config)) {
os_printf ("[flashmem_clear_network_settings] Cleared network settings: SSID = %s, PWD = %s\r\n", config.ssid, config.password);
}
else {
os_printf ("[flashmem_clear_network_settings] ERROR clearing new network settings: SSID = %s, PWD = %s\r\n", config.ssid, config.password);
}
}
Statistics: Posted by Aleix — Wed Nov 09, 2016 12:18 am