Using the memory optimized libraries

During evaluation of the library it is recommended to use the Full Version of the library ([Library_INSTALL_DIR]/lib/USS_optimized/). The full version of the library allows users to evaluated different algorithms performance. Once users have determined the optimal algorithm option for their application. Users can take advantage of the memory optimized library which are available under [Library_INSTALL_DIR]/lib/USS_optimized/.

Mem\_opt\_libs

Fig. 10 Mem_opt_libs

Linking memory optimized library to template example project

The library template examples by default links to the full version of the library. the table below indicates the different algorithm options supported for AToF, DToF and VFR calculations by each library.

Library Option USS_Alg_AbsToF_Calculation_Option_lobe USS_Alg_AbsToF_Calculation_Option_hilbert USS_Alg_AbsToF_Calculation_Option_lobeWide USS_Alg_AbsToF_Calculation_Option_hilbertWide USS_Alg_dToF_Calculation_Option_estimate USS_Alg_dToF_Calculation_Option_water (Obsolete) USS_Alg_volume_flow_Calculation_Option_water (Obsolete) USS_Alg_volume_flow_Calculation_Option_generic
Full Version
Lobe          
Hilbert          
Lobe Wide          
Hilbert Wide          
Lobe wide and Hilbert Wide        

Code Composer Studio

To use a memory optimized library

  1. After importing the library template example, go to <LIB_INSTALL_DIR>/lib/USS_optimized/*/CCS and select the appropriate optimized library.
CCS\_optimized\_libs

Fig. 11 CCS_optimized_libs

  1. Drag and drop the optimized USS_SW_CCS.a into CCS project directory ussSWLib/lib
CCS\_optimized\_libs\_drag\_drop

Fig. 12 CCS_optimized_libs_drag_drop

  1. Select Link to files and make link relative to PROJECT_LOC
CCS\_optimized\_libs\_link

Fig. 13 CCS_optimized_libs_link

  1. Click on Overwrite
CCS\_optimized\_libs\_overwrite

Fig. 14 CCS_optimized_libs_overwrite

  1. Rebuild the project
CCS\_optimized\_libs\_rebuild

Fig. 15 CCS_optimized_libs_rebuild

IAR

To use a memory optimized library

  1. After importing the library template example, go to <LIB_INSTALL_DIR>/lib/USS_optimized/*/IAR and select the appropriate optimized library.
IAR\_optimized\_libs

Fig. 16 IAR_optimized_libs

  1. Remove existing USS_SW_IAR_small_code_large_data.lib
IAR\_optimized\_libs\_remove

Fig. 17 IAR_optimized_libs_remove

  1. Drag and drop the appropriate *.lib file base on project configuration to ussSWLib
IAR\_optimized\_libs\_drag

Fig. 18 IAR_optimized_libs_drag

To determine the correct code and data model go to the project properties window and click on General Options

IAR\_optimized\_libs\_code\_model

Fig. 19 IAR_optimized_libs_code_model

  1. Rebuild project
IAR\_optimized\_libs\_code\_rebuild

Fig. 20 IAR_optimized_libs_code_rebuild

Memory footprint comparison between optimized libraries

This section includes Code Composer Studio and IAR memory footprints for different library configurations for the following code examples:

  • FR6043_USSSWLib_template_example - Compiled for gas applications using multi tone pulse mode, UART disabled and USS_SW_LIB_APP_MAX_CAPTURE_SIZE = 300.
  • FR6047_USSSWLib_template_example - Compiled for water applications using single tone pulse mode, and UART disabled.

Code Composer Studio

Project Name Lib Configuration FRAM (Bytes) LEA RAM (Bytes) RAM (Bytes)
FR6043_USSSWLib_template_example [Gas] HilbWide 30861 2800 2212
FR6047_USSSWLib_template_example [Water] Lobe 25803 2616 780

IAR

Project Name Lib Configuration FRAM (Bytes) LEA RAM (Bytes) RAM (Bytes)
FR6043_USSSWLib_template_example [Gas] HilbWide 28106 2800 2069
FR6047_USSSWLib_template_example [Water] Lobe 23512 2616 597