mirror of
https://github.com/espressif/esp-idf.git
synced 2026-06-11 19:52:34 +02:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f8f618df5 | |||
| aeeb6cff17 | |||
| 19b7158a9a | |||
| ff6a3b1a11 | |||
| 9716447fcc | |||
| f9abf98f46 | |||
| e033b018d4 | |||
| 5aa5b820f9 | |||
| 17747b3358 | |||
| c26baeb610 | |||
| a7ef510551 | |||
| ee5eba793f | |||
| ab9f63aba7 | |||
| 6da84eff76 | |||
| 7c6208c9e0 | |||
| 0c301206cf | |||
| 8f4fc209a1 | |||
| 1c6510ed96 | |||
| 8aa09aea10 | |||
| 1ea0ddb025 |
@@ -926,6 +926,11 @@ void l2cu_send_peer_disc_rsp (tL2C_LCB *p_lcb, UINT8 remote_id, UINT16 local_cid
|
||||
BT_HDR *p_buf;
|
||||
UINT8 *p;
|
||||
|
||||
if (!p_lcb) {
|
||||
L2CAP_TRACE_WARNING("lcb already released\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if ((p_buf = l2cu_build_header(p_lcb, L2CAP_DISC_RSP_LEN, L2CAP_CMD_DISC_RSP, remote_id)) == NULL) {
|
||||
L2CAP_TRACE_WARNING ("L2CAP - no buffer for disc_rsp");
|
||||
return;
|
||||
@@ -1606,7 +1611,9 @@ void l2cu_release_ccb (tL2C_CCB *p_ccb)
|
||||
p_ccb->should_free_rcb = false;
|
||||
}
|
||||
|
||||
btm_sec_clr_temp_auth_service (p_lcb->remote_bd_addr);
|
||||
if (p_lcb) {
|
||||
btm_sec_clr_temp_auth_service (p_lcb->remote_bd_addr);
|
||||
}
|
||||
|
||||
/* Stop the timer */
|
||||
btu_stop_timer (&p_ccb->timer_entry);
|
||||
|
||||
@@ -164,6 +164,11 @@ static esp_err_t gpio_output_disable(gpio_num_t gpio_num)
|
||||
} else {
|
||||
GPIO.enable1_w1tc.data = (0x1 << (gpio_num - 32));
|
||||
}
|
||||
|
||||
// Ensure no other output signal is routed via GPIO matrix to this pin
|
||||
REG_WRITE(GPIO_FUNC0_OUT_SEL_CFG_REG + (gpio_num * 4),
|
||||
SIG_GPIO_OUT_IDX);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -175,6 +180,7 @@ static esp_err_t gpio_output_enable(gpio_num_t gpio_num)
|
||||
} else {
|
||||
GPIO.enable1_w1ts.data = (0x1 << (gpio_num - 32));
|
||||
}
|
||||
gpio_matrix_out(gpio_num, SIG_GPIO_OUT_IDX, false, false);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -250,17 +256,9 @@ esp_err_t gpio_set_direction(gpio_num_t gpio_num, gpio_mode_t mode)
|
||||
PIN_INPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||
}
|
||||
if (mode & GPIO_MODE_DEF_OUTPUT) {
|
||||
if (gpio_num < 32) {
|
||||
GPIO.enable_w1ts = (0x1 << gpio_num);
|
||||
} else {
|
||||
GPIO.enable1_w1ts.data = (0x1 << (gpio_num - 32));
|
||||
}
|
||||
gpio_output_enable(gpio_num);
|
||||
} else {
|
||||
if (gpio_num < 32) {
|
||||
GPIO.enable_w1tc = (0x1 << gpio_num);
|
||||
} else {
|
||||
GPIO.enable1_w1tc.data = (0x1 << (gpio_num - 32));
|
||||
}
|
||||
gpio_output_disable(gpio_num);
|
||||
}
|
||||
if (mode & GPIO_MODE_DEF_OD) {
|
||||
GPIO.pin[gpio_num].pad_driver = 1;
|
||||
@@ -311,7 +309,6 @@ esp_err_t gpio_config(const gpio_config_t *pGPIOConfig)
|
||||
}
|
||||
if ((pGPIOConfig->mode) & GPIO_MODE_DEF_OUTPUT) {
|
||||
output_en = 1;
|
||||
gpio_matrix_out(io_num, SIG_GPIO_OUT_IDX, 0, 0);
|
||||
gpio_output_enable(io_num);
|
||||
} else {
|
||||
gpio_output_disable(io_num);
|
||||
|
||||
@@ -345,6 +345,19 @@ static esp_err_t esp_system_event_debug(system_event_t *event)
|
||||
MAC2STR(ap_probereqrecved->mac));
|
||||
break;
|
||||
}
|
||||
case SYSTEM_EVENT_AP_STA_GOT_IP6: {
|
||||
ip6_addr_t *addr = &event->event_info.got_ip6.ip6_info.ip;
|
||||
ESP_LOGD(TAG, "SYSTEM_EVENT_AP_STA_GOT_IP6 address %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x",
|
||||
IP6_ADDR_BLOCK1(addr),
|
||||
IP6_ADDR_BLOCK2(addr),
|
||||
IP6_ADDR_BLOCK3(addr),
|
||||
IP6_ADDR_BLOCK4(addr),
|
||||
IP6_ADDR_BLOCK5(addr),
|
||||
IP6_ADDR_BLOCK6(addr),
|
||||
IP6_ADDR_BLOCK7(addr),
|
||||
IP6_ADDR_BLOCK8(addr));
|
||||
break;
|
||||
}
|
||||
case SYSTEM_EVENT_ETH_START: {
|
||||
ESP_LOGD(TAG, "SYSTEM_EVENT_ETH_START");
|
||||
break;
|
||||
@@ -367,7 +380,7 @@ static esp_err_t esp_system_event_debug(system_event_t *event)
|
||||
}
|
||||
|
||||
default: {
|
||||
ESP_LOGW(TAG, "no such kind of event!");
|
||||
ESP_LOGW(TAG, "unexpected system event %d!", event->event_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
Submodule components/esp32/lib updated: 8b7f0dfcfb...fcdc5ccdfa
@@ -0,0 +1,93 @@
|
||||
|
||||
#include <esp_types.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/semphr.h"
|
||||
|
||||
#include "unity.h"
|
||||
|
||||
#include "soc/uart_reg.h"
|
||||
#include "soc/dport_reg.h"
|
||||
|
||||
static volatile bool exit_flag;
|
||||
static bool dport_test_result;
|
||||
static bool apb_test_result;
|
||||
|
||||
static void accessDPORT(void *pvParameters)
|
||||
{
|
||||
xSemaphoreHandle *sema = (xSemaphoreHandle *) pvParameters;
|
||||
uint32_t dport_date = DPORT_REG_READ(DPORT_DATE_REG);
|
||||
|
||||
dport_test_result = true;
|
||||
|
||||
// although exit flag is set in another task, checking (exit_flag == false) is safe
|
||||
while (exit_flag == false) {
|
||||
if (dport_date != DPORT_REG_READ(DPORT_DATE_REG)) {
|
||||
dport_test_result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
xSemaphoreGive(*sema);
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
static void accessAPB(void *pvParameters)
|
||||
{
|
||||
xSemaphoreHandle *sema = (xSemaphoreHandle *) pvParameters;
|
||||
uint32_t uart_date = REG_READ(UART_DATE_REG(0));
|
||||
|
||||
apb_test_result = true;
|
||||
|
||||
// although exit flag is set in another task, checking (exit_flag == false) is safe
|
||||
while (exit_flag == false) {
|
||||
if (uart_date != REG_READ(UART_DATE_REG(0))) {
|
||||
apb_test_result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
xSemaphoreGive(*sema);
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
TEST_CASE("access DPORT and APB at same time", "[esp32]")
|
||||
{
|
||||
int i;
|
||||
TaskHandle_t th[2];
|
||||
xSemaphoreHandle exit_sema[2];
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
exit_sema[i] = xSemaphoreCreateMutex();
|
||||
xSemaphoreTake(exit_sema[i], portMAX_DELAY);
|
||||
}
|
||||
|
||||
exit_flag = false;
|
||||
|
||||
#ifndef CONFIG_FREERTOS_UNICORE
|
||||
printf("assign task accessing DPORT to core 0 and task accessing APB to core 1\n");
|
||||
xTaskCreatePinnedToCore(accessDPORT , "accessDPORT" , 2048, &exit_sema[0], UNITY_FREERTOS_PRIORITY - 1, &th[0], 0);
|
||||
xTaskCreatePinnedToCore(accessAPB , "accessAPB" , 2048, &exit_sema[1], UNITY_FREERTOS_PRIORITY - 1, &th[1], 1);
|
||||
#else
|
||||
printf("assign task accessing DPORT and accessing APB\n");
|
||||
xTaskCreate(accessDPORT , "accessDPORT" , 2048, &exit_sema[0], UNITY_FREERTOS_PRIORITY - 1, &th[0]);
|
||||
xTaskCreate(accessAPB , "accessAPB" , 2048, &exit_sema[1], UNITY_FREERTOS_PRIORITY - 1, &th[1]);
|
||||
#endif
|
||||
|
||||
printf("start wait for 10 seconds\n");
|
||||
vTaskDelay(10000 / portTICK_PERIOD_MS);
|
||||
|
||||
// set exit flag to let thread exit
|
||||
exit_flag = true;
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
xSemaphoreTake(exit_sema[i], portMAX_DELAY);
|
||||
vSemaphoreDelete(exit_sema[i]);
|
||||
}
|
||||
|
||||
TEST_ASSERT(dport_test_result == true && apb_test_result == true);
|
||||
}
|
||||
|
||||
Submodule components/esptool_py/esptool updated: 582a069eba...ffde3f07b3
@@ -68,6 +68,8 @@ config LWIP_IP_REASSEMBLY
|
||||
help
|
||||
Enabling this option allows reassemblying incoming fragmented IP packets.
|
||||
|
||||
menu "TCP"
|
||||
|
||||
config TCP_MAXRTX
|
||||
int "Maximum number of retransmissions of data segments"
|
||||
default 12
|
||||
@@ -82,6 +84,79 @@ config TCP_SYNMAXRTX
|
||||
help
|
||||
Set maximum number of retransmissions of SYN segments.
|
||||
|
||||
config TCP_MSS
|
||||
int "Maximum Segment Size (MSS)"
|
||||
default 1436
|
||||
range 1220 1436
|
||||
help
|
||||
Set maximum segment size for TCP transmission.
|
||||
|
||||
Can be set lower to save RAM, the default value 1436 will give best throughput.
|
||||
|
||||
config TCP_SND_BUF_DEFAULT
|
||||
int "Default send buffer size"
|
||||
default 5744 # 4 * default MSS
|
||||
range 2440 65535
|
||||
help
|
||||
Set default send buffer size for new TCP sockets.
|
||||
|
||||
Per-socket send buffer size can be changed at runtime
|
||||
with lwip_setsockopt(s, TCP_SNDBUF, ...).
|
||||
|
||||
This value must be at least 2x the MSS size, and the default
|
||||
is 4x the default MSS size.
|
||||
|
||||
Setting a smaller default SNDBUF size can save some RAM, but
|
||||
will decrease performance.
|
||||
|
||||
config TCP_WND_DEFAULT
|
||||
int "Default receive window size"
|
||||
default 5744 # 4 * default MSS
|
||||
range 2440 65535
|
||||
help
|
||||
Set default TCP receive window size for new TCP sockets.
|
||||
|
||||
Per-socket receive window size can be changed at runtime
|
||||
with lwip_setsockopt(s, TCP_WINDOW, ...).
|
||||
|
||||
Setting a smaller default receive window size can save some RAM,
|
||||
but will significantly decrease performance.
|
||||
|
||||
config TCP_QUEUE_OOSEQ
|
||||
bool "Queue incoming out-of-order segments"
|
||||
default y
|
||||
help
|
||||
Queue incoming out-of-order segments for later use.
|
||||
|
||||
Disable this option to save some RAM during TCP sessions, at the expense
|
||||
of increased retransmissions if segments arrive out of order.
|
||||
|
||||
choice TCP_OVERSIZE
|
||||
prompt "Pre-allocate transmit PBUF size"
|
||||
default TCP_OVERSIZE_MSS
|
||||
help
|
||||
Allows enabling "oversize" allocation of TCP transmission pbufs ahead of time,
|
||||
which can reduce the length of pbuf chains used for transmission.
|
||||
|
||||
This will not make a difference to sockets where Nagle's algorithm
|
||||
is disabled.
|
||||
|
||||
Default value of MSS is fine for most applications, 25% MSS may save
|
||||
some RAM when only transmitting small amounts of data. Disabled will
|
||||
have worst performance and fragmentation characteristics, but uses
|
||||
least RAM overall.
|
||||
|
||||
config TCP_OVERSIZE_MSS
|
||||
bool "MSS"
|
||||
config TCP_OVERSIZE_QUARTER_MSS
|
||||
bool "25% MSS"
|
||||
config TCP_OVERSIZE_DISABLE
|
||||
bool "Disabled"
|
||||
|
||||
endchoice
|
||||
|
||||
endmenu # TCP
|
||||
|
||||
config LWIP_DHCP_DOES_ARP_CHECK
|
||||
bool "Enable an ARP check on the offered address"
|
||||
default y
|
||||
@@ -139,4 +214,16 @@ config PPP_DEBUG_ON
|
||||
help
|
||||
Enable PPP debug log output
|
||||
|
||||
menu "ICMP"
|
||||
|
||||
config LWIP_MULTICAST_PING
|
||||
bool "Respond to multicast pings"
|
||||
default n
|
||||
|
||||
config LWIP_BROADCAST_PING
|
||||
bool "Respond to broadcast pings"
|
||||
default n
|
||||
|
||||
endmenu # ICMP
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/sys.h"
|
||||
#if LWIP_TCP && TCP_QUEUE_OOSEQ
|
||||
#if LWIP_TCP && (TCP_QUEUE_OOSEQ || ESP_LWIP)
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#endif
|
||||
#if LWIP_CHECKSUM_ON_COPY
|
||||
|
||||
@@ -69,8 +69,9 @@ typedef int sys_prot_t;
|
||||
#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
|
||||
#define LWIP_PLATFORM_ASSERT(x) do {printf(x); sys_arch_assert(__FILE__, __LINE__);} while(0)
|
||||
|
||||
//#define LWIP_DEBUG
|
||||
#ifdef NDEBUG
|
||||
#define LWIP_NOASSERT
|
||||
#endif
|
||||
//#define LWIP_ERROR
|
||||
|
||||
#endif /* __ARCH_CC_H__ */
|
||||
|
||||
@@ -184,6 +184,10 @@
|
||||
----------------------------------
|
||||
*/
|
||||
|
||||
#define LWIP_BROADCAST_PING CONFIG_LWIP_BROADCAST_PING
|
||||
|
||||
#define LWIP_MULTICAST_PING CONFIG_LWIP_MULTICAST_PING
|
||||
|
||||
/*
|
||||
---------------------------------
|
||||
---------- RAW options ----------
|
||||
@@ -280,7 +284,7 @@
|
||||
* TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
|
||||
* Define to 0 if your device is low on memory.
|
||||
*/
|
||||
#define TCP_QUEUE_OOSEQ 1
|
||||
#define TCP_QUEUE_OOSEQ CONFIG_TCP_QUEUE_OOSEQ
|
||||
|
||||
/*
|
||||
* LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
|
||||
@@ -288,7 +292,7 @@
|
||||
* LWIP_CALLBACK_API==1: The PCB callback function is called directly
|
||||
* for the event. This is the default.
|
||||
*/
|
||||
#define TCP_MSS 1460
|
||||
#define TCP_MSS CONFIG_TCP_MSS
|
||||
|
||||
/**
|
||||
* TCP_MAXRTX: Maximum number of retransmissions of data segments.
|
||||
@@ -305,6 +309,24 @@
|
||||
*/
|
||||
#define TCP_LISTEN_BACKLOG 1
|
||||
|
||||
|
||||
/**
|
||||
* TCP_OVERSIZE: The maximum number of bytes that tcp_write may
|
||||
* allocate ahead of time
|
||||
*/
|
||||
#ifdef CONFIG_TCP_OVERSIZE_MSS
|
||||
#define TCP_OVERSIZE TCP_MSS
|
||||
#endif
|
||||
#ifdef CONFIG_TCP_OVERSIZE_QUARTER_MSS
|
||||
#define TCP_OVERSIZE (TCP_MSS/4)
|
||||
#endif
|
||||
#ifdef CONFIG_TCP_OVERSIZE_DISABLE
|
||||
#define TCP_OVERSIZE 0
|
||||
#endif
|
||||
#ifndef TCP_OVERSIZE
|
||||
#error "One of CONFIG_TCP_OVERSIZE_xxx options should be set by sdkconfig"
|
||||
#endif
|
||||
|
||||
/*
|
||||
----------------------------------
|
||||
---------- Pbuf options ----------
|
||||
@@ -669,8 +691,8 @@
|
||||
#define ESP_DHCP_TIMER 1
|
||||
#define ESP_LWIP_LOGI(...) ESP_LOGI("lwip", __VA_ARGS__)
|
||||
|
||||
#define TCP_WND_DEFAULT (4*TCP_MSS)
|
||||
#define TCP_SND_BUF_DEFAULT (4*TCP_MSS)
|
||||
#define TCP_WND_DEFAULT CONFIG_TCP_WND_DEFAULT
|
||||
#define TCP_SND_BUF_DEFAULT CONFIG_TCP_SND_BUF_DEFAULT
|
||||
|
||||
#if ESP_PERF
|
||||
#define DBG_PERF_PATH_SET(dir, point)
|
||||
|
||||
@@ -110,9 +110,11 @@ static void dbg_lwip_tcp_pcb_one_show(struct tcp_pcb* pcb)
|
||||
seg = pcb->unacked;
|
||||
DBG_LWIP_SEG_SHOW(seg);
|
||||
|
||||
ESP_LWIP_LOGI("ooseg semengts:");
|
||||
#if TCP_QUEUE_OOSEQ
|
||||
ESP_LWIP_LOGI("ooseq segments:");
|
||||
seg = pcb->ooseq;
|
||||
DBG_LWIP_SEG_SHOW(seg);
|
||||
#endif
|
||||
|
||||
ESP_LWIP_LOGI("refused data=%p", pcb->refused_data);
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
#include "soc.h"
|
||||
|
||||
#define REG_UART_BASE( i ) (DR_REG_UART_BASE + (i) * 0x10000 + ( i > 1 ? 0xe000 : 0 ) )
|
||||
#define REG_UART_AHB_BASE(i) (0x60000000 + (i) * 0x10000 + ( i > 1 ? 0xe000 : 0 ) )
|
||||
#define REG_UART_BASE( i ) (DR_REG_UART_BASE + (i) * 0x10000 + ( (i) > 1 ? 0xe000 : 0 ) )
|
||||
#define REG_UART_AHB_BASE(i) (0x60000000 + (i) * 0x10000 + ( (i) > 1 ? 0xe000 : 0 ) )
|
||||
#define UART_FIFO_AHB_REG(i) (REG_UART_AHB_BASE(i) + 0x0)
|
||||
#define UART_FIFO_REG(i) (REG_UART_BASE(i) + 0x0)
|
||||
|
||||
|
||||
@@ -197,6 +197,8 @@ TEST_CASE("vfs parses paths correctly", "[vfs]")
|
||||
test_dir_opened(&inst_foobar, "/foo/bar/file");
|
||||
inst_toplevel.match_path = "/tmp/foo";
|
||||
test_opened(&inst_toplevel, "/tmp/foo");
|
||||
inst_toplevel.match_path = "foo";
|
||||
test_opened(&inst_toplevel, "foo");
|
||||
|
||||
TEST_ESP_OK( esp_vfs_unregister("/foo") );
|
||||
TEST_ESP_OK( esp_vfs_unregister("/foo1") );
|
||||
|
||||
@@ -142,6 +142,11 @@ static const vfs_entry_t* get_vfs_for_path(const char* path)
|
||||
memcmp(path, vfs->path_prefix, vfs->path_prefix_len) != 0) {
|
||||
continue;
|
||||
}
|
||||
// this is the default VFS and we don't have a better match yet.
|
||||
if (vfs->path_prefix_len == 0 && !best_match) {
|
||||
best_match = vfs;
|
||||
continue;
|
||||
}
|
||||
// if path is not equal to the prefix, expect to see a path separator
|
||||
// i.e. don't match "/data" prefix for "/data1/foo.txt" path
|
||||
if (len > vfs->path_prefix_len &&
|
||||
|
||||
Reference in New Issue
Block a user