EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1558 background imageLoading...
Page #1558 background image
Chapter 4. API Guides
const int ip_precedence_vi = 4;
const int ip_precedence_offset = 5;
int priority = (ip_precedence_vi << ip_precedence_offset);
setsockopt(socket_id, IPPROTO_IP, IP_TOS, &priority, sizeof(priority));
Theoretically the higher priority AC has better performance than the low priority AC, however, its not always be
true, here are some suggestions about how to use the Wi-Fi QoS:
For some really important application traffic, can put it into AC_VO queue. Avoid sending big traffic via
AC_VO queue. On one hand, the AC_VO queue doesnt support AMPDU and it cant get better performance
than other queue if the traffic is big, on the other hand, it may impact the the management frames that also use
AC_VO queue.
Avoid using more than two different AMPDU supported precedences, e.g. socket A uses precedence 0, socket
B uses precedence 1, socket C uses precedence 2, this is a bad design because it may need much more memory.
To be detailed, the Wi-Fi driver may generate a Block Ack session for each precedence and it needs more
memory if the Block Ack session is setup.
4.33.28 Wi-Fi AMSDU
ESP32-S2 supports receiving and transmitting AMSDU.
4.33.29 Wi-Fi Fragment
supports Wi-Fi receiving fragment, but doesnt support Wi-Fi transmitting fragment.
4.33.30 WPS Enrollee
ESP32-S2 supports WPS enrollee feature in Wi-Fi mode WIFI_MODE_STA or WIFI_MODE_APSTA. Currently
ESP32-S2 supports WPS enrollee type PBC and PIN.
4.33.31 Wi-Fi Buffer Usage
This section is only about the dynamic buffer configuration.
Why Buffer Configuration Is Important
In order to get a , high-performance system, we need to consider the memory usage/configuration very carefully,
because:
the available memory in ESP32-S2 is limited.
currently, the default type of buffer in LwIP and Wi-Fi drivers is dynamic, which means that both
the LwIP and Wi-Fi share memory with the application. Programmers should always keep this in mind;
otherwise, they will face a memory issue, such as running out of heap memory.
it is very dangerous to run out of heap memory, as this will cause ESP32-S2 anundefined behavior. Thus,
enough heap memory should be reserved for the application, so that it never runs out of it.
the Wi-Fi throughput heavily depends on memory-related configurations, such as the TCP window size, Wi-Fi
RX/TX dynamic buffer number, etc.
the peak heap memory that the ESP32-S2 LwIP/Wi-Fi may consume depends on a number of factors, such as
the maximum TCP/UDP connections that the application may have, etc.
the total memory that the application requires is also an important factor when considering memory configu-
ration.
Due to these reasons, there is not a good-for-all application configuration. Rather, we have to consider memory
configurations separately for every different application.
Espressif Systems 1547
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish