Skip to content

Commit e7c5061

Browse files
authored
Merge branch 'master' into pr-hwdt-stack-dump
2 parents 96b6ddb + 5ac64ff commit e7c5061

File tree

244 files changed

+18041
-2481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+18041
-2481
lines changed

.github/workflows/pull-request.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
run: |
103103
# Windows has python3 already installed, but it's called "python".
104104
# Copy python.exe to the proper name so scripts "just work".
105-
copy (get-command python).source (get-command python).source.Replace("python.exe", "python3.exe")
105+
try { Get-Command python3 } catch { copy (get-command python).source (get-command python).source.Replace("python.exe", "python3.exe") }
106106
bash ./tests/build.sh
107107
108108
@@ -268,3 +268,4 @@ jobs:
268268
run: |
269269
bash ./tests/ci/build_boards.sh
270270
bash ./tests/ci/eboot_test.sh
271+
bash ./tests/ci/pkgrefs_test.sh

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
url = https://github.com/arduino-libraries/Ethernet.git
2525
[submodule "tools/sdk/uzlib"]
2626
path = tools/sdk/uzlib
27-
url = https://github.com/earlephilhower/uzlib.git
27+
url = https://github.com/pfalcon/uzlib.git

boards.txt

Lines changed: 366 additions & 144 deletions
Large diffs are not rendered by default.

bootloaders/eboot/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OBJDUMP := $(XTENSA_TOOLCHAIN)xtensa-lx106-elf-objdump
2121

2222
INC += -I../../tools/sdk/include -I../../tools/sdk/uzlib/src
2323

24-
CFLAGS += -std=gnu99
24+
CFLAGS += -std=gnu17
2525

2626
CFLAGS += -Os -fcommon -g -Wall -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals -ffunction-sections -fdata-sections -free -fipa-pta
2727

@@ -40,17 +40,17 @@ APP_FW := eboot.bin
4040

4141
all: $(APP_OUT)
4242

43-
tinflate.o: $(UZLIB_PATH)/tinflate.c $(UZLIB_PATH)/uzlib.h $(UZLIB_PATH)/uzlib_conf.h
43+
tinflate.o: $(UZLIB_PATH)/tinflate.c $(UZLIB_PATH)/uzlib.h $(UZLIB_PATH)/uzlib_conf.h Makefile
4444
$(CC) $(CFLAGS) -c -o tinflate.o $(UZLIB_PATH)/tinflate.c
4545

46-
tinfgzip.o: $(UZLIB_PATH)/tinfgzip.c $(UZLIB_PATH)/uzlib.h $(UZLIB_PATH)/uzlib_conf.h
46+
tinfgzip.o: $(UZLIB_PATH)/tinfgzip.c $(UZLIB_PATH)/uzlib.h $(UZLIB_PATH)/uzlib_conf.h Makefile
4747
$(CC) $(CFLAGS) -c -o tinfgzip.o $(UZLIB_PATH)/tinfgzip.c
4848

49-
$(APP_AR): $(TARGET_OBJ_PATHS) tinflate.o tinfgzip.o
49+
$(APP_AR): $(TARGET_OBJ_PATHS) tinflate.o tinfgzip.o Makefile
5050
$(AR) cru $@ $^
5151

5252
$(APP_OUT): $(APP_AR) eboot.ld | Makefile
53-
$(LD) $(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group -Wl,--whole-archive $(APP_AR) -Wl,--end-group -o $@
53+
$(LD) $(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group -Wl,--sort-common $(APP_AR) -Wl,--end-group -o $@
5454

5555
clean:
5656
rm -f *.o

bootloaders/eboot/eboot.c

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,19 @@
1414
#include "eboot_command.h"
1515
#include <uzlib.h>
1616

17-
extern unsigned char _gzip_dict;
1817

1918
#define SWRST do { (*((volatile uint32_t*) 0x60000700)) |= 0x80000000; } while(0);
2019

2120
extern void ets_wdt_enable(void);
2221
extern void ets_wdt_disable(void);
2322

24-
// Converts bit of a string into a uint32
25-
#define S(a,b,c,d) ( (((uint32_t)a) & 0xff) | (((uint32_t)b) << 8) | (((uint32_t)c) << 16) | (((uint32_t)d)<<24) )
26-
2723
int print_version(const uint32_t flash_addr)
2824
{
2925
uint32_t ver;
3026
if (SPIRead(flash_addr + APP_START_OFFSET + sizeof(image_header_t) + sizeof(section_header_t), &ver, sizeof(ver))) {
3127
return 1;
3228
}
33-
// We don't have BSS and can't print from flash, so build up string
34-
// 4 chars at a time. Smaller code than byte-wise assignment.
35-
uint32_t fmt[2];
36-
fmt[0] = S('v', '%', '0', '8');
37-
fmt[1] = S('x', '\n', 0, 0);
38-
ets_printf((const char*) fmt, ver);
29+
ets_printf("v%08x\n", ver);
3930
return 0;
4031
}
4132

@@ -222,6 +213,16 @@ int main()
222213
bool clear_cmd = false;
223214
struct eboot_command cmd;
224215

216+
// BSS init commented out for now to save space. If any static variables set
217+
// to 0 are used, need to uncomment it or else the BSS will not be cleared and
218+
// the static vars will power on with random values.
219+
#if 0
220+
// Clear BSS ourselves, we don't have handy C runtime
221+
extern char _bss_start;
222+
extern char _bss_end;
223+
ets_bzero(&_bss_start, &_bss_end - &_bss_start);
224+
#endif
225+
225226
print_version(0);
226227

227228
if (eboot_command_read(&cmd) == 0) {
@@ -236,32 +237,26 @@ int main()
236237
}
237238

238239
if (cmd.action == ACTION_COPY_RAW) {
239-
uint32_t cp = S('c', 'p', ':', 0);
240-
ets_printf((const char *)&cp);
240+
ets_printf("cp:");
241241

242242
ets_wdt_disable();
243243
res = copy_raw(cmd.args[0], cmd.args[1], cmd.args[2], false);
244244
ets_wdt_enable();
245245

246-
cp = S('0' + res, '\n', 0, 0 );
247-
ets_printf((const char *)&cp);
246+
ets_printf("%d\n", res);
248247
#if 0
249248
//devyte: this verify step below (cmp:) only works when the end of copy operation above does not overwrite the
250249
//beginning of the image in the empty area, see #7458. Disabling for now.
251250
//TODO: replace the below verify with hash type, crc, or similar.
252251
// Verify the copy
253-
uint32_t v[2];
254-
v[0] = S('c', 'm', 'p', ':');
255-
v[1] = 0;
256-
ets_printf(const char *)v);
252+
ets_printf("cmp:");
257253
if (res == 0) {
258254
ets_wdt_disable();
259255
res = copy_raw(cmd.args[0], cmd.args[1], cmd.args[2], true);
260256
ets_wdt_enable();
261257
}
262258

263-
cp = S('0' + res, '\n', 0, 0 );
264-
ets_printf((const char *)&cp);
259+
ets_printf("%d\n", res);
265260
#endif
266261
if (res == 0) {
267262
cmd.action = ACTION_LOAD_APP;
@@ -274,13 +269,10 @@ int main()
274269
}
275270

276271
if (cmd.action == ACTION_LOAD_APP) {
277-
ets_putc('l'); ets_putc('d'); ets_putc('\n');
272+
ets_printf("ld\n");
278273
res = load_app_from_flash_raw(cmd.args[0]);
279274
// We will get to this only on load fail
280-
uint32_t e[2];
281-
e[0] = S('e', ':', '0' + res, '\n' );
282-
e[1] = 0;
283-
ets_printf((const char*)e);
275+
ets_printf("e:%d\n", res);
284276
}
285277

286278
if (res) {

bootloaders/eboot/eboot.elf

43 KB
Binary file not shown.

bootloaders/eboot/eboot.ld

Lines changed: 24 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -42,53 +42,13 @@ PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wb_trapnull);
4242
SECTIONS
4343
{
4444

45-
.dport0.rodata : ALIGN(4)
46-
{
47-
_dport0_rodata_start = ABSOLUTE(.);
48-
*(.dport0.rodata)
49-
*(.dport.rodata)
50-
_dport0_rodata_end = ABSOLUTE(.);
51-
} >dport0_0_seg :dport0_0_phdr
52-
53-
.dport0.literal : ALIGN(4)
54-
{
55-
_dport0_literal_start = ABSOLUTE(.);
56-
*(.dport0.literal)
57-
*(.dport.literal)
58-
_dport0_literal_end = ABSOLUTE(.);
59-
} >dport0_0_seg :dport0_0_phdr
60-
61-
.dport0.data : ALIGN(4)
62-
{
63-
_dport0_data_start = ABSOLUTE(.);
64-
*(.dport0.data)
65-
*(.dport.data)
66-
_dport0_data_end = ABSOLUTE(.);
67-
} >dport0_0_seg :dport0_0_phdr
68-
69-
.data : ALIGN(4)
45+
.globals : ALIGN(4)
7046
{
7147
*(COMMON) /* Global vars */
72-
. = ALIGN(4);
73-
_heap_start = ABSOLUTE(.);
74-
/* _stack_sentry = ALIGN(0x8); */
7548
} >dram0_0_seg :dram0_0_bss_phdr
76-
/* __stack = 0x3ffc8000; */
7749

78-
.text : ALIGN(4)
50+
.data : ALIGN(4)
7951
{
80-
_stext = .;
81-
_text_start = ABSOLUTE(.);
82-
*(.entry.text)
83-
*(.init.literal)
84-
*(.init)
85-
*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
86-
*(.fini.literal)
87-
*(.fini)
88-
*(.gnu.version)
89-
_text_end = ABSOLUTE(.);
90-
_etext = .;
91-
. = ALIGN (8);
9252
_data_start = ABSOLUTE(.);
9353
*(.data)
9454
*(.data.*)
@@ -102,7 +62,10 @@ SECTIONS
10262
*(.gnu.linkonce.s2.*)
10363
*(.jcr)
10464
_data_end = ABSOLUTE(.);
105-
. = ALIGN (8);
65+
} >dram0_0_seg :dram0_0_bss_phdr
66+
67+
.rodata : ALIGN(4)
68+
{
10669
_rodata_start = ABSOLUTE(.);
10770
*(.rodata)
10871
*(.rodata.*)
@@ -131,14 +94,11 @@ SECTIONS
13194
*(.xt_except_desc_end)
13295
*(.dynamic)
13396
*(.gnu.version_d)
134-
. = ALIGN(4); /* this table MUST be 4-byte aligned */
135-
_bss_table_start = ABSOLUTE(.);
136-
LONG(_bss_start)
137-
LONG(_bss_end)
138-
_bss_table_end = ABSOLUTE(.);
13997
_rodata_end = ABSOLUTE(.);
98+
} >dram0_0_seg :dram0_0_bss_phdr
14099

141-
. = ALIGN (8);
100+
.bss : ALIGN(4)
101+
{
142102
_bss_start = ABSOLUTE(.);
143103
*(.dynsbss)
144104
*(.sbss)
@@ -152,26 +112,24 @@ SECTIONS
152112
*(.bss)
153113
*(.bss.*)
154114
*(.gnu.linkonce.b.*)
155-
. = ALIGN (8);
156115
_bss_end = ABSOLUTE(.);
157-
_free_space = 4096 - 17 - (. - _stext);
158-
/*
159-
The boot loader checksum must be before the CRC, which is written by elf2bin.py.
160-
This leaves 16 bytes after the checksum for the CRC placed at the end of the
161-
4096-byte sector. */
162-
_cs_here = (ALIGN((. + 1), 16) == ALIGN(16)) ? (ALIGN(16) - 1) : (. + 0x0F);
116+
} >dram0_0_seg :dram0_0_bss_phdr
163117

164-
/*
165-
The filling (padding) and values for _crc_size and _crc_val are handled by
166-
elf2bin.py. With this, we give values to the symbols without explicitly
167-
assigning space. This avoids the linkers back *fill* operation that causes
168-
trouble.
169118

170-
The CRC info is stored in last 8 bytes. */
171-
_crc_size = _stext + 4096 - 8;
172-
_crc_val = _stext + 4096 - 4;
173-
ASSERT((4096 > (17 + (. - _stext))), "Error: No space for CS and CRC in bootloader sector.");
174-
ASSERT((_crc_size > _cs_here), "Error: CRC must be located after CS.");
119+
.text : ALIGN(4)
120+
{
121+
_stext = .;
122+
_text_start = ABSOLUTE(.);
123+
*(.entry.text)
124+
*(.init.literal)
125+
*(.init)
126+
*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
127+
*(.fini.literal)
128+
*(.fini)
129+
*(.gnu.version)
130+
_text_end = ABSOLUTE(.);
131+
_etext = .;
132+
. = ALIGN (4); /* Ensure 32b alignment since this is written to IRAM */
175133
} >iram1_0_seg :iram1_0_phdr
176134

177135
.lit4 : ALIGN(4)

cores/esp8266/Arduino.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ int digitalRead(uint8_t pin);
171171
int analogRead(uint8_t pin);
172172
void analogReference(uint8_t mode);
173173
void analogWrite(uint8_t pin, int val);
174+
void analogWriteMode(uint8_t pin, int val, bool openDrain);
174175
void analogWriteFreq(uint32_t freq);
175176
void analogWriteResolution(int res);
176177
void analogWriteRange(uint32_t range);

cores/esp8266/Client.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
class Client: public Stream {
2727

2828
public:
29-
virtual int connect(IPAddress ip, uint16_t port) =0;
30-
virtual int connect(const char *host, uint16_t port) =0;
31-
virtual size_t write(uint8_t) =0;
32-
virtual size_t write(const uint8_t *buf, size_t size) =0;
33-
virtual int available() = 0;
34-
virtual int read() = 0;
35-
virtual int read(uint8_t *buf, size_t size) = 0;
36-
virtual int peek() = 0;
37-
virtual void flush() = 0;
29+
virtual int connect(IPAddress ip, uint16_t port) = 0;
30+
virtual int connect(const char *host, uint16_t port) = 0;
31+
virtual size_t write(uint8_t) override = 0;
32+
virtual size_t write(const uint8_t *buf, size_t size) override = 0;
33+
virtual int available() override = 0;
34+
virtual int read() override = 0;
35+
virtual int read(uint8_t *buf, size_t size) override = 0;
36+
virtual int peek() override = 0;
37+
virtual void flush() override = 0;
3838
virtual void stop() = 0;
3939
virtual uint8_t connected() = 0;
4040
virtual operator bool() = 0;

0 commit comments

Comments
 (0)