Friday, August 4, 2017

Reduce Your Application's Footprint

The enormous increase in the use of resource constrained IoT devices, presents an ever increasing challenge to developers to keep the size of their application code within very tight memory limitations. The OSS Time Optimized Encoder/Decoder (TOED) can meet these challenging requirements. It’s not only a high performance encoder/decoder, but when used with specific options, it yields a very small footprint, e.g. 60 kilobytes for a LTE RRC UPER encoder/decoder.

In the latest release (summer 2017) of the OSS ASN.1 Tools, a new feature has been added to reduce the footprint even further. With the new versions of the OSS ASN.1 C (10.5) and ASN.1/C++ (6.5) Tools , you can further reduce the size of your application by controlling the inclusion of error strings in your application. When using the -toed option of the ASN.1/C or ASN.1/C++ compiler, you can define the C manifest constant OSS_REDUCED_ERROR_MSGS when compiling the code generated by the ASN.1 compiler to reduce the runtime error messages to only the error prefix for each error message instead of the complete message. In addition, by defining OSS_DEBUG=0, you can remove the error messages completely.  Since error details will no longer be provided, these options are best be used after you have completed debugging your application.  

The elimination of the array of error strings from your application can significantly reduce the application code size on resource-constrained platforms.  For example, a full error message such as the following:

D0081S: End of input reached before message was fully decoded; check field 'b' (type: INTEGER) of PDU #3 'C'.

would be reduced to the following:


when OSS_REDUCED_ERROR_MSGS is defined. No error message text would be generated at all when OSS_DEBUG=0 is defined.

To give you an example of how much additional footprint reduction you can achieve, our testing of the new feature revealed that the footprint of the application was reduced by 18 kilobytes on  Linux x86 when we C compiled the code generated by the ASN.1 compiler with -DOSS_REDUCED_ERROR_MSGS. Using -DOSSDEBUG=0 further reduced the application footprint by an additional 3-4 kilobytes on the same platform.  Please note that you may achieve different results on your platform, depending on the operating system, processor, and C compiler you use.

While this new feature could be useful to anyone working on embedded devices where memory is precious, we expect that  developers working with 3GPP LTE-M and NB-IoT technologies will find it extremely valuable when developing solutions for Cat-0, Cat-1, Cat-M1, and Cat-NB1 devices.

For more information about the OSS ASN.1/C, OSS ASN.1/C++ Tools, or about this new feature, please click here, or contact