ESP8266 Developer Zone The Official ESP8266 Forum 2015-06-12T00:50:30+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=585 2015-06-12T00:50:30+08:00 2015-06-12T00:50:30+08:00 https://bbs.espressif.com:443/viewtopic.php?t=585&p=2190#p2190 <![CDATA[Re: spi_flash_erase_sector() api return error]]>
Thank you very much for your help. It was indeed a flash download tool problem and solved with your suggestion of using Official Flash Download Tool.

I resolved to COM PORT issue by freeing some ports below COM 21 based on the details at following link. Hope it may help someone else.
http://www.istime.com/istdnn/portals/0/documents/proc%20and%20instru/computers/make%20com%20ports%20available.pdf


Thanks Again.

Statistics: Posted by gailu — Fri Jun 12, 2015 12:50 am


]]>
2015-06-11T16:14:01+08:00 2015-06-11T16:14:01+08:00 https://bbs.espressif.com:443/viewtopic.php?t=585&p=2184#p2184 <![CDATA[Re: spi_flash_erase_sector() api return error]]>
So sorry for the inconvenience.

This problem is related to flash download tool, if you didn't choose the right flash map( option 6 according to your compilation), it will be considered as 512KB flash by default, so that you can't erase sector 129..

4*1024Byte per sector , 129 sector = 129*4*1024 Bytes is beyond 512KBytes..

We will update our flash download tool to support more COM.

Thanks for your interest in ESP8266 !

Statistics: Posted by ESP_Faye — Thu Jun 11, 2015 4:14 pm


]]>
2015-06-11T15:58:48+08:00 2015-06-11T15:58:48+08:00 https://bbs.espressif.com:443/viewtopic.php?t=585&p=2183#p2183 <![CDATA[Re: spi_flash_erase_sector() api return error]]>
Thanks for your reply. I am unable to use official download tool because it shows maximum COM port up to COM21. However on my both Windows 8 laptops COM30 is assigned to my USB adapter.

Anyway, the problem is not related to the tool or downloading image. I am running my image successfully on ESP-12E, all my wifi and other stuff is working fine. However when I am erasing flash using the following code (running on esp8266) it returns SPI_FLASH_RESULT_OK if I pass sector number 121 as argument but returns SPI_FLASH_RESULT_ERR when I pass argument 129.

Code:

if(SPI_FLASH_RESULT_OK != (ret = spi_flash_erase_sector(129)))
{
    os_printf("ERROR: %d\r\n",ret);
    return -1;   
}


Question: Does spi_flash_erase_sector() have some checks not to allow erasing sector beyond 127?

Statistics: Posted by gailu — Thu Jun 11, 2015 3:58 pm


]]>
2015-06-11T15:23:41+08:00 2015-06-11T15:23:41+08:00 https://bbs.espressif.com:443/viewtopic.php?t=585&p=2182#p2182 <![CDATA[Re: spi_flash_erase_sector() api return error]]>
Please using own official flash download tool v1.2 http://bbs.espressif.com/viewtopic.php?f=5&t=433

Select option 6 in flash map area on flash download tool according to your option in compilation.

If your problem is still unsolved, please offer the capture picture of your flash download tool while downloading bin files.

Statistics: Posted by ESP_Faye — Thu Jun 11, 2015 3:23 pm


]]>
2015-06-11T14:32:29+08:00 2015-06-11T14:32:29+08:00 https://bbs.espressif.com:443/viewtopic.php?t=585&p=2180#p2180 <![CDATA[spi_flash_erase_sector() api return error]]>
I am using ESP-12E from AI Thinker and it has 4 MB flash. I can program any sector in 4MB flash from external programmer (Nodemcu Firmware Programmer). However when trying to erase sectors beyond 127, spi_flash_erase_sector() returns SPI_FLASH_RESULT_ERR so I am not able to use flash capacity that I have. Is there any restriction in spi_flash_erase_sector() to erase sectors beyond some limit. How to overcome this limit and store my data in the available flash sectors beyond 512KB.

I am using SDK1.1.0 (esp_iot_sdk_v1.1.0_15_05_26.zip).

When building image using ./gen_misc.sh, I am selecting option 6 (6=4096KB(1024KB+1024KB)) for spi size and map.

Please help.
Thanks

Statistics: Posted by gailu — Thu Jun 11, 2015 2:32 pm


]]>