7. Optimization

How can the memory size be reduced ?

  1. If DLE is not required set the CFG_MAX_TX_PACKET_LENGTH and CFG_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:
Code 9 Remove DLE feature
#define CFG_MAX_CONNECTIONS (1)
#define CFG_MAX_TX_PACKET_LENGTH (27)
#define CFG_MAX_RX_PACKET_LENGTH (27)
  1. SUOTA can be removed if not used.
  2. Undefine the CFG_TRNG flag to compile out the TRNG module if it is not required projects/target_apps/ble_examples/ble_app_barebone/src/config/da1458x_config_advanced.h
  3. Decrease reserved data RAM size by selecting the appropriate size for the retention_mem_area0 data. This size is controlled using the CFG_RET_DATA_SIZE flag. Its value defines the RET_DATA address, which is the base address of the system’s retained data. The selected value depends on the application.
  4. Development debug flag can be undefined.
  • File location: projects/target_apps/ble_examples/prox_reporter/src/config
  • Check the following:
Code 10 Undefine debug flag
      #define CFG_DEVELOPMENT_DEBUG
  1. If UART2 is not required (used only for debugging) then you can undefine the CFG_PRINTF flag and reduce further the used RAM size.
  2. 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