ASF4 and Atmel START Configuration

The ASF4 framework cannot be used as a stand-alone framework, it must be used together with Atmel START. Atmel START contains a code generator that generates ASF4 C-code based on the user's configuration. Atmel START uses two mechanisms to generate the final C-code:

Hardware Configuration

For microcontroller projects, configuration data is normally available before or at the point of compilation. Calculation of register data and resolving of configuration can therefore be calculated at compile time. This will free up flash space and lower the processing power needed to initialize the module. An added benefit of less code in the initialization function is that time spent to get into the main loop will be shorter. A combination of constants set by Atmel START, pre-processor macros, and static functions are used to avoid doing such calculations in the runtime code.

The configuration for each module and each instance of the module is stored statically in configuration files in the config/ folder as #define macros. All configuration parameters have names in uppercase and belong to the "CONF_" namespace, followed by the name of the hardware module, instance, and then the bit or bit field name as spelled in the data sheet. All parameters that are visible in configuration dialogs in Atmel START are annotated with the CMSIS configuration wizard annotation language.

Output from Atmel START

When exporting a project from Atmel START, the output is a single file with an *.atzip extension. This is basically an ordinary zip-file. Renaming it from *.atzip to *.zip allows it to be unzipped with standard zip-tools. This would result in a file tree as shown in the folder structure section shown elsewhere in this manual.

Reconfiguring Output from Atmel START

There may be a need to reconfigure code generated by ASF4 at a later time, for example changing baudrate of a USART, or moving an I/O pin to a new location. If using Atmel Studio as IDE, the ASF4 code can be imported back into Atmel START again and reconfigured by right-clicking on the project name in Project Explorer, and selecting "Re-Configure Atmel Start Project". This will open Atmel START inside a window in Studio, allowing the user to perform the required changes and export the result back into the Studio project. Studio will detect any changed ASF4 files, and attempt to merge them into the original project.

If using other IDEs than Studio, or no IDE at all, an already generated project can be reconfigured by opening the Atmel START webpage, and selecting "Load existing project" from the front page. Use the originally generated *.atzip-file as input file. The project can thereafter be reconfigured and exported anew. Any changes and conflicts between the original and the reconfigured project must be merged manually by the user.

Versioning of ASF4 Code

Atmel START and ASF4 are tightly connected. A specific version of ASF4 code will only run on a compatible version of Atmel START. This may pose problems as an ASF4 code generated with a particular version of Atmel START may not be possible to read back into and reconfigure with newer versions of Atmel START. Since Atmel START is a web-based tool, it may be updated without the user being able to affect the update process.

Future versions of Atmel START will add the concept of versioning, where the web-based Atmel START configurator will support different versions of ASF4.