Statistics: Posted by gustavo — Wed Jun 08, 2016 6:47 pm
Statistics: Posted by ESP_Faye — Tue Jun 07, 2016 1:34 pm
Code:
void user_init(void)
{
printf("SDK version:%s\n", system_get_sdk_version());
uint32 temp[4]={0x05, 0x06, 0x07, 0x08};
uint32 temp1[4]={0};
int l = 0x90000;
printf("l: %d - 0x%x\n", l, l);
int i = spi_flash_erase_sector(l);
printf("spi_flash_erase_sector: %d\n", i);
int o = spi_flash_write(l, temp, sizeof(temp));
printf("spi_flash_write: %d\n", o);
int p = spi_flash_read(l, temp1, sizeof(temp1));
printf("spi_flash_read: %d\n", p);
printf("read :0x%x, 0x%x, 0x%x, 0x%x\n", temp1[0], temp1[1], temp1[2], temp1[3]);
uint32 temp2[4] = {0x01, 0x02, 0x03, 0x04};
i = spi_flash_erase_sector(l);
printf("spi_flash_erase_sector: %d\n", i);
o = spi_flash_write(l, temp2, sizeof(temp2));
printf("spi_flash_write: %d\n", o);
p = spi_flash_read(l, temp1, sizeof(temp1));
printf("spi_flash_read: %d\n", p);
printf("read :0x%x, 0x%x, 0x%x, 0x%x\n", temp1[0], temp1[1], temp1[2], temp1[3]);
}
Code:
2nd boot version : 1.5
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
jump to run user1 @ 1000
OS SDK ver: 1.4.0(c599790) compiled @ Mar 1 2016 17:25:17
SDK version:1.4.0(c599790)
l: 589824 - 0x90000
spi_flash_erase_sector: 0
spi_flash_write: 0
spi_flash_read: 0
read :0x1, 0x2, 0x3, 0x0
spi_flash_erase_sector: 0
spi_flash_write: 0
spi_flash_read: 0
read :0x1, 0x2, 0x3, 0x0
Code:
2nd boot version : 1.5
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
jump to run user1 @ 1000
OS SDK ver: 1.4.0(c599790) compiled @ Mar 1 2016 17:25:17
SDK version:1.4.0(c599790)
l: 2424832 - 0x250000
spi_flash_erase_sector: 0
spi_flash_write: 0
spi_flash_read: 0
read :0x0, 0x0, 0x0, 0x0
spi_flash_erase_sector: 0
spi_flash_write: 0
spi_flash_read: 0
read :0x0, 0x0, 0x0, 0x0
Code:
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
ets_main.c
Statistics: Posted by gustavo — Fri Jun 03, 2016 10:44 pm
Statistics: Posted by ESP_Faye — Fri Jun 03, 2016 11:29 am
Statistics: Posted by gustavo — Thu Jun 02, 2016 4:51 pm
Statistics: Posted by ESP_Faye — Thu Jun 02, 2016 2:03 pm
Statistics: Posted by gustavo — Wed Jun 01, 2016 6:02 pm
Statistics: Posted by ESP_Faye — Wed Jun 01, 2016 11:22 am
Statistics: Posted by gustavo — Tue May 31, 2016 5:38 pm
Statistics: Posted by ESP_Faye — Tue May 31, 2016 11:36 am
Code:
void user_init(void)
{
printf("SDK version:%s\n", system_get_sdk_version());
uint32 temp[4]={0x05, 0x06, 0x07, 0x08};
uint32 temp1[4]={0};
int i = spi_flash_erase_sector(0x8c);
printf("spi_flash_erase_sector: %d\n", i);
int o = spi_flash_write(0x8c000, temp, sizeof(temp));
printf("spi_flash_write: %d\n", o);
int p = spi_flash_read(0x8c000, temp1, sizeof(temp1));
printf("spi_flash_read: %d\n", p);
printf("read :%x, %x, %x, %x\n", temp1[0], temp1[1], temp1[2], temp1[3]);
}
Code:
spi_flash_erase_sector: 1
spi_flash_write: 1
spi_flash_read: 1
read :0, 0, 0, 0
Statistics: Posted by gustavo — Mon May 30, 2016 11:15 pm
Code:
void user_init(void)
{
os_printf("SDK version:%s\n", system_get_sdk_version());
uint32 temp[4]={0x05, 0x06, 0x07, 0x08};
uint32 temp1[4]={0};
spi_flash_erase_sector(0x8c);
spi_flash_write(0x8c000, temp, sizeof(temp));
spi_flash_read(0x8c000, temp1, sizeof(temp1));
os_printf("read :%x, %x, %x, %x\n", temp1[0], temp1[1], temp1[2], temp1[3]);
}
Statistics: Posted by ESP_Faye — Fri May 27, 2016 5:08 pm
Statistics: Posted by gustavo — Tue May 24, 2016 5:25 pm
Code:
flashchip->chip_size = 0x01000000;
Code:
uint32 save_chip_size = flashchip->chip_size;
printf("flashchip->chip_size=%d\n",save_chip_size);
//flashchip->chip_size = 0x01000000; // Open all 16Mbytes
Code:
error: unknown type name 'SpiFlashChip'
extern SpiFlashChip * flashchip; // in RAM-BIOS: 0x3fffc714
^
Statistics: Posted by septijo — Fri Sep 18, 2015 10:51 am
Code:
extern SpiFlashChip * flashchip; // in RAM-BIOS: 0x3fffc714
....
uint32 save_chip_size = flashchip->chip_size;
flashchip->chip_size = 0x01000000; // Open all 16Mbytes
// 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));
flashchip->chip_size = save_chip_size;
Statistics: Posted by pvvx — Sun Sep 13, 2015 8:08 am
Code:
//#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));
Statistics: Posted by septijo — Fri Sep 11, 2015 8:00 pm