SDK 2.0 has been released
Hi there! The new SDK version has been published on Espressif forum.
http://bbs.espressif.com/viewtopic.php?f=46&t=2451
ESP8266_NONOS_SDK_V2.0.0_16_07_19 Release Notes:
- Updated libphy.a to 1055, fixed an issue of large current in Light-sleep.
- Updated AT+ to 1.3.0:
- Added Light-sleep wakeup command, AT+WAKEUPGPIO;
- Fixed abnormal AT+CWDHCPS IP allocation;
- Added at_sdio demo under example directory.
- Fixed probable system default when calling cur and def interfaces.
- Fixed the issue of high current in Deep-sleep mode without disabling SPI first.
- Fixed an issue where the SDK would crash when switching from AP to Station mode by calling wifi_set_phy_mode.
- Updated secondary boot loader to v1.6:
- Supports AT + based on SDIO;
- Supports entering testing mode through GPIO.
- Added support for MXIC Flash QIO mode.
- Fixed exception caused during TCP handshake and retransmission.
- Fixed issues in ESP-NOW.
- Added ESP-PAIR (Simple-Pair) feature, for APIs please refer to ESP8266 SDK API Guide. wpa2-enterprise time function derivation and time check disable can be set by users.
- Support for PEAP/TTLS in wpa2-enterprise, for APIs please refer to ESP8266 SDK API Guide.
- Added mqtt demos under examples directory.
- Other issue fixes.
- Resolved an issue that RF_Init_data sector may be broken in stress test. Provided a function user_rf_cal_sector_set which has to be added in application by software developer. More details about user_rf_cal_sector_set refer to documentation "2C-ESP8266__SDK__API Guide". (Resolved in ESP8266_NONOS_SDK_V1.5.4.1)
- Fix a potential risk that will cause rf not work after external reset. (Resolved in ESP8266_NONOS_SDK_V1.5.4.1)
- Add SDIO AT support. (Resolved in ESP8266_NONOS_SDK_V1.5.4.1) Fix a potential bug in espconn. (Resolved in ESP8266_NONOS_SDK_V1.5.4.1)
ESP8266_NONOS_SDK Notes:
- esp_init_data.bin has to be downloaded into flash at least once.
- Download blank.bin to initialize the sector stored RF_CAL parameter (set by user_rf_cal_sector_set), and download esp_init_data.bin into flash, when the system needs to be initialized, or RF needs to be calibrated again.
AT Notes:
- Since the release of ESP8266_NONOS_SDK_V1.5.0, AT firmware is too large to use 4Mbit flash. Please choose flash with at least 8Mbit capacity.
- Firmware upgrade over-the-air process is changed a bit. We will upgrade the latest AT firmware to Espressif Cloud server only after it has been tested and the overall performance is guaranteed. Users may not be able to use AT+CIUPDATE in ESP8266_NONOS_SDK_V1.5.0 and other more advanced versions.
Thank you for taking time to copy the release notes here 👍
WPA Enterprise is required for my use cases, so I was thinking to help a little bit more.
I am using Platformio and trying to compile my firmware with the new version of SDK (I just copied it into ~/.platformio/packages/framework-arduinoespressif/tools/sdk).
However, some of SDK files were modified to fix some of the compilation errors: https://github.com/esp8266/Arduino/blob/4c587e28bc188efc852039606cac641768323ee3/tools/sdk/include/ets_sys.h#L160 (these prototypes are not defined in the original SDK version).
@igrr, is there any checklist for those modifications? I will probably dive into git history, but any pointers would be useful.
After copying those prototypes, I'm failing with this:
In file included from .pioenvs/nodemcuv2/FrameworkArduino/pgmspace.h:12:0,
from .pioenvs/nodemcuv2/FrameworkArduino/Arduino.h:240,
from .pioenvs/nodemcuv2/FrameworkArduino/Esp.cpp:21:
/Users/alexander/.platformio/packages/framework-arduinoespressif/tools/sdk/include/ets_sys.h:130:31: error: 'int_handler_t' has not been declared
No there is no checklist for these changes, they have accumulated over time. The way i do this is by diff-ing new SDK directory against the old SDK directory, and then applying the changes from patch file semi-manually to the arduino/tools/sdk tree. Usually there are only a few changes in the header files.
Bigger issue which you are going to face is that now we need to reserve an extra sector for RF calibration data somewhere (see documentation for user_rf_cal_sector_set). This means that linker scripts need to be changed to reserve another sector at the end of the application, before the beginning of SPIFFS. This will lead to some changes to OTA update code, because right now it assumes that the end of the application region is the beginning of SPIFFS, which will be no longer true. So, extra symbol has to be added to linker script to point to the real end of the application region.
If you are just hacking this and not interested in using EEPROM, for example, you could add a call to user_rf_cal_sector_set and point it to the sector used by EEPROM.
Wrong button =) Thanks for the pointers. I hope I will get this running.
A bit of an update.
I was able to compile the firmware, but it can't boot. Output from serial is cycling through this:
ets Jan 8 2013,rst cause:4, boot mode:(3,7)
wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld
In short, here is what I've done:
-
Followed your advice and compared diffs between new SDK and the old. I think, I've applied all custom patches along the way.
-
Did this:
xtensa-lx106-elf-ar -d libmain.a time.o, since compiler wasn't happy about duplicated time functions. -
In
ldscriptsplatformio package I've editedesp8266.flash.command.ldand added new symbol (looks like it's the only new thing from SDK:PROVIDE ( Enable_QMode = 0x400044c0 );). I decided not to touch SPIFFS symbols for now. -
Copied the definition of
user_rf_cal_sector_setfrom the examples in the SDK. I've placed it inEsp.cppin the core. -
Stuck on this stuff:
(.text+0x1cc): undefined reference to `memchr' /Users/alexander/.platformio/packages/framework-arduinoespressif/tools/sdk/lib/liblwip.a(espconn_buf.o): In function `ringbuf_findchr':As a possible solution, replaced
liblwip.aandliblwip_gcc.afrom the new SDK with files from this repository (that actually worries me a bit). That allowed me to successfully compile the firmware, and load it on my ESP.
@igrr, do any of these issues remind you about something when you ported previous versions of SDK? I guess the next step would be to learn how to debug this stuff and get more information...
Did you also remove mem_manager.o from libmain.a as mentioned in tools/sdk/lib/README.md?
Regarding replacing lwip with old version, this may not be a good idea. Just find an implementation of memchr (it's just three lines) and dump it somewhere in a C file.
I've tried both with removing mem_manager.o and without it: same behaviour.
Ok, I'm going to review code changes done in 2.0.0 sdk libraries early next week.
Hell yes, I've got it to work!
So, indeed, I've tried to go with original liblwip.a and defined memchr in one of C files.
As a result - mem_manager warnings started to fire around. I've removed it from libmain.a and sample firmware works as intended (it just prints 'Hello' into serial).
If that's OK, I can wrap up PR and we can coordinate what to do next? There's a chance that some libs (like SPIFFS) aren't working.
Sure, feel free to post a PR. Flash layout still has to be fixed though, and rf config sector setting has to be moved into core_esp8266_main.c Also LwIP source files in tools/sdk/lwip have to be updated.
Regarding user_rf_cal_sector_set: Do we have to keep eeprom lib? I can't see any advantage over using SPIFFS apart from arduino compatibility...
Arduino compatibility is very important, so removing EEPROM is certainly not an option :)
Okay. Didn't know that
Awesome to see that Espressif improved SSL/TLS and included WPA-Enterprise. Hope SSL based on mbedTLS will work with a little smaller memory footprint this time around. Anyway, thanks so much for your efforts of getting this into the Arduino SDK. Awesome job guys! Seriously appreciated!
mbedTLS footprint is not smaller if you configure it to support 16k fragments used by most of the TLS servers, unfortunately. But at least we get TLS 1.2 support. This still has to be integrated into WiFiClientSecure.
TTLS is very critical for me. I guess also for some others. So it will only be available in 2.5.0? What will be the earliest date? An chance to get it form some RC branches?
Hi
I'm using the latest Arduino/ESP8266 - which I have to say - very good... but In converting my code - I note in my debug that this is still using 1.53 of the SDK - any idea when it will be upgraded to 2.0 and how we (I'm new to this) go about upgrading?
I'm not using the EEPROM as it has no backup in the event of power loss during update. I realised quickly that it is just as easy to use the Espressif functions which use 3 sectors to secure data in those circumstances. Really worth looking at for storing user info.
2.0???
Hello Alex and Ivan,
I'm trying to increase the sampling rate on the ESP's ADC and I noticed that on SDK 2.0.0 there is the function system_adc_read_fast and I'd like to use it to check how much can I increase the sampling rate; could you please tell me how can I upgrade the SDK on the arduino ESP core? I have v2.3.0 installed on my arduino IDE which is using SDK version 1.5.3.
I'll appreciate any help you can give me, I'd rather continue using the Arduino IDE than setting up a new development environment around the SDK 2.0.0.
Thanks in advance and regards.
@Beliwars you can try the experimental version based on SDK 2.0.0:
- uninstall ESP core using boards manager
- install git version of the core using the following instructions: https://github.com/esp8266/Arduino#using-git-version
- when doing git clone in these instructions, add
-b update_sdk_2.0.0parameter aftergit cloneto check out the branch with SDK 2.0.0
thanks @igrr,
I'll clone the git version and install with the sdk_2.0.0 option, I'll let you know how everything goes.
thanks again.
regards