7. Optimization¶
How can the memory size be reduced ?
- If DLE is not required set the
CFG_MAX_TX_PACKET_LENGTH
andCFG_MAX_RX_PACKET_LENGTH
to the minimum value, which is 27:- File location:
projects/target_apps/ble_examples/your_application/src/config/da1458x_config_advanced.h
- Check the following:
- File location:
#define CFG_MAX_CONNECTIONS (1)
#define CFG_MAX_TX_PACKET_LENGTH (27)
#define CFG_MAX_RX_PACKET_LENGTH (27)
- SUOTA can be removed if not used.
- Undefine the
CFG_TRNG
flag to compile out the TRNG module if it is not requiredprojects/target_apps/ble_examples/ble_app_barebone/src/config/da1458x_config_advanced.h
- Decrease reserved data RAM size by selecting the appropriate size for the
retention_mem_area0
data. This size is controlled using theCFG_RET_DATA_SIZE
flag. Its value defines theRET_DATA
address, which is the base address of the system’s retained data. The selected value depends on the application. - Development debug flag can be undefined.
- File location:
projects/target_apps/ble_examples/prox_reporter/src/config
- Check the following:
#define CFG_DEVELOPMENT_DEBUG
- If
UART2
is not required (used only for debugging) then you can undefine theCFG_PRINTF
flag and reduce further the used RAM size. - Check KEIL MDK-ARM for how to optimize your code for best performance or smallest code-size. You can refer to this ARM application Note MDK-ARM Compiler Optimizations