Basic Infos
Platform
- Hardware: [ESP-12|ESP-01|ESP-07|ESP8285 device|other]
- Core Version: [Current master / 2.7.4]
- Development Env: [Platformio]
- Operating System: [Windows|Ubuntu]
Settings in IDE
- Module: [Generic ESP8266 Module]
- Flash Mode: [qio|dio|other]
- Flash Size: [4MB/1MB]
- lwip Variant: [v1.4|v2 Lower Memory|Higher Bandwidth]
- Reset Method: [ck|nodemcu]
- Flash Frequency: [40Mhz]
- CPU Frequency: [80Mhz|160MHz]
- Upload Using: [OTA|SERIAL]
- Upload Speed: [115200|other] (serial upload only)
Problem Description
LoadStoreAlignmentCause: Load or store to an unaligned address
epc1=0x402a1358 in IPAddress::operator=(unsigned char const*) at ??:?
en deze stacktrace:
0x4029280d in String::operator=(char const*) at ??:?
0x401012bb in umm_free_core at umm_malloc.cpp:?
0x401015a2 in malloc at ??:?
0x402d1866 in wifi_get_opmode at ??:?
0x402a2568 in spiffs_cache_page_get_by_fd at ??:?
0x402a2568 in spiffs_cache_page_get_by_fd at ??:?
0x402a2568 in spiffs_cache_page_get_by_fd at ??:?
0x402a2568 in spiffs_cache_page_get_by_fd at ??:?
0x4024821f in setConnectionSpeed() at ??:?
0x40248dc2 in prepareWiFi() at ??:?
0x40241468 in WiFiEventData_t::markWiFiBegin() at ??:?
0x40248f29 in AttemptWiFiConnect() at ??:?
0x40205e24 in ESP8266WiFiSTAClass::status() at ??:?
0x40248084 in wifiAPmodeActivelyUsed() at ??:?
0x4024909c in WiFiConnectRelaxed() at ??:?
0x40245ce9 in NetworkConnectRelaxed() at ??:?
0x4024bf23 in ESPEasy_setup() at ??:?
0x40215084 in setup at ??:?
0x40293ddb in loop_wrapper() at core_esp8266_main.cpp:?
0x40100469 in cont_wrapper at ??:?
See the assignment operator and other functions where the const uint8_t* is cast to an const uint32_t*
|
IPAddress& IPAddress::operator=(const uint8_t *address) { |
|
setV4(); |
|
v4() = *reinterpret_cast<const uint32_t*>(address); |
|
return *this; |
|
} |
|
bool IPAddress::operator==(const uint8_t* addr) const { |
|
return isV4() && v4() == *reinterpret_cast<const uint32_t*>(addr); |
|
} |
The call is simply like this:
const IPAddress ip = Settings.IP;
const IPAddress gw = Settings.Gateway;
const IPAddress subnet = Settings.Subnet;
const IPAddress dns = Settings.DNS;
Where all these are part of a larger struct, which begins like this:
unsigned long PID = 0;
int Version = 0;
int16_t Build = 0;
uint8_t IP[4] = {0};
uint8_t Gateway[4] = {0};
uint8_t Subnet[4] = {0};
uint8_t DNS[4] = {0};
As can be seen, these are indeed not 32-bit aligned.
I think the build toolchain may recently have been updated, as this struct and the code that's now failing has not been changed for at least 4 years.
The same code in IPAddress has not been changed for a while as the current master branch has the same code for these functions as the 2.7.4 we're using.
Basic Infos
Platform
Settings in IDE
Problem Description
See the assignment operator and other functions where the
const uint8_t*is cast to anconst uint32_t*Arduino/cores/esp8266/IPAddress.cpp
Lines 118 to 122 in f06710e
Arduino/cores/esp8266/IPAddress.cpp
Lines 130 to 132 in f06710e
The call is simply like this:
Where all these are part of a larger struct, which begins like this:
As can be seen, these are indeed not 32-bit aligned.
I think the build toolchain may recently have been updated, as this struct and the code that's now failing has not been changed for at least 4 years.
The same code in
IPAddresshas not been changed for a while as the current master branch has the same code for these functions as the 2.7.4 we're using.