Files
FreeRTOS/tools/memory_estimator/README.md
Gaurav-Aggarwal-AWS 2acb08be81 Add support for generating JSON report (#81)
Add support for generating JSON report

Passing -g option will generate a JSON file containing size information
about all the libraries.

It also adds the support to patch source code before calculating size and
revert the patch afterwards. This should ideally be not needed as we should
be able to control all the configurations via config files. OTA currently defines
the logging level in a header file as opposed to taking it from a config file.
As a result, we need to patch the header file before calculating the size as
we want to turn off logging while calculating size. Later when logging
level is moved to a config file, it will not be needed and we will turn
off logging in the header file contained with the memory estimator tool.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2020-06-05 13:10:51 -07:00

28 lines
1.4 KiB
Markdown

# MemoryEstimator
This utility helps in determining the memory estimates for FreeRTOS libraries.
# Usage
```
python memory_estimator.py -p <path_to_freertos_lts_directory> -o <optimization> -l <library_name>
```
Where:
* `<path_to_freertos_lts_directory>` is the path to the directory containing FreeRTOS LTS source code.
* `<optimization>` is the compiler optimization level (O0, Os etc).
* `<library_name>` is the library to calculate the memory estimates for.
# Options
| Short Name | Long Name | Default |Description |
| ---------- | --------- | ------- | ---------- |
| -p | --lts-path | | Path to the directory containing FreeRTOS LTS code. |
| -o | --optimization | O0 | Compiler optimization level (O0, Os etc). |
| -l | --lib | `mqtt` | The library to calculate the memory estimates for. Currently supported libraries are: `mqtt`, `light-mqtt`, `https`, `shadow`, `jobs`, `ota-mqtt`, `ota-http`, `kernel`|
| -c | --compiler | arm-none-eabi-gcc | Compiler to use. |
| -s | --sizetool | arm-none-eabi-size | Size tool to use. |
| -d | --dontclean | | The generated artifacts, which include the generated Makefile and built object files, are deleted by default. Pass `-d` to ensure that the generated artifacts are not deleted. |
| -g | --generate-report | | Pass `-g` to generate a JSON report containing sizes for all libraries. If this option is used, values for `--optimization`, `--lib` and `--dontclean` are ignored. |