Skip to content

Update SDK to 2.0.0 #2440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2017
Merged

Update SDK to 2.0.0 #2440

merged 1 commit into from
Feb 3, 2017

Conversation

igrr
Copy link
Member

@igrr igrr commented Aug 26, 2016

  • Update SDK header files and libraries to SDK 2.0.0 plus 2.0.0_16_08_09 patch
  • Remove mem_manager.o from libmain.a (replaced with umm_malloc)
  • Remove flash_gd25q32c_enable_QIO_mode from libmain.a:spi_flash.o (saves IRAM space)
  • Remove spi_flash_issi_enable_QIO_mode from libmain.a:spi_flash.o (saves IRAM space)
  • Add user_rf_cal_sector_set; it points to rf_init_data sector.
  • Change the way rf_init_data is spoofed.
    This is now done by wrapping spi_flash_read and returning the data we need during startup sequence.
  • Remove espconn APIs. We can put them back, in theory, but we need to untie espconn_init
    from startup code (using objcopy --rename-symbol, for example)

@codecov-io
Copy link

codecov-io commented Aug 26, 2016

Codecov Report

Merging #2440 into master will not impact coverage.

@@           Coverage Diff           @@
##           master    #2440   +/-   ##
=======================================
  Coverage   27.82%   27.82%           
=======================================
  Files          20       20           
  Lines        3626     3626           
  Branches      656      656           
=======================================
  Hits         1009     1009           
  Misses       2441     2441           
  Partials      176      176

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61787b2...7f6daa2. Read the comment docs.

@igrr
Copy link
Member Author

igrr commented Aug 26, 2016

Size difference report:

sketch                           data     rodata   bss      text     irom0.text   dram     flash
WiFiMulti.ino                    +0       -160     -256     -2272    -4048        -416     -6480   
DNSServer.ino                    +0       -160     -256     -2272    -4064        -416     -6496   
BasicOTA.ino                     +0       -160     -248     -2272    -4048        -408     -6480   
ChatServer.ino                   +0       -168     -200     -2272    -4048        -368     -6488   
SecureWebUpdater.ino             +0       -160     -232     -2272    -4080        -392     -6512   
SDWebServer.ino                  +0       -168     -248     -2271    -4064        -416     -6503   
BarometricPressureWebServer.ino  +0       -168     -200     -2368    -4064        -368     -6600   
SPISlave_SafeMaster.ino          +0       -160     -208     -2272    -4064        -368     -6496   
CheckFlashConfig.ino             +0       -168     -232     -2272    -4048        -400     -6488   
eeprom_clear.ino                 +0       -164     -200     -2272    -4064        -364     -6500   
BasicHttpClient.ino              +0       -168     -264     -2272    -4048        -432     -6488   
UdpNtpClient.ino                 +0       -168     -216     -2272    -4048        -384     -6488   
CardInfo.ino                     +0       -168     -200     -2272    -4064        -368     -6504   
Datalogger.ino                   +0       -168     -216     -2272    -4064        -384     -6504   
FSBrowser.ino                    +0       -160     -248     -2272    -4064        -408     -6496   
WebClientRepeating.ino           +0       -160     -208     -2272    -4048        -368     -6480   
HTTPSRequest.ino                 +0       -140     -232     -2272    -4992        -372     -7404   
Arduino_Wifi_AVRISP.ino          +0       -160     -256     -2271    -4048        -416     -6479   
AdvancedWebServer.ino            +0       -160     -240     -2271    -4064        -400     -6495   
CaptivePortal.ino                +0       -160     -240     -2272    -4048        -400     -6480   
ESP_NBNST.ino                    +0       -168     -248     -2272    -4064        -416     -6504   
AdvancedChatServer.ino           +0       -168     -216     -2272    -4064        -384     -6504   
Sweep.ino                        +0       -164     -208     -2272    -4064        -372     -6500   
BlinkWithoutDelay.ino            +0       -164     -208     -2272    -4064        -372     -6500   
OTALeds.ino                      +0       -168     -256     -2272    -4048        -424     -6488   
CallSDKFunctions.ino             +0       -168     -216     -2272    -4048        -384     -6488   
eeprom_read.ino                  +0       -168     -200     -2272    -4064        -368     -6504   
mDNS-SD_Extended.ino             +0       -160     -248     -2272    -4064        -408     -6496   
sha1.ino                         +0       -168     -216     -2272    -4064        -384     -6504   
HttpBasicAuth.ino                +0       -168     -224     -2272    -4064        -392     -6504   
WebUpdater.ino                   +0       -160     -232     -2272    -4064        -392     -6496   
drawLines.ino                    +0       -168     -216     -2272    -4048        -384     -6488   
shapes.ino                       +0       -168     -216     -2272    -4064        -384     -6504   
SPISlave_Master.ino              +0       -160     -208     -2272    -4064        -368     -6496   
mDNS_Web_Server.ino              +0       -160     -240     -2271    -4064        -400     -6495   
Authorization.ino                +0       -160     -256     -2272    -4048        -416     -6480   
drawRectangle.ino                +0       -168     -216     -2272    -4048        -384     -6488   
httpUpdateSPIFFS.ino             +0       -168     -256     -2272    -4048        -424     -6488   
DumpFile.ino                     +0       -160     -208     -2272    -4064        -368     -6496   
eeprom_write.ino                 +0       -164     -216     -2272    -4064        -380     -6500   
ReuseConnection.ino              +0       -168     -264     -2272    -4048        -432     -6488   
HelloMesh.ino                    +0       -172     -232     -2272    -4048        -404     -6492   
Blink.ino                        +0       -164     -208     -2272    -4048        -372     -6484   
WiFiClientEvents.ino             +0       -160     -240     -2272    -4064        -400     -6496   
HelloServer.ino                  +0       -168     -232     -2271    -4064        -400     -6503   
text.ino                         +0       -168     -216     -2272    -4064        -384     -6504   
WebClient.ino                    +0       -160     -208     -2272    -4064        -368     -6496   
WiFiWebServer.ino                +0       -168     -232     -2272    -4064        -400     -6504   
DhcpChatServer.ino               +0       -168     -200     -2272    -4064        -368     -6504   
UDPSendReceiveString.ino         +0       -168     -200     -2272    -4064        -368     -6504   
SSDP.ino                         +0       -168     -224     -2272    -4064        -392     -6504   
Files.ino                        +0       -160     -208     -2272    -4064        -368     -6496   
TickerBasic.ino                  +0       -164     -208     -2272    -4064        -372     -6500   
DhcpAddressPrinter.ino           +0       -160     -208     -2272    -4064        -368     -6496   
listfiles.ino                    +0       -160     -208     -2272    -4064        -368     -6496   
StreamHttpClient.ino             +0       -160     -256     -2272    -4048        -416     -6480   
ConfigFile.ino                   +0       -168     -232     -2272    -4064        -400     -6504   
OTA-mDNS-SPIFFS.ino              +0       -160     -248     -2272    -4064        -408     -6496   
SPISlave_Test.ino                +0       -160     -208     -2272    -4064        -368     -6496   
TickerParameter.ino              +0       -164     -208     -2272    -4064        -372     -6500   
WiFiTelnetToSerial.ino           +0       -168     -264     -2272    -4064        -432     -6504   
CaptivePortalAdvanced.ino        +0       -160     -256     -2272    -4048        -416     -6480   
WiFiScan.ino                     +0       -168     -264     -2272    -4064        -432     -6504   
httpUpdate.ino                   +0       -160     -248     -2272    -4048        -408     -6480   
NTPClient.ino                    +0       -168     -248     -2272    -4048        -416     -6488   
drawCircle.ino                   +0       -168     -216     -2272    -4064        -384     -6504   
WiFiClientBasic.ino              +0       -160     -256     -2272    -4048        -416     -6480   
ReadWrite.ino                    +0       -160     -208     -2272    -4064        -368     -6496   
drawNumber.ino                   +0       -168     -216     -2272    -4064        -384     -6504   
WebUpdate.ino                    +0       -160     -248     -2272    -4064        -408     -6496   
WiFiAccessPoint.ino              +0       -160     -240     -2272    -4064        -400     -6496   
WiFiClient.ino                   +0       -172     -240     -2272    -4064        -412     -6508   
TestEspApi.ino                   +0       -168     -216     -2272    -4064        -384     -6504   
WebServer.ino                    +0       -168     -200     -2272    -4064        -368     -6504   
SimpleAuthentification.ino       +0       -168     -248     -2272    -4048        -416     -6488   
RTCUserMemory.ino                +0       -160     -224     -2272    -4064        -384     -6496   
TelnetClient.ino                 +0       -168     -216     -2272    -4064        -384     -6504   

@reaper7
Copy link
Contributor

reaper7 commented Aug 26, 2016

Size difference looks good 👍

@reaper7
Copy link
Contributor

reaper7 commented Aug 26, 2016

@igrr - this PR looks very promising with memory consumption.
First of all - I can compile project with brzo i2c implementation (it was not possible with current master branch version)

compare memory usage (my project ino with built-in wire implemetation):
current master vs update_sdk_2.0.0
flash 479686 vs 472286 = 7400 saved!
ram 47768 vs 47400 = 368 saved!
free heap 25632 vs 25984 = 352 saved!

@igrr
Copy link
Member Author

igrr commented Aug 27, 2016

Thanks for testing.
Still not sure if it's okay to rip out espconn support and flash_gd25q32c_enable_QIO_mode, spi_flash_issi_enable_QIO_mode. Is anyone using espconn within Arduino environment?

@penfold42
Copy link

https://www.google.com.au/search?q=espconn.h+filetype:ino

Only 3 hits by the looks of it...

@igrr
Copy link
Member Author

igrr commented Aug 29, 2016

It seems that there is one notable library which uses espconn: https://github.com/i-n-g-o/esp-mqtt-arduino.

@igrr igrr force-pushed the update_sdk_2.0.0 branch from c738356 to 1146c5d Compare August 29, 2016 04:25
@igrr
Copy link
Member Author

igrr commented Aug 29, 2016

I have updated this PR in such a way that espconn_init is only linked in if one of espconn_create, espconn_connect, espconn_accept functions is used in the program. Unless i am missing something, these functions are always used when espconn is used to do TCP, and UDP part of it can function without espconn_init being called.

@igrr
Copy link
Member Author

igrr commented Aug 29, 2016

What is left to figure out is what to do with flash_gd25q32c_enable_QIO_mode, spi_flash_issi_enable_QIO_mode. I have no idea which flash chips are commonly seen inside the modules being produced.

@wolfeidau
Copy link

This is interesting https://github.com/pvvx/esp8266web/blob/2e25559bc489487747205db2ef171d48326b32d4/info/libs/main/startup.c#L205-L217

Is it related to your question?

Would love to see this merged so I can take advantage of some of the new 2.x features!

Cheers.

@igrr
Copy link
Member Author

igrr commented Oct 2, 2016

Yes, that's the part of startup code where these two functions are called depending on chip ID.

The problem is that a choice has to be made: either keep these functions, but add a lot of code into IRAM, or we remove them, but then these flash chips will be unsupported. As stated above, I don't have usage data for these two flash chips, so I don't know whether removing these functions will have an impact on users.

@andig
Copy link
Contributor

andig commented Oct 24, 2016

@igrr does SDK 2.0 include a more recent LWIP version now as discussed some time ago? Would love to retest if the high latency connection crashes are resolved?

@cmfcmf cmfcmf mentioned this pull request Oct 30, 2016
@rsegecin
Copy link

I wonder why this branch didn't pass at the time. I also would like to help but I don't know how you guys do. I mean if I were to merge the current base branch with esp nonOs SDK 2 wouldn't know how to get started.

@igrr igrr force-pushed the update_sdk_2.0.0 branch 3 times, most recently from 36c419b to 6b15ce3 Compare February 3, 2017 00:01
- Update SDK header files and libraries to SDK 2.0.0 plus 2.0.0_16_08_09
  patch
- Remove mem_manager.o from libmain.a (replaced with umm_malloc)
- Disable switch from DIO to QIO mode for certain flash chips (saves
  IRAM space)
- Add user_rf_cal_sector_set; it points to rf_init_data sector.
- Change the way rf_init_data is spoofed.
  This is now done by wrapping spi_flash_read and returning the data we
  need during startup sequence.
- Place lwip library into flash using linker script instead of section
  attributes (saves IRAM space)
@igrr igrr force-pushed the update_sdk_2.0.0 branch from 6b15ce3 to 7f6daa2 Compare February 3, 2017 01:00
@igrr
Copy link
Member Author

igrr commented Feb 3, 2017

sketch                           data     rodata   bss      text     irom0.text   dram     flash
WiFiMulti.ino                    -4       -60      +72      -4068    -7824        +8       -11956  
DNSServer.ino                    +0       -60      +72      -4072    -4944        +12      -9076   
BasicOTA.ino                     +0       -60      +80      -4068    -5504        +20      -9632   
ChatServer.ino                   -4       -76      +104     -4068    -7808        +24      -11956  
SecureWebUpdater.ino             +0       -60      +80      -4068    -5104        +20      -9232   
SDWebServer.ino                  +0       -68      +72      -4067    -5104        +4       -9239   
BarometricPressureWebServer.ino  -4       -68      +104     -4164    -7808        +32      -12044  
SPISlave_SafeMaster.ino          -4       -68      +104     -4068    -7824        +32      -11964  
CheckFlashConfig.ino             -4       -72      +72      -4068    -7824        -4       -11968  
eeprom_clear.ino                 -4       -68      +112     -4072    -7824        +40      -11968  
BasicHttpClient.ino              +0       -68      +80      -4068    -5712        +12      -9848   
UdpNtpClient.ino                 -4       -76      +104     -4068    -7808        +24      -11956  
CardInfo.ino                     -4       -68      +112     -4068    -7808        +40      -11948  
Datalogger.ino                   -4       -76      +104     -4068    -7808        +24      -11956  
FSBrowser.ino                    +0       -60      +80      -4068    -5104        +20      -9232   
WebClientRepeating.ino           -4       -68      +96      -4068    -7808        +24      -11948  
HTTPSRequest.ino                 +0       -76      +80      -4112    -6608        +4       -10796  
Arduino_Wifi_AVRISP.ino          +0       -60      +88      -4067    -5104        +28      -9231   
AdvancedWebServer.ino            +0       -60      +72      -4067    -5104        +12      -9231   
CaptivePortal.ino                +0       -60      +72      -4072    -4960        +12      -9092   
ESP_NBNST.ino                    +0       -68      +80      -4068    -5312        +12      -9448   
AdvancedChatServer.ino           -4       -76      +104     -4068    -7808        +24      -11956  
Sweep.ino                        -4       -68      +96      -4072    -7808        +24      -11952  
BlinkWithoutDelay.ino            -4       -68      +96      -4072    -7808        +24      -11952  
OTALeds.ino                      +0       -68      +72      -4068    -5504        +4       -9640   
CallSDKFunctions.ino             -4       -68      +104     -4068    -7808        +32      -11948  
eeprom_read.ino                  -4       -76      +120     -4068    -7824        +40      -11972  
mDNS-SD_Extended.ino             -4       -60      +72      -4068    -7616        +8       -11748  
sha1.ino                         -4       -76      +104     -4068    -7808        +24      -11956  
HttpBasicAuth.ino                +0       -68      +88      -4068    -5120        +20      -9256   
WebUpdater.ino                   +0       -60      +80      -4068    -5120        +20      -9248   
drawLines.ino                    -4       -76      +96      -4072    -7808        +16      -11960  
shapes.ino                       -4       -76      +96      -4072    -7824        +16      -11976  
SPISlave_Master.ino              -4       -68      +104     -4068    -7808        +32      -11948  
mDNS_Web_Server.ino              +0       -60      +88      -4067    -5104        +28      -9231   
Authorization.ino                +0       -60      +88      -4068    -5712        +28      -9840   
drawRectangle.ino                -4       -76      +96      -4072    -7808        +16      -11960  
httpUpdateSPIFFS.ino             +0       -68      +80      -4068    -5712        +12      -9848   
DumpFile.ino                     -4       -68      +104     -4068    -7808        +32      -11948  
eeprom_write.ino                 -4       -68      +88      -4072    -7824        +16      -11968  
ReuseConnection.ino              +0       -68      +80      -4068    -5712        +12      -9848   
HelloMesh.ino                    +0       -68      +72      -4068    -4944        +4       -9080   
Blink.ino                        -4       -68      +96      -4072    -7808        +24      -11952  
WiFiClientEvents.ino             -4       -60      +80      -4068    -7824        +16      -11956  
HelloServer.ino                  +0       -68      +80      -4067    -5104        +12      -9239   
text.ino                         -4       -76      +96      -4072    -7808        +16      -11960  
WebClient.ino                    -4       -68      +96      -4068    -7808        +24      -11948  
WiFiWebServer.ino                +0       -68      +80      -4068    -5312        +12      -9448   
DhcpChatServer.ino               -4       -76      +104     -4068    -7808        +24      -11956  
UDPSendReceiveString.ino         -4       -76      +104     -4068    -7808        +24      -11956  
SSDP.ino                         +0       -68      +88      -4068    -5088        +20      -9224   
Files.ino                        -4       -68      +112     -4068    -7808        +40      -11948  
TickerBasic.ino                  -4       -68      +104     -4072    -7824        +32      -11968  
DhcpAddressPrinter.ino           -4       -68      +96      -4068    -7808        +24      -11948  
listfiles.ino                    -4       -68      +96      -4068    -7808        +24      -11948  
StreamHttpClient.ino             +0       -60      +72      -4068    -5712        +12      -9840   
ConfigFile.ino                   -4       -72      +96      -4068    -7824        +20      -11968  
OTA-mDNS-SPIFFS.ino              +0       -60      +80      -4068    -5184        +20      -9312   
SPISlave_Test.ino                -4       -68      +104     -4068    -7824        +32      -11964  
TickerParameter.ino              -4       -68      +104     -4072    -7824        +32      -11968  
WiFiTelnetToSerial.ino           +0       -68      +80      -4068    -5312        +12      -9448   
CaptivePortalAdvanced.ino        +0       -60      +72      -4068    -4752        +12      -8880   
WiFiScan.ino                     -4       -68      +64      -4068    -7824        -8       -11964  
httpUpdate.ino                   +0       -60      +72      -4068    -5712        +12      -9840   
NTPClient.ino                    -4       -68      +72      -4068    -7024        +0       -11164  
drawCircle.ino                   -4       -76      +96      -4072    -7808        +16      -11960  
WiFiClientBasic.ino              +0       -60      +88      -4068    -5712        +28      -9840   
ReadWrite.ino                    -4       -68      +112     -4068    -7824        +40      -11964  
drawNumber.ino                   -4       -76      +96      -4072    -7808        +16      -11960  
WebUpdate.ino                    +0       -60      +80      -4068    -5104        +20      -9232   
WiFiAccessPoint.ino              +0       -60      +88      -4068    -4960        +28      -9088   
WiFiClient.ino                   +0       -68      +72      -4068    -5728        +4       -9864   
TestEspApi.ino                   -4       -68      +104     -4068    -7808        +32      -11948  
WebServer.ino                    -4       -76      +104     -4068    -7808        +24      -11956  
SimpleAuthentification.ino       +0       -68      +80      -4068    -5296        +12      -9432   
RTCUserMemory.ino                -4       -64      +80      -4068    -7840        +12      -11976  
TelnetClient.ino                 -4       -76      +104     -4068    -7808        +24      -11956  

@igrr igrr merged commit ae13809 into master Feb 3, 2017
@osos osos mentioned this pull request Feb 21, 2017
@igrr igrr deleted the update_sdk_2.0.0 branch January 2, 2018 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants