Updated libraries (button and audio player) (#16)
This PR updates two dependency libraries to their latest versions: ## espressif/button: v3.5.0 to v4.1.5 [Version 4](https://components.espressif.com/components/espressif/button/versions/4.1.5/changelog?language=en) changed the API. This code makes use of the new API, with no change to the existing behavior. ## chmorgan/esp-audio-player: v1.0.7 to v1.1.0 [Version 1.1.0](https://github.com/chmorgan/esp-audio-player/releases/tag/v1.1.0) introduces the possibility of multiple simultaneous audio streams. This feature is as yet unused by KTag. Co-authored-by: Joe Kearney <joe@clubk.club> Reviewed-on: #16
This commit is contained in:
parent
d86c494d45
commit
89166c8a02
101 changed files with 5845 additions and 2391 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
In ESP-IDF, some functions are put in SRAM when link stage, the reason is that some functions are critical, we need to put them in SRAM to speed up the program, or the functions will be executed when the cache is disabled. But actually, some functions can be put into Flash, here, we provide a script to let the user set the functions which are located in SRAM by default to put them into Flash, in order to save more SRAM which can be used as heap region later. This happens in the linker stage, so we call it as relinker.
|
||||
|
||||
Some SoCs(ESP32-C2 and ESP32-C3) support hardware auto flash-suspend, meaning when reading, writing, or erasing the flash stage, the CPU hardware can switch to run code laying in the flash automatically without any software assist, so that we can link more functions from IRAM to flash.
|
||||
|
||||
## Use
|
||||
|
||||
In order to use this feature, you need to include the needed CMake file in your project's CMakeLists.txt after `project(XXXX)`.
|
||||
|
|
@ -14,28 +16,52 @@ include(relinker)
|
|||
|
||||
The relinker feature is disabled by default, in order to use it, you need to enable the option `CU_RELINKER_ENABLE` in menuconfig.
|
||||
|
||||
Here are the default configuration files in the folder `cmake_utilities/scripts/relinker/examples/esp32c2`, it's just used as a reference. If you would like to use your own configuration files, please enable option `CU_RELINKER_ENABLE_CUSTOMIZED_CONFIGURATION_FILES` and set the path of your configuration files as following, this path is evaluated relative to the project root directory:
|
||||
Here are the default configuration files in the folder `cmake_utilities/scripts/relinker/examples/flash_suspend/XXX (XXX=esp32c2, esp32c3...)` for specific SoC platform when flash_suspend and relinker feature are enabled, please note that the configuration files may be slightly different for different ESP-IDF versions, it's just used as a reference. If you would like to use your own configuration files, please enable option `CU_RELINKER_ENABLE_CUSTOMIZED_CONFIGURATION_FILES` and set the path of your configuration files as following, this path is evaluated relative to the project root directory:
|
||||
|
||||
```
|
||||
[*] Enable customized relinker configuration files
|
||||
(path of your configuration files) Customized relinker configuration files path
|
||||
```
|
||||
|
||||
> Note: Currently only esp32c2 is supported.
|
||||
If you would like to save more RAM, you can try flash-suspend feature, enable options as following:
|
||||
|
||||
```
|
||||
Component config --->
|
||||
SPI Flash driver --->
|
||||
[ ] Use esp_flash implementation in ROM
|
||||
[*] Auto suspend long erase/write operations (READ DOCS FIRST)
|
||||
|
||||
CMake Utilities --->
|
||||
[*] Enable relinker
|
||||
[*] Link specific functions to IRAM regardless of ESP-IDF's behavior
|
||||
```
|
||||
|
||||
> Note: Currently supported platform: esp32c2 and esp32c3.
|
||||
> Note: Before enable flash-suspend, please check if ESP-IDF supports this flash's flash-suspend feature.
|
||||
|
||||
## Configuration Files
|
||||
|
||||
You can refer to the files in the directory of `cmake_utilities/scripts/relinker/examples/esp32c2`:
|
||||
You can refer to the files in the directory of `cmake_utilities/scripts/relinker/examples/$ACTION/XXX ($ACTION=iram_strip, flash_suspend) (XXX=esp32c2, esp32c3...)`:
|
||||
|
||||
- library.csv
|
||||
- object.csv
|
||||
- function.csv
|
||||
|
||||
For example, if you want to link function `__getreent` from SRAM to Flash, firstly you should add it to `function.csv` file as following:
|
||||
1. iram_strip
|
||||
|
||||
```
|
||||
libfreertos.a,tasks.c.obj,__getreent,
|
||||
```
|
||||
For `example/iram_strip`, it includes the functions which you want to relink into Flash after enable the option `CU_RELINKER_ENABLE` and disable the option `CU_RELINKER_LINK_SPECIFIC_FUNCTIONS_TO_IRAM` in menuconfig. If you want to link function `__getreent` from SRAM to Flash, firstly you should add it to `function.csv` file as following:
|
||||
|
||||
```
|
||||
libfreertos.a,tasks.c.obj,__getreent,
|
||||
```
|
||||
|
||||
2. flash_suspend
|
||||
|
||||
For `example/flash_suspend`, it includes the functions which you want to relink into SRAM after enable the options: `SPI_FLASH_AUTO_SUSPEND`, `CU_RELINKER_ENABLE`, `CU_RELINKER_LINK_SPECIFIC_FUNCTIONS_TO_IRAM` in menuconfig. If you want to link function `__getreent` into SRAM no matter its original locations, firstly you should add it to `function.csv` file as following:
|
||||
|
||||
```
|
||||
libfreertos.a,tasks.c.obj,__getreent,
|
||||
```
|
||||
|
||||
This means function `__getreent` is in object file `tasks.c.obj`, and object file `tasks.c.obj` is in library `libfreertos.a`.
|
||||
|
||||
|
|
@ -63,4 +89,14 @@ libfreertos.a,./esp-idf/freertos/libfreertos.a
|
|||
|
||||
This means library `libfreertos.a`'s location is `./esp-idf/freertos/libfreertos.a` relative to `build`.
|
||||
|
||||
If above related data has exists in corresponding files, please don't add this repeatedly.
|
||||
If above related data has exists in corresponding files, please don't add this repeatedly.
|
||||
|
||||
## Test Results Reference
|
||||
|
||||
| Chip | example | | SRAM used (Bytes) | |
|
||||
| -------- | --------------- | ----------------- | ----------------- | --------------------------------- |
|
||||
| | | Default options | Enable relinker | Enable relinker and flash-suspend |
|
||||
| ESP32-C2 | power_save | 101408 | 91728 | 51360 |
|
||||
| ESP32-C3 | power_save | 118728 | 99864 | 58312 |
|
||||
|
||||
All of the above examples are compiled on ESP-IDF Tag/v5.3.2 and version v1.1.0 of `cmake_utilities` component, you can view the memory type usage summary by using `idf.py size`, the above data is for reference only.
|
||||
Loading…
Add table
Add a link
Reference in a new issue