Skip to content

Commit 916d835

Browse files
committed
Merge branch 'release/v3.4' into dwss_support
2 parents 6cc6d30 + fec8e98 commit 916d835

File tree

12 files changed

+755
-2
lines changed

12 files changed

+755
-2
lines changed

components/esp8266/lib/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
gwen:
22
core: db51cd0
3-
net80211: 4357636
3+
net80211: 58ed843
44
pp: 44c6f29
55
espnow: db51cd0
66

components/esp8266/lib/libnet80211.a

-1.03 KB
Binary file not shown.
5.85 KB
Binary file not shown.

components/esp8266/source/startup.c

+4
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ static void user_init_entry(void *param)
9393
esp_set_cpu_freq(ESP_CPU_FREQ_160M);
9494
#endif
9595

96+
#ifdef CONFIG_ENABLE_TH25Q16HB_PATCH_0
97+
assert(th25q16hb_apply_patch_0() == 0);
98+
#endif
99+
96100
app_main();
97101

98102
vTaskDelete(NULL);

components/esp_http_server/src/httpd_main.c

+10
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,16 @@ static esp_err_t httpd_server_init(struct httpd_data *hd)
262262
.sin_port = htons(hd->config.server_port)
263263
};
264264
#endif /* CONFIG_LWIP_IPV6 */
265+
266+
/* Enable SO_REUSEADDR to allow binding to the same
267+
* address and port when restarting the server */
268+
int enable = 1;
269+
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable)) < 0) {
270+
/* This will fail if CONFIG_LWIP_SO_REUSE is not enabled. But
271+
* it does not affect the normal working of the HTTP Server */
272+
ESP_LOGW(TAG, LOG_FMT("error in setsockopt SO_REUSEADDR (%d)"), errno);
273+
}
274+
265275
int ret = bind(fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr));
266276
if (ret < 0) {
267277
ESP_LOGE(TAG, LOG_FMT("error in bind (%d)"), errno);

components/spi_flash/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ if(BOOTLOADER_BUILD)
55
set(srcs "${srcs}" "port/port.c")
66
set(priv_requires "bootloader_support")
77
else()
8+
if(CONFIG_ENABLE_TH25Q16HB_PATCH_0)
9+
list(APPEND srcs "src/patch/th25q16hb.c")
10+
endif()
11+
812
set(priv_requires "esp8266" "freertos" "bootloader_support")
913
endif()
1014

components/spi_flash/Kconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
menu "SPI Flash"
2+
3+
menu "Patch"
4+
config ENABLE_TH25Q16HB_PATCH_0
5+
bool "Enable TH25Q16HB Patch 0"
6+
default n
7+
help
8+
WARNING: If you don't use TH25Q16HB, you must not enable this option.
9+
Although you use TH25Q16HB, you should ask your flash manufacturer
10+
if your flash need use this patch.
11+
endmenu
12+
endmenu

components/spi_flash/component.mk

+4
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ CFLAGS += -DPARTITION_QUEUE_HEADER=\"sys/queue.h\"
1515
ifdef IS_BOOTLOADER_BUILD
1616
COMPONENT_SRCDIRS += port
1717
COMPONENT_OBJS += port/port.o
18+
else
19+
ifdef CONFIG_ENABLE_TH25Q16HB_PATCH_0
20+
COMPONENT_SRCDIRS += src/patch
21+
endif
1822
endif

components/spi_flash/include/spi_flash.h

+9
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,15 @@ int esp_patition_table_init_data(void *partition_info);
204204
int esp_patition_copy_ota1_to_ota0(const void *partition_info);
205205
#endif
206206

207+
#ifdef CONFIG_ENABLE_TH25Q16HB_PATCH_0
208+
/**
209+
* @brief Apply TH25Q16HB patch 0 to avoid some hardware issues.
210+
*
211+
* @return 0 if success or others if failed
212+
*/
213+
int th25q16hb_apply_patch_0(void);
214+
#endif
215+
207216
#ifdef __cplusplus
208217
}
209218
#endif

components/spi_flash/linker.lf

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
archive: libspi_flash.a
33
entries:
44
spi_flash_raw (noflash)
5+
th25q16hb (noflash)

0 commit comments

Comments
 (0)