I've encountered weird problem upon (erase+)write and read it back, on SPI flash above 0x80000,
no matter which option i choose when compiling :
* make COMPILE=gcc BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=6
>> i flashed :
** "eagle.flash.bin" @ 0x00000
** "eagle.irom0text.bin" @ 0x40000
* make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=6
>> i flashed :
** "boot_v1.4(b1).bin" @ 0x00000
** "upgrade\user1.4096.new.6.bin" @ 0x01000
if i (erase+)write the data to SPI Flash @ 0x3C000 (i've also tried 0x7C000), i can read it back successfully.
but when i try to (erase+)write the data @ 0x8C000, i can not read it back (the data returned is not my previously saved).
my sourcecode :
Code: Select all
//#define PRIV_PARAM_START_SEC 0x3C // >> ok
//#define PRIV_PARAM_START_SEC 0x7C // >> ok
#define PRIV_PARAM_START_SEC 0x8C // >> fail
struct structConfigData {
char magic[16];
uint8_t switch1_mode;
uint8_t switch1_timerHourOn1;
uint8_t switch1_timerMinuteOn1;
uint8_t switch1_timerHourOff1;
uint8_t switch1_timerMinuteOff1;
uint8_t switch1_timerRandomMinute1;
uint8_t wifi_mode; // 0 = none, 1=AP, 2=Station 3=Both
char wifi_station_SSID[32];
char wifi_station_password[64];
char wifi_softAP_SSID[32];
char wifi_softAP_password[64];
uint8 wifi_softAP_channel;
AUTH_MODE wifi_softAP_authMode;
uint8 wifi_softAP_SSID_hidden;
};
struct structConfigData npConfigData;
// save data to flash
spi_flash_erase_sector(PRIV_PARAM_START_SEC + PRIV_PARAM_SAVE);
spi_flash_write((PRIV_PARAM_START_SEC + PRIV_PARAM_SAVE) * SPI_FLASH_SEC_SIZE,
(uint32 *) &npConfigData, sizeof(struct structConfigData));
// read it back, i can get my previously saved data, only if i set the sector below 0x80000
spi_flash_read((PRIV_PARAM_START_SEC + PRIV_PARAM_SAVE) * SPI_FLASH_SEC_SIZE,
(uint32 *) &npConfigData, sizeof(struct structConfigData));
here is my flash downlaod tools screenshoot

any advice ? anyone ?