These are chat archives for esp8266/Arduino

5th
Nov 2016
Reza Agung Pambudi
@rezaagungp
Nov 05 2016 01:15
Hi can someone help me with this problem, i has create a hotsopt using esp8266, but why my device still can't connect to the hotspot.
Mehrdad K
@mkeyno
Nov 05 2016 09:07

hi guys , I write some big data to flash with following instruction , but when I read it back , its return 0xFF value , it seems the 0xFF counts gradually increased after each writing

uint8_t* BUFFER = new uint8_t[SPI_FLASH_SEC_SIZE];
/////
optimistic_yield(10000); 
ESP.flashEraseSector(_address/FLASH_SECTOR_SIZE);
ESP.flashWrite(_address,(uint32_t *) BUFFER, SPI_FLASH_SEC_SIZE); 
//// reading instruction 
ESP.flashRead(_address,(uint32_t *)  BUFFER , SPI_FLASH_SEC_SIZE);

anyone might have idea ?, thanks

Me No Dev
@me-no-dev
Nov 05 2016 12:13
and what is the value of _address?
Mehrdad K
@mkeyno
Nov 05 2016 15:25
some location of free memory , in this case started from following index
 _address=(ESP.getSketchSize() + FLASH_SECTOR_SIZE - 1) & (~(FLASH_SECTOR_SIZE - 1));
hreintke
@hreintke
Nov 05 2016 15:25
Some more on the ESP8266WebServer async test and yield() issue.
Looks like that a panic() occurs when he yield() is called from one of the lwip() callbacks.
Don't know the details of yield() and it's implementation.
Is there a limitation on where the yield() function can be called ?
hreintke
@hreintke
Nov 05 2016 16:12
Further testing -> Yield() panic also occurs when used in Ticker callback which is like lwip callback directly from sdk.
Me No Dev
@me-no-dev
Nov 05 2016 16:17
yield will panic in any system callback/interrupt
this is well known "limitation"
hreintke
@hreintke
Nov 05 2016 16:40
@me-no-dev :
Did not know about that, sorry.
Makes it more difficult to have a fail save callback/event based tcp/webserver. You never know whether the callback function will use the yield. Can also be a library call which does it.
As far a I've seen your asyncTCP also "calls back" to application from within lwip. Correct ?
Would need some two step action. Expect that there is no way to "temporary disable" yield() by making it act as a NOOP.
Me No Dev
@me-no-dev
Nov 05 2016 16:49
@hreintke to be honest there is a workaround in about 99.9% of the cases. On many places in the core yield is used to prevent wdt triggering, but can run without it as well. And yes you can insure that nbo callback calls anything with yield if you write the code yourself ;)
hreintke
@hreintke
Nov 05 2016 17:07
OK, thx. Needs some thinking.
Mehrdad K
@mkeyno
Nov 05 2016 18:42
@me-no-dev I use the ESP-12F which is flash setting set to 2M(1M SPIFF), memory state is SketchSize:335.78KB, FreeSketchSpace:688.00KB and FreeHeap:28.41KB, I've upload two files which memory start location is , 344064 & 459274(size of each file 115200 bytes). the first reading is correct but the second reading return 255, is it possible that second reading is kinda out of scope
Mehrdad K
@mkeyno
Nov 05 2016 19:33
every reading byte after address of 458756 return 255
Mehrdad K
@mkeyno
Nov 05 2016 21:38
I've replaced ESP.flashWrite with SPIWrite and it read back correctly most of bytes , but still there is false reading ( 255) for amount of bytes