Technical topic: ASN1SCC - ESA's ASN.1 Compiler for safety-critical embedded platforms
ASN1SCC implements a large subset of ASN.1 standards, generating code for (a) C and (b) SPARK Ada. The supported ASN.1 subset includes all the features that do not require the use of heap (dynamic memory). Everything is therefore statically allocated, enabling the use of ASN.1 in embedded, safety-critical platforms.
Unaligned Packed Encoding Rules (uPER) encoders and decoders are generated for each input grammar, providing efficient and compact binary encodings with low memory and CPU footprints. Additionally, ASN1SCC provides ACN, a companion language permitting the specification of legacy encodings. ACN is a (much) simplified version of ECN (Encoding Control Notation), and it very easy to use.
In order to support a certification process, for each input grammar, ASN1SCC generates automatically sets of test cases verifying that the encoding and decoding process work well, providing 100% coverage on all the encoding and decoding logic. The test cases used are automatically computed using the constraints placed on the data types.
In order to support the automatic generation of documentation, ASN1SCC produces ICDs (Interface Control Documents) - HTML formatted in a nice layout that shows how data is physically encoded when using uPER or ACN.
ASN1SCC is fully customizable. It relies on the StringTemplate templating engine, meaning that the every output of the tool can be changed - from type representation to encoding functions and ICD layout.
The tool is developed in a purely-functional manner (in F#) and is actively maintained and supported. ASN1SCC was originally developed by Semantix, now Neuropublic, and is fully funded by the European Space Agency.
The ASN.1 compiler:
- supports Unaligned PER (uPER), ACN (user-controlled) and XER encodings
- creates both C and Ada type declarations and encoders/decoders
- esp. for Ada, it emits SPARK compatible code, that validates under the SPARK suite
- generates HTML or LaTeX documentation
- generates (in combination with TASTE) Python bindings
- generates SQL table definitions (DDL) and fully-functional Python/SQLAlchemy interfaces
Most of the usual ASN.1 types and features are supported:
- ENUMERATED without extensibility marker
- SEQUENCE without extensibility marker
- SEQUENCE OF with a higher size limit
- OCTET STRING with a higher size limit
- BIT STRING with a higher size limit
- IA5String with a higher size limit
- CHOICE without extensibility marker
- SET / SET OF (with size limit)
- AUTOMATIC TAGS
- Parameterized types
The following features from ASN.1 are not supported, either because they are not compatible with embedded platforms, or because they are considered deprecated:
- Extensibility marker (implies the use of malloc), and the EXTENSIBILITY IMPLIED tag
- UTCTime, GeneralizedTime are not supported - we are working on supporting the new DATE-TIME type
- OBJECT IDENTIFIER
- UTF8String (use OCTET STRING or IA5String)
- All "fancy" String types (TeletexString, etc.)
- Anything but AUTOMATIC TAGs (needed by the BER family of encodings)
- Object Information Classes
Sources are on GitHub and can be built on Linux and Windows
Binaries can be found there as well.
Read this article to get a detailed overview of ASN1SCC basic and advanced features.
Check this presentation of ASN1SCC showing the tool in a wider perspective (and introducing ACN)
Check the ACN User Manual to know more about ACN.
Check this detailed and documented example to learn in practice how to use ASN.1 and ACN to model satellite telecommands and telemetries (TM/TC) following ESA's Packet Utilization Standard (PUS)
And if you are using TASTE, check this system example that builds full TM/TCs including CRC and Length fields.
ASN1SCC is released under a GPL license with runtime exception. This means that the runtime (asn1crt.c, acn.c, etc.) is not subject to GPL restrictions and you can link it with your code. The automatically-generated code (types, encoders, decoders, etc.) is also not subject to any license.
The main author of ASN1SCC is George Mamais (Neuropublic).
Additional contributions and maintenance from Thanassis Tsiodras, Maxime Perrotin, Elias Chatzigeorgiou, Konrad Grochowski