Skip to content

Commit 471eb28

Browse files
authored
Merge pull request #1528 from espruino/ESP8266_SDK_2.2.1
ESP8266: switch to SDK 2.2.1 (fix #1207)
2 parents 81fc13f + a226f7b commit 471eb28

6 files changed

+89
-65
lines changed

ChangeLog

+2-1
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@
107107
Ensure that setBusyIndicator updates output state after the very first initialisation.
108108
MDBT42Q: Add LED2 var in the Espruino interpreter, but don't use it for the bootloader
109109
ESP8266: release heap used by logDebug(true) (fix #1508)
110-
ESP8266: remove SHA256 SHA512 (fix #1517)
110+
ESP8266: remove SHA256 SHA512 (fix #1517)
111111
Ensure `Date.getTimezoneOffset()` returns the correct timezone offset (fix #1515)
112112
Search for and execute files '.boot0'/1/2/3 in Storage at boot time if they exist
113113
Pixl.js: reduce saved code area to 9 x 4kb to allow for extra features
114+
ESP8266: switch to SDK 2.2.1 (fix #1207)
114115
Fix Serial port path regression on Linux, and add docs
115116

116117
1v99 : Increase jslMatch error buffer size to handle "UNFINISHED TEMPLATE LITERAL" string (#1426)

scripts/provision.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,21 @@ if [ "$FAMILY" = "ESP32" ]; then
6161
return 0
6262
elif [ "$FAMILY" = "ESP8266" ]; then
6363
echo ESP8266
64-
if [ ! -d "esp_iot_sdk_v2.0.0.p1" ]; then
65-
echo esp_iot_sdk_v2.0.0.p1
66-
curl -Ls http://s3.voneicken.com/esp_iot_sdk_v2.0.0.p1.tgx | tar Jxf - --no-same-owner
64+
if [ ! -d "ESP8266_NONOS_SDK-2.2.1" ]; then
65+
echo ESP8266_NONOS_SDK-2.2.1
66+
curl -Ls https://github.com/espruino/EspruinoBuildTools/raw/master/esp8266/ESP8266_NONOS_SDK-2.2.1.tar.gz | tar xfz - --no-same-owner
6767
fi
6868
if ! type xtensa-lx106-elf-gcc 2> /dev/null > /dev/null; then
6969
echo installing xtensa-lx106-elf-gcc
7070
if [ ! -d "xtensa-lx106-elf" ]; then
71-
curl -Ls http://s3.voneicken.com/xtensa-lx106-elf-20160330.tgx | tar Jxf - --no-same-owner
71+
curl -Ls https://github.com/espruino/EspruinoBuildTools/raw/master/esp8266/xtensa-lx106-elf-20160330.tgx | tar Jxf - --no-same-owner
7272
else
7373
echo "Folder found"
7474
fi
7575

7676
fi
7777
which xtensa-lx106-elf-gcc
78-
export ESP8266_SDK_ROOT=`pwd`/esp_iot_sdk_v2.0.0.p1
78+
export ESP8266_SDK_ROOT=`pwd`/ESP8266_NONOS_SDK-2.2.1
7979
export PATH=$PATH:`pwd`/xtensa-lx106-elf/bin/
8080
return 0
8181
elif [ "$FAMILY" = "LINUX" ]; then

targets/esp8266/eagle.app.v6.new.1024.app1.ld

+26-6
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,31 @@ SECTIONS
151151
} >dram0_0_seg :dram0_0_bss_phdr
152152
/* __stack = 0x3ffc8000; */
153153

154+
.irom0.text : ALIGN(4)
155+
{
156+
_irom0_text_start = ABSOLUTE(.);
157+
158+
*libat.a:(.literal.* .text.*)
159+
*libcrypto.a:(.literal.* .text.*)
160+
*libespnow.a:(.literal.* .text.*)
161+
*libjson.a:(.literal.* .text.*)
162+
*liblwip.a:(.literal.* .text.*)
163+
*libnet80211.a:(.literal.* .text.*)
164+
*libsmartconfig.a:(.literal.* .text.*)
165+
*libssl.a:(.literal.* .text.*)
166+
*libupgrade.a:(.literal.* .text.*)
167+
*libwpa.a:(.literal.* .text.*)
168+
*libwpa2.a:(.literal.* .text.*)
169+
*libwps.a:(.literal.* .text.*)
170+
171+
*libmbedtls.a:(.literal.* .text.*)
172+
173+
*libm.a:(.literal .text .literal.* .text.*)
174+
175+
*(.irom0.literal .irom.literal .irom.literal2 .irom.text.literal .irom0.text .irom.text)
176+
_irom0_text_end = ABSOLUTE(.);
177+
} >irom0_0_seg :irom0_0_phdr
178+
154179
.text : ALIGN(4)
155180
{
156181
_stext = .;
@@ -199,12 +224,7 @@ SECTIONS
199224
_lit4_end = ABSOLUTE(.);
200225
} >iram1_0_seg :iram1_0_phdr
201226

202-
.irom0.text : ALIGN(4)
203-
{
204-
_irom0_text_start = ABSOLUTE(.);
205-
*(.irom0.literal .irom.literal .irom.literal2 .irom.text.literal .irom0.text .irom.text)
206-
_irom0_text_end = ABSOLUTE(.);
207-
} >irom0_0_seg :irom0_0_phdr
227+
208228
}
209229

210230
/* get ROM code address */

targets/esp8266/eagle.app.v6.new.1024.app2.ld

+29-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ MEMORY
55
dport0_0_seg : org = 0x3FF00000, len = 0x10
66
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
77
iram1_0_seg : org = 0x40100000, len = 0x8000
8-
irom0_0_seg : org = 0x40281010, len = 0x7C000
8+
irom0_0_seg : org = 0x40201010, len = 0x7C000
99
}
1010

1111
PHDRS
@@ -119,7 +119,7 @@ SECTIONS
119119
*(.xt_except_desc_end)
120120
*(.dynamic)
121121
*(.gnu.version_d)
122-
. = ALIGN(4); /* this table MUST be 4-byte aligned */
122+
. = ALIGN(4); /* this table MUST be 4-byte aligned */
123123
_bss_table_start = ABSOLUTE(.);
124124
LONG(_bss_start)
125125
LONG(_bss_end)
@@ -151,6 +151,31 @@ SECTIONS
151151
} >dram0_0_seg :dram0_0_bss_phdr
152152
/* __stack = 0x3ffc8000; */
153153

154+
.irom0.text : ALIGN(4)
155+
{
156+
_irom0_text_start = ABSOLUTE(.);
157+
158+
*libat.a:(.literal.* .text.*)
159+
*libcrypto.a:(.literal.* .text.*)
160+
*libespnow.a:(.literal.* .text.*)
161+
*libjson.a:(.literal.* .text.*)
162+
*liblwip.a:(.literal.* .text.*)
163+
*libnet80211.a:(.literal.* .text.*)
164+
*libsmartconfig.a:(.literal.* .text.*)
165+
*libssl.a:(.literal.* .text.*)
166+
*libupgrade.a:(.literal.* .text.*)
167+
*libwpa.a:(.literal.* .text.*)
168+
*libwpa2.a:(.literal.* .text.*)
169+
*libwps.a:(.literal.* .text.*)
170+
171+
*libmbedtls.a:(.literal.* .text.*)
172+
173+
*libm.a:(.literal .text .literal.* .text.*)
174+
175+
*(.irom0.literal .irom.literal .irom.literal2 .irom.text.literal .irom0.text .irom.text)
176+
_irom0_text_end = ABSOLUTE(.);
177+
} >irom0_0_seg :irom0_0_phdr
178+
154179
.text : ALIGN(4)
155180
{
156181
_stext = .;
@@ -199,12 +224,8 @@ SECTIONS
199224
_lit4_end = ABSOLUTE(.);
200225
} >iram1_0_seg :iram1_0_phdr
201226

202-
.irom0.text : ALIGN(4)
203-
{
204-
_irom0_text_start = ABSOLUTE(.);
205-
*(.irom0.literal .irom.literal .irom.literal2 .irom.text.literal .irom0.text .irom.text)
206-
_irom0_text_end = ABSOLUTE(.);
207-
} >irom0_0_seg :irom0_0_phdr
227+
228+
208229
}
209230

210231
/* get ROM code address */

targets/esp8266/eagle.app.v6.new.2048.ld

+27-8
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ SECTIONS
119119
*(.xt_except_desc_end)
120120
*(.dynamic)
121121
*(.gnu.version_d)
122-
. = ALIGN(4); /* this table MUST be 4-byte aligned */
122+
. = ALIGN(4); /* this table MUST be 4-byte aligned */
123123
_bss_table_start = ABSOLUTE(.);
124124
LONG(_bss_start)
125125
LONG(_bss_end)
@@ -151,6 +151,31 @@ SECTIONS
151151
} >dram0_0_seg :dram0_0_bss_phdr
152152
/* __stack = 0x3ffc8000; */
153153

154+
.irom0.text : ALIGN(4)
155+
{
156+
_irom0_text_start = ABSOLUTE(.);
157+
158+
*libat.a:(.literal.* .text.*)
159+
*libcrypto.a:(.literal.* .text.*)
160+
*libespnow.a:(.literal.* .text.*)
161+
*libjson.a:(.literal.* .text.*)
162+
*liblwip.a:(.literal.* .text.*)
163+
*libnet80211.a:(.literal.* .text.*)
164+
*libsmartconfig.a:(.literal.* .text.*)
165+
*libssl.a:(.literal.* .text.*)
166+
*libupgrade.a:(.literal.* .text.*)
167+
*libwpa.a:(.literal.* .text.*)
168+
*libwpa2.a:(.literal.* .text.*)
169+
*libwps.a:(.literal.* .text.*)
170+
171+
*libmbedtls.a:(.literal.* .text.*)
172+
173+
*libm.a:(.literal .text .literal.* .text.*)
174+
175+
*(.irom0.literal .irom.literal .irom.literal2 .irom.text.literal .irom0.text .irom.text)
176+
_irom0_text_end = ABSOLUTE(.);
177+
} >irom0_0_seg :irom0_0_phdr
178+
154179
.text : ALIGN(4)
155180
{
156181
_stext = .;
@@ -199,14 +224,8 @@ SECTIONS
199224
_lit4_end = ABSOLUTE(.);
200225
} >iram1_0_seg :iram1_0_phdr
201226

202-
.irom0.text : ALIGN(4)
203-
{
204-
_irom0_text_start = ABSOLUTE(.);
205-
*(.irom0.literal .irom.literal .irom.literal2 .irom.text.literal .irom0.text .irom.text)
206-
_irom0_text_end = ABSOLUTE(.);
207-
} >irom0_0_seg :irom0_0_phdr
208-
209227
}
210228

211229
/* get ROM code address */
212230
INCLUDE "../ld/eagle.rom.addr.v6.ld"
231+

targets/esp8266/espmissingincludes.h

-37
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ char *wifi_station_get_hostname(void);
3232

3333
int atoi(const char *nptr);
3434

35-
void ets_install_putc1(void *routine); // necessary for #define os_xxx -> ets_xxx
36-
void ets_isr_attach(int intr, void *handler, void *arg);
3735
void ets_isr_mask(unsigned intr);
3836
void ets_isr_unmask(unsigned intr);
3937
void ets_intr_lock(void);
@@ -48,12 +46,9 @@ int ets_sprintf(char *str, const char *format, ...) __attribute__ ((format (pri
4846
int ets_str2macaddr(void *, void *);
4947
int ets_strcmp(const char *s1, const char *s2);
5048
char *ets_strcpy(char *dest, const char *src);
51-
size_t ets_strlen(const char *s);
52-
int ets_strncmp(const char *s1, const char *s2, int len);
5349
char *ets_strncpy(char *dest, const char *src, size_t n);
5450
char *ets_strstr(const char *haystack, const char *needle);
5551

56-
void ets_timer_arm_new(ETSTimer *a, int b, int c, int isMstimer);
5752
void ets_timer_disarm(ETSTimer *a);
5853
void ets_timer_setfn(ETSTimer *t, ETSTimerFunc *fn, void *parg);
5954

@@ -62,36 +57,12 @@ void ets_update_cpu_frequency(int freqmhz);
6257
int os_snprintf(char *str, size_t size, const char *format, ...) __attribute__((format(printf, 3, 4)));
6358
int os_printf_plus(const char *format, ...) __attribute__((format(printf, 1, 2)));
6459

65-
// memory allocation functions are "different" due to memory debugging functionality
66-
// added in SDK 1.4.0
67-
#ifndef ESPSDK_1_3_0
68-
void vPortFree(void *ptr, char * file, int line);
69-
void *pvPortMalloc(size_t xWantedSize, char * file, int line);
70-
void *pvPortZalloc(size_t, char * file, int line);
7160
void *vPortMalloc(size_t xWantedSize);
7261
void pvPortFree(void *ptr);
73-
void *pvPortRealloc(void *pv, size_t size, char * file, int line);
74-
#else
75-
void vPortFree(void *ptr);
76-
void *pvPortMalloc(size_t xWantedSize);
77-
void *pvPortZalloc(size_t);
78-
void *vPortMalloc(size_t xWantedSize);
79-
void pvPortFree(void *ptr);
80-
void *pvPortRealloc(void *pv, size_t size);
81-
#define os_realloc pvPortRealloc
82-
void *pvPortRealloc(void* ptr, size_t size);
83-
#endif
8462

85-
void uart_div_modify(int no, unsigned int freq);
8663
uint32 system_get_time();
8764
int rand(void);
8865
void ets_bzero(void *s, size_t n);
89-
void ets_delay_us(int ms);
90-
91-
// disappeared in SDK 1.1.0:
92-
#define os_timer_done ets_timer_done
93-
#define os_timer_handler_isr ets_timer_handler_isr
94-
#define os_timer_init ets_timer_init
9566

9667
// This is not missing in SDK 1.1.0 but causes a parens error
9768
#undef PIN_FUNC_SELECT
@@ -101,12 +72,4 @@ void ets_delay_us(int ms);
10172
|( (((FUNC&BIT2)<<2)|(FUNC&0x3))<<PERIPHS_IO_MUX_FUNC_S) ); \
10273
} while (0)
10374

104-
105-
// Shortcuts for memory functions
106-
//#define os_malloc pvPortMalloc // defined in SDK 1.4.0 onwards
107-
//#define os_free vPortFree // defined in SDK 1.4.0 onwards
108-
//#define os_zalloc pvPortZalloc // defined in SDK 1.4.0 onwards
109-
//uint8 wifi_get_opmode(void); // defined in SDK 1.0.0 onwards
110-
//int os_random(); // defined in SDK 1.1.0 onwards
111-
11275
#endif

0 commit comments

Comments
 (0)