Avoids growing the result of hardware bignum operations
(particularly for multiplication)
Fixes bugs where some Elliptic Curve operations fail or corrupt memory,
as they assume length of the number is never greater than the number of
non-zero limbs.
Includes some general refactoring to standardize terminology.
Closes https://github.com/espressif/esp-idf/issues/1556
Fixes TW12984
Adds test cases for both these issues.
1. after memory release MR merged, due to the get acl number condition is not completed, it will cause get acl number value incorrect
2. It may cause set Security Mode (BR/EDR) enable failed
1. change static emac-dma memory to dynamic
2. add esp_eth_deinit
3. modify ethernet example
4. add testcase for ethernet deinit function
5. GPIO0 could not output the 50MHz clock to PHY, so remove this configuration
1. new APIs: esp_mesh_get_subnet_nodes_num() and esp_mesh_get_subnet_nodes_list().
2. fix hard to find the parent during connect.
3. disable Wi-Fi channel switch function.
4. fix a typo of MESH_EVENT_NO_PARENT_FOUND.
esp_reset_reason_init would check for reset reason hint, and
unconditionally set RTC_RESET_CAUSE_REG (which is also
RTC_ENTRY_ADDR_REG) to hint value 0, i.e. 0x80000000. However the ROM
code treats this value as valid deep sleep wake stub entry point, and
tries to jump to it.
Clear RTC_RESET_CAUSE_REG only if it contained a valid reset reason
hint, and simply set the register value to 0 when doing so. Also add
a check to esp_get_deep_sleep_wake_stub function that deep sleep wake
stub entry address must be in IRAM.
Reported in https://esp32.com/viewtopic.php?f=13&t=6919.
Fix following WiFi bugs:
1. Shouldn't scan when connect
2. Check beacon length in modem sleep
3. Fix the bug that AP may deauth wrong station when inactivity timer expires
4. Fix the bug that WiFi assert the system when receiving empty MCS in association response frame
Multiple modules register their callback BTA_GATTS_AppRegister().
If any of the callbacks do not free the allocated pointer in
BTA_GATTS_CONF_EVT event, then this can result in memory leak.
So, free the pointer after the callback function is called and remove
the calls to free in the callback functions as it is now not required
Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>
This is just a quick glance at all the header files exposed to the
users from cleanup point of view.
Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>
We have fixed a bug in test script. Before that, we didn't do strict check when generate the mesh tree, which makes the test pass.
Temp disable these cases, to let CI pass before bug fixed.
When 32k XTAL was selected as clock source, if the first calibration
attempt failed, the code would fall back to 150kHz internal clock.
Calibration with the internal clock will always succeed.
Therefore `wait` would always be either 0 or 1. Based on this, some
code in this routine can be eliminated.
Marking a page full does not skip it from page selection process and the
same page might get returned if there is no other page with more unused
entries. Added a check for the same while storing blobs.
Fixes: https://github.com/espressif/esp-idf/issues/2313
Previous APIs used to set CPU frequency used CPU frequencies listed in
rtc_cpu_freq_t enumeration. This was problematic for two reasons.
First, supporting many possible frequency values obtained by dividing
XTAL frequency was hard, as every value would have to be listed in
the enumeration. Since different base XTAL frequencies are supported,
this further complicated things, since not all of these divided
frequencies would be valid for any given XTAL frequency. Second,
having to deal with enumeration values often involved switch
statements to convert between enumeration and MHz values, handle
PLL/XTAL frequencies separately, etc.
This change introduces rtc_cpu_freq_config_t structure, which contains
CPU frequency (in MHz) and information on how this frequency has to
be generated: clock source (XTAL/PLL), source frequency, clock
divider value. More fields can be added to this structure in the
future. This structure simplifies many parts of the code, since both
frequency value and frequency generation settings can be accessed in
any place in code without the need for conversions.
Additionally, this change adds setting of REF_TICK dividers to support
frequencies lower then XTAL with DFS.
`esp_http_client_write` API puts a constraint on the maximum length of the data that can be
written, which is equal to client handle buffer size, but the data to be sent can be more
than that, so in this case, this API has to be called multiple times.
In `esp_http_client_open` API, the return value of `transport_write` API, used to send HTTP
request, is not checked, and in rare cases, data written will be less than expected which will
cause a problem. So there are fixes for these minor issues in this MR.
Calling `esp_bt_controller_mem_release` or `esp_bt_mem_release` might result in exception if any of the regions returned to heap are empty. This happens usually if BT/BLE is enabled, but not used/linked in the final firmware.
1. BLE only with 9(max) connection will decrease 3K DRAM
2. BR/EDR only with 7(max) connection will decrease 16K DRAM
3. Any of BLE or BR/EDR connection number decrease will also decrease DRAM consumption
4. Decrease one BLE connection will save about 1KB DRAM
5. Decrease one BR/EDR ACL connection will save about 1.2KB DRAM
6. Decrease one BR/EDR SCO/eSCO will save 2KB DRAM.
7. fix some definition and kconfig
8. remove 1.2k of vhci tx cache and make .bss & .data to heap about 1.4K
9. modify BT Reserved Memory size and modify example to support new bt kconfig
Added bootloader_common_get_sha256_of_partition() and esp_partition_get_sha256() - get or calculate SHA-256
digest for app and data partitions.
Added bootloader_sha256_hex_to_str() - helps to print SHA-256 digest
Added esp_partition_check_identity() - compares two partitions by SHA-256 digest
Refactoring a function esp_image_load() in bootloader space to esp_image_verify() and
bootloader_load_image(). Old name function esp_image_load is deprecated
and will remove in V4.0 version.
spi_flash/sim: Fix error test_host. Add stub for bootloader_common_get_sha256_of_partition in sim/stubs
1. Add the 100 times test when the private key is generated by the random number;
2. Add the bt components to the unit-test-app/config directory.
3. Added the bt unit test case to CI.
For pins 32 and up the BIT(nr) macro used here overflowed,
causing undetermined GPIO pins to be reset.
Example: freeing SPI device/bus where CS is on pin 33
caused debug UART to cease communication, TXD0 was
disabled.
Fixed as BIT64(nr) macro, to be used elsewhere as needed.
For example in definitions like GPIO_SEL_32..GPIO_SEL_39.
1. modify parent switch mechanism.
2. fix non-root doesn't clear the layer value in nvs.
3. fix retransmit the remove announcement packets.
4. add API esp_mesh_flush_upstream_packets().
5. automatically adjust passsive scan time based on the change of beacon interval.
Component which includes component_ulp_common.mk may also need to set
some of the same COMPONENT_XXX variables. Logically, we should combine
the lists of files to embed, ldflags, extra include dirs, etc.
Fixes https://github.com/espressif/esp-idf/issues/2157.
1. The test step for error code REASON_ASSOC_EXPIRE is not reliable. SoftAP
could also send error code WIFI_REASON_NOT_AUTHED
2. STA will be disconnected now if softAP restart DHCP server
No longer necessary to keep all reserved addresses in 'soc'.
Means 'soc' does not need to know about 'bt', for example.
Also means that Bluetooth can be enabled in config without any memory being reserved for BT
controller. Only if code calling the BT controller is linked in, will this memory be reserved...
This change adds a check for compatibility between the nvs version
found on nvs flash and the one assumed by running code during nvs
initialization. Any mismatch is reported to the user using new error
code ESP_ERR_NVS_NEW_VERSION_FOUND.
Update libphy.a to v3960:
1. Decrease phy_init time from 900us to 347us in sleep wakeup
2. Fix RX STBC initialization
3. Modify set_chan function to fix interrupt watchdog issue
it will resolve the problem:
1. when bluetooth is running (For example: a2dp sink), wifi station cannot connect to AP easily
2. improve wifi connection success ratio when coexist is working
Based on report on forum here:
https://esp32.com/viewtopic.php?f=13&t=6382&p=27514
Previous versions were much more relaxed about what could be in the partition
table, erroring out avoids unexpected changes on upgrade like different
partition offsets.
- A bug of the http client when it downloads a chunked encoding packet is greater than the http_client's buffer, http_parser will call the callback body more than once, and the client will only handle the last
- with ssl_read, need to check before read to avoid timeout blocked when no data for reading
* spi_flash_mmap_pages needs pages array to be in internal memory.
Document and check this.
* Fix a bug that spi_flash_mmap did not allocate pages array in
internal memory.
* Minor style fixes: const-ify pages argument of spi_flash_mmap, add
spaces around operators, mark output arguments with [out].
Closes https://github.com/espressif/esp-idf/issues/2229.
The test is previously disabled for the requirement of external
connection. Now the signals are connected by internal connections.
Also change the failure logic of the test.
Fixed problem with multiple mount/unmount for different devices.
Additional check for structure length included into the code.
Remove useless spaces.
Added initialization for reserved memory.
WL version 2 mark used sectors as 16 bytes block of bytes with CRC.
This changes required because old version did not worked with encryption.
Additional unit tests are implemented.
Add a command `make erase_ota` - erases otadata if it there is in the
partition table otherwise error 'Partition table does not have ota_data partition'.
Closes https://github.com/espressif/esp-idf/issues/1821
heap_caps_malloc will fail to poison a block in IRAM with size not
divisible by 4. The proper fix will be to make poisoning code
smarter, or to disallow allocations from IRAM with size not aligned
by 4.
If we have the partition table without any ota_apps but in ota_data have
valide entry, in this case we get an error(hang). This commit fix this
case. If bs->app_count is zero when selecting the factory app.
Closes https://github.com/espressif/esp-idf/issues/2218
1. when one task do deinit/init/disable/enable, especially different cpu
core, it may cause controller crash in ISR handler
2. fix while BLE is scanning, bluetooth controller is disabled cause BLE
scan is not abort.
1. Modify esp_bt_controller_mem_release() to release BTDM BSS and Data to heap if
ESP_BT_MODE_BTDM mode is passed to it
2. Add a new API esp_bt_mem_release() which internally calls
esp_bt_controller_mem_release() with the provided mode and then if mode
is ESP_BT_MODE_BTDM, releases BT BSS and Data to heap.
Background:
For Wi-Fi and BT/BLE applications, for e.g. the usecase is like when
Bluetooth is used for provisioning and once the device is connected to the Wi-Fi
AP, we can turn off Bluetooth completely. In such scenarios, it should be possible to
reclaim all the memory of Bluetooth. Although, currently this does not
happen.
Experiment:
Made the following modifications to examples/bluetooth/gatt_server :
1. Added support of simple_wifi to it
2. Moved all the bluetooth related code under CONFIG_BT_ENABLED config
option
3. Calculated the free heap in 2 similar scenarios:
i. Disabled BT (CONFIG_BT_ENABLED undefined) and checked the free
heap after STA connected
ii. Kept BT enabled and disabled it after STA connected and checked
the free heap
Ideally, the numbers for i., ii. above should have been similar. But
there was a delta of almost 30-31K. (i. > ii.)
4. Through make size-components checked the common BSS for libbta.a and libbtdm_app.a
and found it to be almost 30K. Data is around 1K
Solution:
1. Modified the linker script to mark the BSS and Data for these libraries and
free it when ESP_BT_MODE_BTDM mode is passed to mem release APIs.
2. Verified that the free heap is comparable for i. and ii. above.
Note: It is known that once this is done, Bluetooth can only be used
again post reboot.
Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>
This change removes the earlier limitation of 1984 bytes for storing data-blobs.
Blobs larger than the sector size are split and stored on multiple sectors.
For this purpose, two new datatypes (multi-page index and multi-page data) are
added for entries stored in the sectors. The underlying read, write, erase and find
operations are modified to support these large blobs. The change is transparent
to users of the library and no special APIs need to be used to store these large
blobs.
* Fixes some "noreturn" functions in bootloader utils which did return (causing fatal CPU
exceptions).
* Marks bootloader entry as "noreturn", preventing "user code done" from stalling boot
Partial fix for https://github.com/espressif/esp-idf/issues/1814 TW20016
(Comprehensive fix for this issue will be enabling WDT during bootloader, coming shortly.)
1. Move channel to the first row of the table.
2. Remove the condition of HT20/HT40 for they are determined by
secondary channel.
3. Clean up the CSI table.
Because address space is mapped in 64KB pages, it was possible for unauthenticated data after the
app .bin to become mapped into the flash cache address space.
This problem is solved by 2 changes:
* "esptool elf2image --secure-pad" will pad the image so that the signature block ends close to the
64KB boundary. Due to alignment constraints it will be 12 bytes too short after signing (but
with flash encryption, these 12 bytes are still encrypted as part of the last block and can't be
arbitrarily changed).
* By default, secure boot now requires all app partitions to be a multiple of 64KB in size.
Perviously host send_auto_stop flag would be set for every data
transfer over 1 block long. This caused stop commands to be sent
after CMD53, which shouldn't be done. Fix by adding an explicit list
of commands for which send_auto_stop should be set.
Send the Goodbye packet while removing an mDNS service as an "Authoritative" packet so
that the listeners remove the service from their records immediately.
Fixed the error division on zero.
Also fixed range CONFIG_ESP32_RTC_CLK_CAL_CYCLES in Kconfig.
Fixed a overflow error by TIMG in the function rtc_clk_cal_internal. This error was due to a limit in values TIMG_RTC_CALI_MAX=0x7FFF (to write the slowclk_cycles) and TIMG_RTC_CALI_VALUE=0x1FFFFFF (to read xtal_cycles). Added assert finctions.
Closes https://github.com/espressif/esp-idf/issues/2147
1. Add reading psram EID.
2. Configure different clock mode for different EID.
3. add API to get psram size and voltage.
4. Remove unnecessary VSPI claim.
For 32MBit@1.8V and 64MBit@3.3V psram, there should be 2 extra clock cycles after CS get high level.
For 64MBit@1.8 psram, we can just use standard SPI protocol to drive the psram. We also need to increase the HOLD time for CS in this case.
EID for psram:
32MBit 1.8v: 0x20
64MBit 1.8v: 0x26
64MBit 3.3v: 0x46
When 2nd stage bootloader loads the ROM bootloader, it prints a
message similar to "entry 0x40080xxx", which idf_monitor decodes
(using application ELF file) as one of the reset vectors (xxx is <
400h). This moves the iram_seg of bootloader 1k up to prevent overlap
of bootloader .text and application vectors, making the output look
nicer. There is still a chance that the entry point decodes as some
symbol in application ELF file, but at least it won't have
"Exception" in its name.
Since 94250e42a0, UART output is suspended when entering sleep mode
(deep or light sleep). This makes sense for light sleep, where sleep
normally takes small amount of time, and flushing the UART would add
a lot of latency. But this breaks existing behaviour for deep sleep,
where UART output was previously sent out before entering sleep mode.
Closes https://github.com/espressif/esp-idf/issues/2145
remote_ip was declared to be a pointer to an address that was
overwritten in later stage thus changing the address pointed by remote_ip
esp_smartconfig.h : Fixed a typo. station_config to wifi_config_t
Signed-off-by: Sachin Parekh <sachin.parekh@espressif.com>
An existing UART driver does not support RS485 half duplex mode.
This task adds this functionality to ESP_IDF UART driver.
driver/uart.c/h: updated to add support of RS485 half duplex mode
examples/peripherals/uart_echo_rs485/main/rs485_example.c: added test example
components/driver/test/test_uart.c: added test of RS485 half duplex mode
docs/en/api-reference/peripherals/uart.rst: updated documentation
test_uart.c: suppress GCC warnings about discarded const qualifiers
uart.rst: remove sphinx warning - "Duplicate explicit target name"
simple change in uart.h file
update (test_uart.c) after rebase from master
update uart.rst, uart.c, rs485_example.c
Update example description in file Readme.md
update uart.c/h, uart.rst, test_uart.c according to review results
update uart.h (uart_set_rx_timeout() description
test_uart.c remove ignore tag
uart.c/h: fix param errors
test_uart.c: Remove GCC warning supress
uart.rst: fix the notes
rs485_example.c: fix output
uart.c: remove reset using UART_RXFIFO_RST from driver.
readme.md: Update example description
The tests are completed using RS485 adapters hardware connected to two ESP32 WROVER KITs.
TW#13812
Closes https://github.com/espressif/esp-idf/pull/667
Closes https://github.com/espressif/esp-idf/pull/1006
An existing UART driver does not support RS485 half duplex mode.
This task adds this functionality to ESP_IDF UART driver.
driver/uart.c/h: updated to add support of RS485 half duplex mode
examples/peripherals/uart_echo_rs485/main/rs485_example.c: added test example
components/driver/test/test_uart.c: added test of RS485 half duplex mode
docs/en/api-reference/peripherals/uart.rst: updated documentation
test_uart.c: suppress GCC warnings about discarded const qualifiers
uart.rst: remove sphinx warning - "Duplicate explicit target name"
simple change in uart.h file
update (test_uart.c) after rebase from master
update uart.rst, uart.c, rs485_example.c
Update example description in file Readme.md
update uart.c/h, uart.rst, test_uart.c according to review results
update uart.h (uart_set_rx_timeout() description
test_uart.c remove ignore tag
uart.c/h: fix param errors
test_uart.c: Remove GCC warning supress
uart.rst: fix the notes
rs485_example.c: fix output
The tests are completed using RS485 adapters hardware connected to two ESP32 WROVER KITs.
TW#13812
Closes https://github.com/espressif/esp-idf/pull/667
Closes https://github.com/espressif/esp-idf/pull/1006
An existing UART driver does not support RS485 half duplex mode.
This task adds this functionality to ESP_IDF UART driver.
driver/uart.c/h: updated to add support of RS485 half duplex mode
examples/peripherals/uart_echo_rs485/main/rs485_example.c: added test example
components/driver/test/test_uart.c: added test of RS485 half duplex mode
docs/en/api-reference/peripherals/uart.rst: updated documentation
test_uart.c: suppress GCC warnings about discarded const qualifiers
uart.rst: remove sphinx warning - "Duplicate explicit target name"
simple change in uart.h file
update (test_uart.c) after rebase from master
update uart.rst, uart.c, rs485_example.c
Update example description in file Readme.md
update uart.c/h, uart.rst, test_uart.c according to review results
update uart.h (uart_set_rx_timeout() description
test_uart.c remove ignore tag
uart.c/h: fix param errors
test_uart.c: Remove GCC warning supress
uart.rst: fix the notes
rs485_example.c: fix output
The tests are completed using RS485 adapters hardware connected to two ESP32 WROVER KITs.
TW#13812
Closes https://github.com/espressif/esp-idf/pull/667
Closes https://github.com/espressif/esp-idf/pull/1006
An existing UART driver does not support RS485 half duplex mode.
This task adds this functionality to ESP_IDF UART driver.
driver/uart.c/h: updated to add support of RS485 half duplex mode
examples/peripherals/uart_echo_rs485/main/rs485_example.c: added test example
components/driver/test/test_uart.c: added test of RS485 half duplex mode
docs/en/api-reference/peripherals/uart.rst: updated documentation
test_uart.c: suppress GCC warnings about discarded const qualifiers
uart.rst: remove sphinx warning - "Duplicate explicit target name"
simple change in uart.h file
update (test_uart.c) after rebase from master
update uart.rst, uart.c, rs485_example.c
Update example description in file Readme.md
update uart.c/h, uart.rst, test_uart.c according to review results
update uart.h (uart_set_rx_timeout() description
test_uart.c remove ignore tag
The tests are completed using RS485 adapters hardware connected to two ESP32 WROVER KITs.
TW#13812
Closes https://github.com/espressif/esp-idf/pull/667
Closes https://github.com/espressif/esp-idf/pull/1006
An existing UART driver does not support RS485 half duplex mode.
This task adds this functionality to ESP_IDF UART driver.
driver/uart.c/h: updated to add support of RS485 half duplex mode
examples/peripherals/uart_echo_rs485/main/rs485_example.c: added test example
components/driver/test/test_uart.c: added test of RS485 half duplex mode
docs/en/api-reference/peripherals/uart.rst: updated documentation
test_uart.c: suppress GCC warnings about discarded const qualifiers
uart.rst: remove sphinx warning - "Duplicate explicit target name"
simple change in uart.h file
update (test_uart.c) after rebase from master
update uart.rst, uart.c, rs485_example.c
Update example description in file Readme.md
update uart.c/h, uart.rst, test_uart.c according to review results
update uart.h (uart_set_rx_timeout() description
The tests are completed using RS485 adapters hardware connected to two ESP32 WROVER KITs.
TW#13812
Closes https://github.com/espressif/esp-idf/pull/667
Closes https://github.com/espressif/esp-idf/pull/1006
An existing UART driver does not support RS485 half duplex mode.
This task adds this functionality to ESP_IDF UART driver.
driver/uart.c/h: updated to add support of RS485 half duplex mode
examples/peripherals/uart_echo_rs485/main/rs485_example.c: added test example
components/driver/test/test_uart.c: added test of RS485 half duplex mode
docs/en/api-reference/peripherals/uart.rst: updated documentation
test_uart.c: suppress GCC warnings about discarded const qualifiers
uart.rst: remove sphinx warning - "Duplicate explicit target name"
simple change in uart.h file
update (test_uart.c) after rebase from master
update uart.rst, uart.c, rs485_example.c
Update example description in file Readme.md
update uart.c/h, uart.rst, test_uart.c according to review results
The tests are completed using RS485 adapters hardware connected to two ESP32 WROVER KITs.
TW#13812
Closes https://github.com/espressif/esp-idf/pull/667
Closes https://github.com/espressif/esp-idf/pull/1006
components/wpa_supplicant/port/include/os.h:259:29: error: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Werror=stringop-truncation]
#define os_strncpy(d, s, n) strncpy((d), (s), (n))
^~~~~~~~~~~~~~~~~~~~~~
components/wpa_supplicant/src/wpa2/eap_peer/eap.c:410:3: note: in expansion of macro 'os_strncpy'
os_strncpy(sm->blob[0].name, CLIENT_CERT_NAME, BLOB_NAME_LEN);
^~~~~~~~~~
components/spi_flash/partition.c: In function 'load_partitions':
components/spi_flash/partition.c:179:66: error: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
strncpy(item->info.label, (const char*) it->label, sizeof(it->label));
^
components/fatfs/src/ff.c: In function 'f_fdisk':
components/fatfs/src/ff.c:5995:5: error: this 'for' clause does not guard... [-Werror=misleading-indentation]
for (n = 16; n < 256 && sz_disk / n / cluster_size > 1024; n *= 2) ;
^~~
components/fatfs/src/ff.c:5996:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
if (n == 256) n--;
^~
components/esp32/ipc.c: In function 'esp_ipc_init':
components/esp32/ipc.c:82:31: error: '%d' directive writing between 1 and 11 bytes into a region of size 5 [-Werror=format-overflow=]
sprintf(task_name,"ipc%d",i);
^~
components/esp32/ipc.c:82:27: note: directive argument in the range [-2147483648, 1]
sprintf(task_name,"ipc%d",i);
^~~~~~~
components/esp32/ipc.c:82:9: note: 'sprintf' output between 5 and 15 bytes into a destination of size 8
sprintf(task_name,"ipc%d",i);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
INTERRUPT and CCOUNT registers will change outside of program control.
Making the inline assembly used to read these registers volatile
indicates this fact to the compiler.
Fixes https://github.com/espressif/esp-idf/issues/2127
The fix is for the situation when cache disabling mechanism causes
a deadlock with user tasks. Situation is as follows:
1. spi_flash operation is started from low-priority task on CPU0
2. It uses IPC to wake up high-priority IPC1 task on CPU1, preventing
all other tasks on CPU1 from running. This is needed to safely
disable the cache.
3. While the task which started spi_flash operation is waiting for IPC1
task to acknowledge that CPU1 is not using cache anymore, it is
preempted by a higher priority application task ("app0").
4. Task app0 busy-waits for some operation on CPU1 to complete. But
since application tasks are blocked out by IPC1 task, this never
happens. Since app0 is busy-waiting, the task doing spi flash
operation never runs.
The more or less logical soltion to the problem would be to also do
cache disabling on CPU0 and the SPI flash operation itself from IPC0
task. However IPC0 task stack would need to be increased to allow doing
SPI flash operation (and IPC1 stack as well). This would waste some
memory. An alternative approach adopted in this fix is to call FreeRTOS
functions to temporary increase the priority of SPI flash operation task
to the same level as the IPC task.
Fixes https://github.com/espressif/arduino-esp32/issues/740
Fixes https://github.com/espressif/esp-idf/issues/1157
1. fix BLE connection missing in coex mode
2. modify other parameters to make coex priority more reasonable
3. fix modem sleep procedure trap cause Wifi disable RF when BT is
working. Such cause that BR/EDR is difficult to be connected, BLE
connection stability decrease and so on.
4. modify BR/EDR coexist duration to imrove BR/EDR connect success
ratio.
5. Due to the hardware coexist bug, BLE scan interval/window should
be less than 0x100(about 160ms). Therefore, it will cause BLE cannot
scan any advertising packet while WiFi have higher priority
behaviour(such like RX beacon, scan, TX/RX VO packets and etc.).
1. add APIs to set/get announce interval values.
2. add API to enable/disable the min rate to 6Mbps for data packages.
3. add APIs to set/get RSSI threshold values.
4. fix ap_loss.
Moved useful functions from wrapped assert functions, because option `CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED=y` will remove this functions.
Closes https://github.com/espressif/esp-idf/issues/2068
1. esp_ble_remove_bond_device will only remove BLE bond key and disconnect BLE device.
2. esp_bt_gap_remove_bond_device will only remove BT bond key and disconnect BT device.
As reported https://esp32.com/viewtopic.php?f=14&t=6171
event_callback() in sockets.c calls conn->socket-- to register
activity on a netconn which may not have any socket yet,
so any socket value < 0 indicates "no controlling socket"
for the netconn.
IDF had two defines ESP_PARTITION_TABLE_OFFSET and ESP_PARTITION_TABLE_ADDR. They were the same and equal by 0x8000.
A define ESP_PARTITION_TABLE_ADDR was removed from IDF.
A define ESP_PARTITION_TABLE_OFFSET depends on option CONFIG_PARTITION_TABLE_OFFSET in Kconfig.
Now using only #define ESP_PARTITION_TABLE_OFFSET CONFIG_PARTITION_TABLE_OFFSET
This change allows readonly FATFS to be mounted without wear levelling
support. This will provide the customers a simple way to mount FATFS images
generated on host and flashed onto the chip during factory provisioning.
Since NVS encryption is not supported yet and NVS entry size is limited,
the change will provide an easy alternative for securing the provisioning data
by just marking FATFS parition as encrypted.
* a missing pointer increment caused error, if available was > 0 after the first iteration of while(available) loop.
* changed memory allocation strategy from large fixed size (RFCOMM_DATA_BUF_SIZE) to just the needed
size, which will be below MTU
Cherry-picked from https://github.com/espressif/esp-idf/pull/1923/
Since commit 94250e4, EXT0 wakeup mechanism, when wakeup level was set
to 0, started waking up chip immediately after entering deep sleep.
This failure was triggered in that commit by a change of
RTC_CNTL_MIN_SLP_VAL (i.e. minimum time in sleep mode until wakeup
can happen) from 128 cycles to 2 cycles.
The reason for this behaviour is related to the way input enable (IE)
signal going into an RTC pad is obtained:
PAD_IE = (SLP_SEL) ? SLP_IE & CHIP_SLEEP : IE,
where SLP_IE, SLP_SEL, and IE are bits of an RTC_IO register related
to the given pad. CHIP_SLEEP is the signal indicating that chip has
entered sleep mode.
The code in prepare_ext{0,1}_wakeup did not enable IE, but did enable
SLP_SEL and SLP_IE. This meant that until CHIP_SLEEP went high, PAD_IE
was 0, hence the input from the pad read 0 even if external signal
was 1. CHIP_SLEEP went high on the 2nd cycle of sleep. So when
RTC_CNTL_MIN_SLP_VAL was set to 2, the input signal from the pad was
latched as 0 at the moment when CHIP_SLEEP went high, causing EXT0
wakeup with level 0 to trigger.
This commit changes the way PAD_IE is enabled: SLP_SEL and SLP_IE are
no longer used, and IE is set to 1. If EXT0 wakeup is used, RTC_IO is
not powered down, so IE signal stays 1 both before CHIP_SLEEP goes
high and after. If EXT1 wakeup is used, RTC_IO may be powered down.
However prepare_ext1_wakeup enables Hold on the pad, locking states
of all the control signals, including IE.
Closes https://github.com/espressif/esp-idf/issues/1931
Closes https://github.com/espressif/esp-idf/issues/2043
For some test configurations, not all tests need to be run. This
change allows adding a comment in the configuration file of the
following form:
unit-test-app makefile will use it to determine which components to
build. If the comment is not present, all components will be built
(TESTS_ALL=1).
Also add test configuration for libsodium. It is a separate test
configuration due to the large binary size generated when building
libsodium tests.
Previously the loop in esp_timer_impl_set_alarm was necessary to catch
the case when timer count wraps around (goes from 2^32 - 1 to 0).
Since ALARM_OVERFLOW_VAL was reduced from 2^32 - 1 to 0xefffffff,
this is no longer necessary.
Fixes https://github.com/espressif/esp-idf/issues/1891
Allows you to move the partition table, it gives more space for the bootloader.
Added a new utility - parttool.py. This utility can search for the offset and/or size of the partitions by name and type/subtype. Use for getting APP_OFFSET and PHY_DATA_OFFSET.
The linker(esp32.bootloader.ld) made changes that allow you to write a custom bootloader code more.
TW14125
spi test: Prime the flash cache before each test to minimise flash cache misses.
VFS performance test: Increase the number of runs to minimise influence of an isolated bad run.
Makes spiffs component runnable on host. Depends on the host library build
of flash emulator. Includes a basic sanity test of
mounting a volume, opening a file, writing to the file, reading the file,
closing the file and unmounting volume.
Makes fatfs component runnable on host. Depends on the host library build
of wear levelling and flash emulator. Includes a basic sanity test of
mounting a volume, opening a file, writing to the file, reading the file,
closing the file and unmounting volume.
Makes the entirety of the wl API runnable on host. Flash emulator
is separated into spi_flash component directory to be reused by
other storage components.
Before entering the deep sleep, the RTC and FRC counters are synchronized. Updating the boot_time.
Added a unit test for this case.
Fixed warnings for MULTIPLE_STAGES
Closes https://github.com/espressif/esp-idf/issues/1840
1. Fix the WiFi/BT coexist bug
2. Fix WPA2 enterprise example crash bug
3. Add size and version check for crypto type struct
4. Add MD5 check for crypto type header file
This fix is for compatibility with lwip_select(). It moves the lock to
UART which is the only VFS driver which is implemented and is not
"thread-safe".
in the include file esp_ota_ops.h "esp_partition.h" is included.
This is from spi_flash so component that requires app_update also will need that
this fixes this error:
In file included from ../components/esp32-homie/ota.c:11:0:
/esp-idf/components/app_update/include/esp_ota_ops.h:22:27: fatal error: esp_partition.h: No such file or directory
Signed-off-by: Nicola Lunghi <25422924+nicola-lunghi@users.noreply.github.com>
Merges https://github.com/espressif/esp-idf/pull/1947
This function speeds up or slows down the system clock in order to make a gradual adjustment. This ensures
that the calendar time reported by the system clock is always monotonically increasing, which might not happen
if you simply set the clock.
The delta argument specifies a relative adjustment to be made to the clock time. If negative, the system clock is
slowed down for a while until it has lost this much elapsed time. If positive, the system clock is speeded up for a
while.
If the olddelta argument is not a null pointer, the adjtime function returns information about any previous time
adjustment that has not yet completed.
The return value is 0 on success and -1 on failure.
To stop the adjustement, call the function settimeofday(current_time).
When using multiple sockets, some of them could be incorrectly removed
from the fd_sets before passing these fd_sets forward to the socket
select function.
Closes https://github.com/espressif/esp-idf/issues/1987
Added feature:
- reset firmware to Factory app.(by long pressing of the button)
- boot Test app. (by long pressing of the button)
- Added feature erase data partitions from factory reset.
TW10281
TW10280
1. add mesh_assoc_t to esp_mesh_internal.h file.
2. rename "node" to "device" in esp_mesh.h.
3. add MESH_EVENT_SCAN_DONE event.
4. add APIs esp_mesh_scan_get_ap_record() and esp_mesh_scan_get_ap_ie_len() to get scan results.
5. modify API esp_mesh_set_self_organized() by adding parameter "select_parent".
6. modify API esp_mesh_set_parent() by adding parameter "parent_mesh_id"
7. add manual networking example.
1. Store the calibration data to NVS if PHY does full calibration because of calibration data checksum failure
2. Pass the station's mac to PHY for checksum calculation
A new method of workaround an error with DPORT is to ensure that the APB is read and followed by the DPORT register without interruptions and pauses. This fix places this implementation in the IRAM to exclude errors associated with the cache miss.
Earlier they have to be selected at the compile time through sdkconfig.
A2DP sink and source application tested with this change.
Signed-off-by: Amey Inamdar <amey@espressif.com>
Add error handling for http client
set ssid password correct with Example_WIFI test, and clear password before free
Fixed the CI failure due to HTTP errror names
driver(i2c, rmt): Add xQueue and xSemaphore static allocation support when intr_alloc_flag set to ESP_INTR_FLAG_IRAM.
See merge request idf/esp-idf!2335
This fixes multiple bugs with ring buffers and re-factors the code. The public
API has not changed, however the underlying implementation have various private
functions have been changed. The following behavioral changes have been made
- Size of ring buffers for No-Split/Allow-Split buffers will not be rounded
up to the nearest 32-bit aligned size. This was done to simplify the
implementation
- Item size for No-Split/Allow-Split buffers will also be rounded up to the
nearest 32-bit aligned size.
The following bugs have been fixed
- In copyItemToRingbufAllowSplit(), when copying an item where the aligned
size is smaller than the remaining length, the function does not consider
the case where the true size of the item is less than 4 bytes.
- The copy functions will automatically wrap around the write pointers when
the remaining length of the buffer is not large enough to fit a header, but
does not consider if wrapping around will cause an overlap with the read
pointer. This will make a full buffer be mistaken for an empty buffer
closes#1711
- xRingbufferSend() can get stuck in a infinite loop when the size of the
free memory is larger than the needed_size, but too small to fit in the ring
buffer due to alignment and extra overhead of wrapping around.
closes#1846
- Fixed documentation with ring buffer queue set API
- Adding and removing from queue set does not consider the case where the
read/write semaphores actually hold a value.
The following functions have been deprecated
- xRingbufferIsNextItemWrapped() due to lack of thread safety
- xRingbufferAddToQueueSetWrite() and xRingbufferRemoveFromQueueSetWrite()
as adding the queue sets only work under receive operations.
The following functions have been added
- xRingbufferReceiveSplit() and xRingbufferReceiveSplitFromISR() as a thread
safe way to receive from allow-split buffers
- vRingbufferGetInfo()
Documentation for ring buffers has also been added.
Add function xRingbufferCanRead & xRingbufferCanWrite
to be able use queue sets. Without it is not possible
to check to which ringbuffer returned semaphore belongs.
1. provide options for bluetooth low power mode
2. provide two options for bluetooth low power clock: main XTAL and external 32kHz XTAL
3. provide function and callbacks to control bluetooth low power mode, including enable/disable sleep, software wakeup request, low power clock settings, check power state, etc
4. modify vhci API vhci_host_send_packet to use blocking mode
5. note that DFS and bluetooth modem sleep can not be used together currently.
In situations where idle task runs a lot of idle hooks or cleanup code
(due to pthread local storage, etc) it can use more than 1KB of stack.
(I think the trigger is if a context switch happens at the right point
in the TLS cleanup).
Also removes an sdkconfig.default which accidentally set all config items,
including this stack size.
Added .rtc_noinit and .noinit section definitions into linker file /esp32/ld/esp32.common.ld.
The macro __NOINIT_ATTR, RTC_NOINIT_ATTR declared in esp32/esp_attr.h file.
Added unit test file to test added behavior for noinit variables and its attributes.
Added documentation changes for new added attributes.
Make some corrections after code review:
The linker file has been corrected to place noinit section before bss_start to make it safer.
Documentation file has been modified to clarify reset behavior of allocated data .
Corrected typos in test_noinit.c and removed assertion of noinit variable to avoid possible issues with ROM boot loader memory allocation.
The linker file has been corrected to place noinit section before bss_start to make it safer.
Documentation file has been modified to clarify reset behavior of allocated data .
Corrected typos in test_noinit.c and removed assertion of noinit variable to avoid possible issues with ROM boot loader memory allocation.
Update test_noinit.c file to address RTCWDT_RTC_RESET reset reason instead of POWERON_RESET.
Test optimized to pass automated unit testing.
esp32: Add .noinit and .rtc_noinit sections to the linker script
Update of general-notes.rst documentation to fomat examples as code and attributes as identifiers.
Test test_noinit.c corrected to pass automated testing (support ofTEST_CASE_MULTIPLE_STAGES())
https://ezredmine.espressif.cn:8765/issues/15878
1. remove rc when ap not found
closes issue: https://github.com/espressif/esp-idf/issues/1797
2. allocate mimo packet to internal memory
3. use FRC2 timer instead of WDEV_NOW() for modem sleep to calculate
TBTT time.
It fixes the bug that TBTT will be incorrect if beacon is lost.
If the RTC crystal is bad or has no matched capacitance, then you do not need to start such the crystal. It is necessary to determine this case, output an error (about impossibility to start from the oscillator) and start from the internal RC of the chain.
Reduced the default value of the number of bootstrap cycles. Because we can oscillating the oscillator which then stops. (in Kconfig). Changed from 100 to 5.
The number of calibration cycles has been increased. It is the main criterion for estimating the launch of an oscillator. A large increase leads to an increase in the load time, as well as the stability of recognition of this case. (in Kconfig).
Changed from 1024 to 3000.
This fixes errors logged on the console: sdmmc_req:
handle_idle_state_events unhandled: 00000004 00000000
The issue happens if "data done" event occurs before "command done".
State machine code did not check *which* event occurred in
SENDING_CMD state, and went to IDLE or SENDING_DATA state on any
non-error event. In this case, we can't process "data done" event
until command has completed. This change introduces "unhandled event"
mask, which is carried over from one run of process_events to the
other. This allows waiting for the "command done" event to complete,
and then process "data done" event.
Ref TW17126.
CMD53 in byte mode supports transfers of any number of bytes between 1
and 512. This change removes limitation that the number of bytes must
be divisible by 4. Host quirk, that such transfers must be split into
two commands (one for the aligned part and the other one for
unaligned) is taken into account.
When two CPUs read the area of the DPORT and the area of the APB, the result is corrupted for the CPU that read the APB area.
And another CPU has valid data.
The method of eliminating this error.
Before reading the registers of the DPORT, make a preliminary reading of the APB register.
In this case, the joint access of the two CPUs to the registers of the APB and the DPORT is successful.
As of now, when Bluetooth debugs are enabled, all the messages are
mapped to BT_PRINTF which is mapped to ESP_LOGE. Hence, make monitor
shows all logs in red color which might lead to missing the actual
errors
This patch maps the Bluetooth messages to appropriate ESP_LOG* messages
and improves readability.
Also, make the BT trace level be configurable in menuconfig, so that
each layer of bt trace can be enabled/disabled.
Finally, add debug log control for BTC, OSI, BLUFI and clear up
Bluetooth debug logs.
So, with this the method of enabling Bluetooth logs is as follows:
1. make menuconfig -> Component config -> Bluetooth -> Bluedroid Enable
-> BT DEBUG LOG LEVEL -> set trace level for every layer of BT
Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>
If the allocated interrupt list is not empty and the new item will be inserted
as the header of the list, insert_vector_desc() causes crash because pre is
null. This commit fix this issue.
1. Fix the duty fade check issue reported from https://github.com/espressif/esp-idf/issues/1914
2. Fix the duty overflow issue when duty_scale is set to 1.
3. Fix the duty fade error when a fade operation is under way. We must configure a new duty setting after the previous fade operation has finished due to hardware limit.
4. Add thread-safe version APIs to set duty and fade.
5. Correct the duty range in driver.
It has been observed that, if external SPIRAM is enabled, then under
certain scenarios (e.g. internal memory being too much fragmented),
I2S tx/rx descriptors can land in external SPIRAM and hence resulting
in failure in DMA. Adding explicit capability to allocate in only DMA
capable memory.
Signed-off-by: Mahavir Jain <mahavir@espressif.com>
change some API function to throw event:
esp_wifi_deauth_sta
esp_wifi_get_country
esp_wifi_ap_get_sta_list
esp_wifi_sta_get_ap_info
esp_wifi_stop
esp_wifi_get_channel
esp_wifi_get_protocol
esp_wifi_get_bandwidth
ALT header files for sha1, sha256, sha512 are only supposed to declare
mbedtls_sha1_context data structure. Function prototypes should come
from original header files.
The following mbedTLS APIs have been deprecated and replaced with the
new ones which return error codes:
mbedtls_shaX_starts -> mbedtls_shaX_starts_ret
mbedtls_shaX_update -> mbedtls_shaX_update_ret
mbedtls_shaX_finish -> mbedtls_shaX_finish_ret
mbedtls_shaX_process -> mbedtls_shaX_internal_process
Update hardware implementations of SHA functions, and other IDF
components which used above functions, to use new versions.
When light sleep is started, the other CPU gets halted using DPORT
stall mechanism. This can happen while it is inside an esp_timer
critical section, which may lead to a deadlock. This change adds
functions to take and release esp_timer lock before entering
DPORT critical section, preventing the deadlock.
1. Add error log if failed to store calibration version/mac/data
2. Change the NVS calibration version/mac/data store sequence
3. Pass the init_data instead of NULL to esp_phy_rf_init() in esp_phy_load_cal_and_init()
Currently when page is being freed, items are individually moved from
FREEING page to ACTIVE page and erased. If power-off happens during the
process, the remaining entries are moved to ACTIVE page during recovery.
The problem with this approach is there may not be enough space on
ACTIVE page for all items if an item was partially written before
power-off and erased during recovery. This change moves all the items
from FREEING to ACTIVE page and then erased the FREEING page, If
power-off happens during the process, then ACTIVE page is erased and the
process is restarted.
Refactor IDF "project" functionality under a wrapping of the default
"project" command, so we can tweak it a bit...
Will need more testing in other environments.
* Philosophical: "explicit is better than implicit".
* Practical: Allows useful errors if invalid directories given in components as the defaults aren't
always used. Also trims the -I path from a number of components that have no actual include
directory.
* Simplifies knowing which components will be header-only and which won't
characateristic
1. In addition to mentioning in the documentation, use the standard appearance
values already present and return appropriate error in case an incorrect
value is passed
2. Add ESP_BLE_APPEARANCE* macros corresponding to BTM_BLE_APPEARANCE*
and use them from the API instead
3. Add the missing appearance parameter values from
https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml
4. Fix some minor typos
Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>
1. Change all the hash used from the coap module to generated by the bluedroid module directly.
component/bt: Added the <string.h> include file to the gattc_co module to avoid compile error.
component/bt: optimiz the code
component/bt: optimiz the code.
component/bt: added the l2c change.
component/bt: Added the modified.
component/bt: change the indicate callback function.
component/bt: added the BLE throughput test gattc & gatts example.
component/bt: Change the sdkconfig.default CONFIG_GATTS_NOTIFY_THROUGHPUT setting.
component/bt: Change the throughput_client_task delay method.
component/bt: change the btu task size from 4096 to 5096
comonent/bt: close the print when congest.
component/bt: Added the CPU frequency set method to the readme file.
component/bt: Change the gatts_demo_char1_val to gl_profile_tab[PROFILE_A_APP_ID].char_handle to avoid make error.
example/ble_throughput: Added the Readme explanation.
component/bt: Added the bt lib change.
component/bt: Update the bt lib & Change the LOG level from ERROR to DEBUG when congest.
component/bt: Fixed the bug of timer start assign error.
component/bt: Change back the gattc & gatts demo with same as the master.
example/ble_throughput: Fixed the bug when prepare write of the ble throughput.
component/bt: Update the check_sum algorithm.
component/bt: Change Added the path when used the include file of "l2cdefs.h" & "l2c_api.h".
example/throughput_client: Added the Freertos related header files to ble throughput client demo to avoid compile error.
1. add the L1 include path with a prefix, such like osi/list.h, stack/a2d_api.h and etc.
2. modify component, only bluedroid/api/include/api is export to another component and application,
other include path just for bluedroid used
3. put bluedroid/include into common/include/common, so the root directory of bluedroid have no include path.
4. modify doxygen to use esp_bt.h and redirect to
component/bt/bluedroid/api/include/api/
fix compile
Disables app image integrity checks when running under OpenOCD control.
Allows setting breakpoints in flash before application start (just after reset).
Command response tokens can be delayed from the original command by 1
to 8 bytes. In 4a2489b9, handling for delayed tokens was added for
normal (no data) commands, and data read commands. This adds handling
for delayed commands for data write commands.
Currently when MAX_STATION limit in DHCP config is set to N, dhcp server
issues only N-1 IP addresses. This is problematic from customer
perspective if both SoftAP MAX_STATION and DHCP MAX_STATION limit is set
to same value. With this change DHCP server can issue N addresses that
is inline with the set limit.
Closes TW<20556>
Previous version of the code only connected CD and WP to the
peripheral, in fact the hardware does not use the values of these
signals automatically. This adds code to read CD and WP values when
command is executed and return errors if card is not present, or
write command is executed when WP signal is active.
Ideally suited for generating a binary externally, containing key-value pairs specific
to device manufacturers. Utility allows creation of a binary, compatible
with NVS structure, which can be separately flashed onto a new
partition. This helps device manufacturers set different values for
different devices, e.g. serial numbers, but using a single firmaware
image.
1. Bootloader reads SPI configuration from bin header, so that the burning configuration can be different with compiling configuration.
2. Psram mode init will overwrite original flash speed mode, so that users can change psram and flash speed after OTA. 3. Flash read mode(QIO/DIO…) will not be changed in app bin. It is decided by bootloader, OTA can not change this mode.
4. Add read flash ID function, and save flash ID in g_rom_flashchip
5. Set drive ability for all related GPIOs
6. Check raise VDDSDIO voltage in 80Mhz mode
7. Add check flash ID and update settings in bootloader
8. Read flash ID once and keep in global variable
9. Read flash image header once and reuse the result
Tested cases:
1. Test new and old version of bootloader
boot Flash 20M —> app Flash 80M + Psram 80M
boot Flash 40M —> app Flash 80M + Psram 80M
boot Flash 80M —> app Flash 80M + Psram 80M
boot Flash 20M —> app Flash 80M + Psram 40M
boot Flash 40M —> app Flash 80M + Psram 40M
boot Flash 80M —> app Flash 80M + Psram 40M
boot Flash 20M —> app Flash 40M + Psram 40M
boot Flash 40M —> app Flash 40M + Psram 40M
boot Flash 80M —> app Flash 40M + Psram 40M 2. Working after esp_restart reboot.
* Move smartconfig to its component directory, it should be possible to override
this as whole component
* Fix few header includes related to lwIP networking stack
Signed-off-by: Mahavir Jain <mahavir@espressif.com>
If static task cleanup option is enabled, then before invoking application
defined `vPortCleanUpTCB` hook, pthread specific cleanup is performed.
Signed-off-by: Mahavir Jain <mahavir@espressif.com>