Commit graph

11648 commits

Author SHA1 Message Date
liu zhifu c54e11537f esp_wifi: fix WiFi AMSDU decrypt issue 2020-01-06 17:58:03 +08:00
Jiang Jiang Jian 0a8c641e6f Merge branch 'bugfix/sniffer_crash_issue' into 'master'
esp_wifi: wifi stop bug when sniffer enable

Closes WIFI-1563 and WIFI-1137

See merge request espressif/esp-idf!7187
2020-01-06 17:22:01 +08:00
Marius Vikhammer ffeda3003c tcp_transport/ws_client: websockets now correctly handle messages longer than buffer
transport_ws can now be read multiple times in a row to read frames larger than the buffer.

Added reporting of total payload length and offset to the user in websocket_client.

Added local example test for long messages.

Closes IDF-1083
2020-01-06 17:18:13 +08:00
michael f676a3b190 driver, soc: update multichip support headers 2020-01-06 17:13:54 +08:00
michael 4220752aed ut: Move tests back from "esp32" subfolder
DISABLED_FOR_TARGETS macros are used

Partly revert "ci: disable unavailable tests for esp32s2beta"

This partly reverts commit 76a3a5fb48.

Partly revert "ci: disable UTs for esp32s2beta without runners"

This partly reverts commit eb158e9a22.

Partly revert "fix unit test and examples for s2beta"

This partly reverts commit 9baa7826be.

Partly revert "efuse: Add support for esp32s2beta"

This partly reverts commit db84ba868c.
2020-01-06 17:13:53 +08:00
Michael (XIAO Xufeng) bc0eac579c ut: add DISABLED_FOR_TARGETS macros to control ut building 2020-01-06 17:13:47 +08:00
lly 8116a787cd ble_mesh: Fix PreviousAddress endianess in Friend Request
The upper transport layer is using big endian ordering. The
PreviousAddress field of a Friend Request message should therefore
be converted to native endianess using sys_cpu_to_be16().
2020-01-06 16:19:03 +08:00
lly fc80d107ad ble_mesh: Fix next_period computation
If the duration to publish is roughly the same as the period, we might
end up with elapsed == period, which returns 0 and cancel the periodic
publication. Instead 1 should be returned, just like when the elapsed
time is greater than the period.
2020-01-06 16:17:36 +08:00
lly 7d7bbec5fe ble_mesh: Make model publication struct more compact
Previously the FastPeriodDivisor value was introduced to the model
publication struct. Based on the way it was grouped it seems the
intention was to fit it within the same octet as other bit fields,
but it actually makes the octet overflow by one bit. This ends up
creating another u8_t variable which in turn adds 24 bits of padding
after it.

To keep the size of the struct as compact as possible, group the flag
together with the key index, since that only requires 12 bits. Some
care is needed here, since the mesh stack does have special internal
key index values that require more than 12 bits such as
BLE_MESH_KEY_UNUSED and BLE_MESH_KEY_DEV. In this case restricting
ourselves to 12 bits is fine since the value in the model publication
struct follows 1:1 the value received in the Config Model Publication
Set message, and there the parameter is defined to be exactly 12 bits.
2020-01-06 16:17:36 +08:00
lly 82b4b89dea ble_mesh: Fix compile error when using release optimization level 2020-01-06 16:17:36 +08:00
lly b836674d8e ble_mesh: Remove useless CONFIG_BLE_MESH_NODE
For Low Power node and Proxy Server, the two features
depend on BLE_MESH_NODE in Kconfig.in, here in the
stack there is no need to judge if CONFIG_BLE_MESH_NODE
is enabled.
2020-01-06 16:17:36 +08:00
lly d83c37faed ble_mesh: Fixes Provisioner not support friend feature 2020-01-06 16:17:36 +08:00
lly 77e7d023b9 ble_mesh: Fixes wrong subnet info used for Friend Clear
When Friend node tries to send Friend Clear message to other
Friend nodes, it should use the subnet information based on
the net_idx from friendship.
2020-01-06 16:17:36 +08:00
lly 131a4e7c22 ble_mesh: fix provisioner failed to send msg to 0xFFFF
According to Mesh Spec 3.4.5.3, a node shall implement a local
network interface. And here we limit the situation just based
on the spec, and Provisioner directly sending the msg without
passing through the local network interface.
2020-01-06 16:17:36 +08:00
lly 197e54053e ble_mesh: fix virtual addr wrong return value
Fixes missing return value on `va_del`
Fixes wrong return value on `va_add`
2020-01-06 16:17:36 +08:00
lly e8440ac2f9 ble_mesh: Persistent storage of Virtual Address
The 16-bit format group addresses will be stored,
but we don't store (or restore) the virtual label UUIDs,
i.e. after a power cycle the 16-bit group addresses
would be meaningless.
2020-01-06 16:17:36 +08:00
lly 74d0bd3134 ble_mesh: Proxy forwards ALL_NODES addr
Unless explicitly blacklisted, the Proxy node will forward all messages
for the ALL_NODES address to the GATT proxy client.
2020-01-06 16:17:36 +08:00
lly 1338fc4ff1 ble_mesh: Model message macros
Creates macros for determining model message lengths based on opcode,
payload length and MIC size. Also adds macro wrapping
NET_BUF_SIMPLE_DEFINE to serve the most common use case.
2020-01-06 16:17:36 +08:00
lly f3b9b099cd ble_mesh: Use net_buf_simple_clone
Uses net_buf_simple_clone to access the sdu of an unsegmented app packet
for re-encryption.
2020-01-06 16:17:36 +08:00
lly aec696a3a4 ble_mesh: Skip local messages in rx
Local messages are already enqueued for the LPN in the tx path, and
don't have to be added again in the rx path.
2020-01-06 16:17:36 +08:00
lly 6516ab71ea ble_mesh: Ensure seqnum match in app/net
Re-encrypts single-segment application messages when the network seqnum
has changed, to avoid encrypting messages with different seqnums in
network and transport. This operation is only required for unsegmented
messages, as segmented messages don't need to use the same seqnum in
network.

Reinstates the special adv data for friend messages to store the app key
index.
2020-01-06 16:17:36 +08:00
lly b88dbf6348 ble_mesh: Expose app key get function 2020-01-06 16:17:36 +08:00
lly 906fb9d6e3 ble_mesh: Expose header parsing outside net 2020-01-06 16:17:36 +08:00
lly 865434e6de ble_mesh: Remove unused macro FRIEND_BUF_SIZE 2020-01-06 16:17:36 +08:00
lly 67cb3062a6 ble_mesh: Make RSSI value available to mesh applications 2020-01-06 16:17:36 +08:00
lly 89a681fd4a ble_mesh: Encrypt friend packets on send
Stores friend queue packets unencrypted, removing any out-of-order
issues caused by seqnum allocation. Also moves as much of the metadata
storage as possible into the packet, allowing us to free up some bytes
of net_buf user data for friend packets.
2020-01-06 16:17:36 +08:00
lly 99a63ce81d ble_mesh: Expose SeqZero mask
Makes a define for the seqzero 13-bit mask in transport, and exposes it
in the header for use in the friend module.
2020-01-06 16:17:36 +08:00
Angus Gratton 826b9f6380 Merge branch 'bugfix/wifi_event_bits' into 'master'
examples: station waiting with xEventGroup bits

Closes IDF-1177

See merge request espressif/esp-idf!7196
2020-01-06 12:09:18 +08:00
lly 9f6dd19033 ble_mesh: Update lightness last state when actual state is changed 2020-01-04 14:57:08 +08:00
Felipe Neves 5db46ab9e6 assert: extend likely macro to be called when silent assertions are off 2020-01-03 14:42:58 -03:00
Felipe Neves d059a955ae freertos: removed likely macros from non-port specifics parts of freertos
fatfs: moved esp_compiler header file inside of disk implementation file
2020-01-03 14:42:57 -03:00
Felipe Neves 668b33dcf3 esp_compiler: generate likely and unlikely macros only when performance optimization is selected as build option 2020-01-03 14:42:57 -03:00
Felipe Neves 1b76253e0e newlib/assert: placed unlikely macro as part of assertion
newlib/assert: replace unlikely with likely to keep original assertion

newlib/assert: fix assert macro that uses likely

freertos/port: add the missing sdkconfig.h back

newlib/assert: assert macro back to a single line
2020-01-03 14:42:55 -03:00
Felipe Neves fc00236d79 components/esp_common: added esp_macros.h that aims to hold useful macros
esp_common/esp_compiler: renamed esp_macros file to a more specific one

esp_common/esp_compiler: removed CONTAINER_OF macro, it was a duplicate

components/freertos: placed likely macros around port and critical sections

component/freertos: placed likely macros on lists module

components/freertos: placed unlikely macros inside of assertion points, they likely wont fail

components/freertos: added likely macros on queue modules

FreeRTOS queues are one of most hot code path, because to queues itself tend to
be used a lot by the applications, besides that, queues are the basic primitive
to form both mutexes and semaphores, The focus here is to place likely
macros inside lowest level send and receive routines, since they're common
from all kobjects: semaphores, queues, mutexes and FR internals (like timer queue)

components/lwip: placed likely/unlikey on net-interfaces code

components/fatfs: added unlikely macros on disk drivers code

components/spiffs: added unlikely macros on low level fs driver

components/freertos: added likely/unlikely macros on timers and ticker

freertos/event_group: placed likely/unlikely macros on hot event group code paths

components/sdmmc: placed likely / unlikely macros on lower level path of sdmmc

components/bt: placed unlikely macros around bt HCI functions calling

components/lwip: added likely/unlikely macros on OS port code section

components/freertos: fix code style on tick handler
2020-01-03 14:42:49 -03:00
Felipe Neves e5e8ee8912 docs: fix esp_pthread example syntax error 2020-01-03 11:21:35 -03:00
Shubham Kulkarni 563175d90a mbedtls: Use SPIRAM strategy in example_test.py 2020-01-03 15:30:03 +05:30
Ivan Grokhotkov 3c5190aefc Merge branch 'bugfix/legacy_msys2_environment' into 'master'
doc: Update the legacy MSYS2 environment to use 2019r2 toolchain version

See merge request espressif/esp-idf!7077
2020-01-03 17:53:55 +08:00
Ivan Grokhotkov 52f8aa2adb Merge branch 'feature/heap_non_os_build' into 'master'
heap: make compatible with non-OS builds, remove target dependence

Closes IDF-1236

See merge request espressif/esp-idf!7051
2020-01-03 17:12:51 +08:00
xiehang 3321999e4a lwip: Drop packets larger than MTU 2020-01-03 08:55:35 +00:00
xiehang ea1b821a60 Fix wifi stop bug when sniffer enable 2020-01-03 08:52:56 +00:00
Jakob Hasse bcefbb03ad examples: using xEventGroup bits properly
Closes IDF-1177

* changed
  ../../wifi/getting_started/station/README.md
  ../../wifi/getting_started/station/main/station_example_main.c
2020-01-03 16:10:27 +08:00
Angus Gratton e08e720e11 Merge branch 'bugfix/esp_ptr_executable_single_core' into 'master'
soc: Fix esp_ptr_executable() for single core ESP32 config & cache memory

See merge request espressif/esp-idf!7197
2020-01-03 15:47:18 +08:00
Angus Gratton 7dc7557aa9 soc: Fix esp_ptr_executable() for single core ESP32 config & cache memory
In single core mode, APP CPU cache region is added to the available range.
2020-01-03 17:31:40 +11:00
Angus Gratton e08fc62071 Merge branch 'bugfix/backtrace_rom_fn' into 'master'
soc: fix backtraces containing ROM functions

See merge request espressif/esp-idf!6719
2020-01-03 14:30:21 +08:00
Angus Gratton 3a451afb82 doc: Update the legacy MSYS2 environment to use 2019r2 toolchain version
As reported at https://www.esp32.com/viewtopic.php?p=52805
2020-01-03 06:05:00 +00:00
Angus Gratton 4b03fa3053 Merge branch 'feature/idf_size_py_json_dump' into 'master'
idf_size.py: can write data to json file now

Closes IDF-1246

See merge request espressif/esp-idf!7046
2020-01-03 11:19:56 +08:00
Angus Gratton 4132923ebe Merge branch 'bugfix/ws_user_context' into 'master'
websocket: added missing event data

Closes IDF-1271

See merge request espressif/esp-idf!7059
2020-01-03 09:29:41 +08:00
Ivan Grokhotkov 43de2cc84c test: add a (non-automated) case for backtraces with ROM functions 2020-01-02 18:50:32 +01:00
Ivan Grokhotkov b4aba189ab heap: recognize 0x40000000 as an address terminating the backtrace
On Xtensa, backtrace can not recover the two most significant bits of
the address, as the window call size is encoded in these bits.
Because of this, __builtin_return_address modifies these MSBs to
match those of the callee, "fixing" the address. An unfortunate side
effect is that the zero return address, which usually terminates the
backtrace, gets converted to 0x40000000. While there is a valid
instruction at this address, its occurrence in the backtrace is
highly unlikely: this is the first instruction of WindowOverflow4
vector, and IDF apps switch VECBASE to an IRAM location very early at
startup.
2020-01-02 18:42:46 +01:00
Ivan Grokhotkov d9534b3d6a soc: fix backtraces containing ROM functions
esp_ptr_executable would return false for pointers to ROM, which would
interrupt the backtrace. This makes ROM ranges recognized as
executable.
2020-01-02 18:42:46 +01:00