-
Notifications
You must be signed in to change notification settings - Fork 1.1k
NimBLE AFR update and provision to use IRAM memory as 8-bit addressable memory region #1713
Conversation
This PR depends on FreeRTOS/FreeRTOS-Kernel#9 as well as #1709 |
1890643
to
85bb7a1
Compare
1887387
to
5776384
Compare
/bot run checks |
5776384
to
0730662
Compare
Verified the nimble changes by running the tests. To enable RPA feature , it also requires the fix mentioned in this PR: apache/mynewt-nimble#790 |
@ravibhagavandas Requested change will be followup commit, so we can merge this PR interim. @prasad-alatkar Please confirm. |
@ravibhagavandas @mahavirj Yes, I am planning a new PR for this commit along with other changes (under progress). |
/bot run checks |
/bot run checks |
1 similar comment
/bot run checks |
Hello, Can you try re-basing your branch to the latest master branch? It seems some files unrelated to this PR are causing the style check to fail. Thank you |
0863aeb
0730662
to
0863aeb
Compare
/bot run checks |
/bot run checks |
Hello, Apologies for the inconvenience. This PR fixes the styling issue #1961. So one last rebase should do the trick. I will continue to investigate what has caused the issues to surface with this particular PR. |
Added IRAM allocation provision under nimble_platform_mem_malloc()
"Internal IRAM" strategy allocates in/out buffers in IRAM thus saving memory in DRAM. To select this strategy: idf.py menuconfig -> Component config -> ESP32 Specific -> Enable IRAM as 8 bit accessible memory idf.py menuconfig -> Component config -> mbedTLS -> Memory allocation strategy -> Internal IRAM
0863aeb
to
5671ca8
Compare
/bot run checks |
1 similar comment
/bot run checks |
…le memory region (aws#1713) * NimBLE AFR: Update esp-idf submodule to include Host based Privacy (RPA) * NimBLE AFR: Add support to IRAM allocation strategy Added IRAM allocation provision under nimble_platform_mem_malloc() * esp32/mbedtls: Added in/out buffer allocation strategy "Internal IRAM" strategy allocates in/out buffers in IRAM thus saving memory in DRAM. To select this strategy: idf.py menuconfig -> Component config -> ESP32 Specific -> Enable IRAM as 8 bit accessible memory idf.py menuconfig -> Component config -> mbedTLS -> Memory allocation strategy -> Internal IRAM Co-authored-by: Prasad Alatkar <prasad.alatkar@espressif.com>
Description
Add Host based Privacy feature support:
This feature removes dependency on controller to use privacy (RPA).
Add support to configure RPA Timeout from menuconfig (default is 15 minutes)
How to use this feature:
ble_hs_pvcy_rpa_config()
own_addr_type
needs to be set to BLE_ADDR_RANDOM while advertising/scanning.Apart from 'Host based privacy', this PR has few miscellaneous feature and fixes.
Apart from 'Host based privacy', this PR has few miscellaneous feature and fixes.
Use IRAM as Data memory
IRAM
in ESP32 is 32-bit addressable memory region and performing any unaligned (8-bit or 16-bit) load/store instructions on this region results in eitherLoadStoreError
orLoadStoreAlignment
exception.With the LoadStore exception handlers in place (inside
freertos-kernel
), IRAM can be used as 8-bit addressable memory region to store data. Performing unaligned access in IRAM will incur a maximum penalty of 167 cpu cycles.Dynamic memory allocation:
-- Use dynamic buffers instead of static memory.
-- Added IRAM allocation provision under
nimble_platform_mem_malloc()
.Allocate mbedTLS buffers in IRAM:
-- Allocate mbedTLS input and output buffers in the IRAM region thus saving ~12kB (with the default configuration) in DRAM.
To enable this strategy,
idf.py menuconfig -> Component config -> ESP32 Specific -> Enable IRAM as 8 bit accessible memory
idf.py menuconfig -> Component config -> mbedTLS -> Memory allocation strategy -> Internal IRAM
Checklist:
I have tested my changes. No regression in existing tests.
My code is Linted.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.