ARM Development Studio IDE CPU Selection Error During Compilation
The error message "C9912E: No –cpu selected" in the ARM Development Studio IDE typically arises during the compilation process when the ARMCC compiler fails to recognize the target CPU architecture. This issue is particularly prevalent when working with ARM Cortex-A5-based SoCs, such as the Cyclone V SoC, and is often tied to the preprocessing of linker scatter files. The scatter file, which defines the memory layout of the application, must be preprocessed by the ARMCC compiler. However, the compiler cannot proceed without a valid CPU specification, leading to the C9912E error.
The error is not merely a superficial configuration issue but points to a deeper integration problem between the ARM Development Studio IDE, the ARMCC compiler, and the target CPU architecture. The CPU type must be explicitly specified in the project settings to ensure that the compiler can generate the correct machine code for the target processor. When this specification is missing or incorrectly configured, the compiler cannot proceed, resulting in the C9912E error.
The issue is further complicated by the use of MDK-Cortex-M licenses, which are designed for Cortex-M series processors. When such a license is used in conjunction with a Cortex-A series processor, the compiler may fail to recognize the CPU type, even if it is correctly specified in the project settings. This mismatch between the license type and the target CPU architecture can lead to the C9912E error, as the compiler is unable to resolve the correct CPU configuration.
Linker Scatter File Preprocessing and MDK-Cortex-M License Mismatch
The root cause of the C9912E error lies in the interaction between the linker scatter file and the ARMCC compiler. The scatter file, which is used to define the memory layout of the application, must be preprocessed by the ARMCC compiler. This preprocessing step is necessary to ensure that the scatter file is correctly interpreted and applied during the linking process. However, the preprocessing step requires that the CPU type be explicitly specified, as the compiler needs to know the target architecture to generate the correct memory layout.
When the scatter file begins with the line #! armcc ...
, the ARMCC compiler is invoked to preprocess the file. However, if the CPU type is not specified, the compiler cannot proceed, resulting in the C9912E error. This issue is particularly common when using MDK-Cortex-M licenses, as these licenses are designed for Cortex-M series processors and may not be compatible with Cortex-A series processors. The mismatch between the license type and the target CPU architecture can prevent the compiler from recognizing the CPU type, even if it is correctly specified in the project settings.
Another potential cause of the C9912E error is the incorrect configuration of the project settings in the ARM Development Studio IDE. The IDE provides a graphical interface for specifying the target CPU architecture, but this configuration may not be correctly applied if the project settings are not properly saved or if there are conflicts between different configuration files. In some cases, the IDE may fail to update the project settings, leading to the C9912E error during compilation.
Resolving CPU Specification and Scatter File Preprocessing Issues
To resolve the C9912E error, the first step is to ensure that the CPU type is correctly specified in the ARM Development Studio IDE. This can be done by navigating to the project settings and explicitly selecting the target CPU architecture. For a Cyclone V SoC with an ARM Cortex-A5 processor, the CPU type should be set to "Cortex-A5" in the project settings. It is also important to ensure that the project settings are correctly saved and applied before proceeding with the compilation.
If the CPU type is correctly specified but the error persists, the next step is to check the linker scatter file. The scatter file should begin with the line #! armcc ...
to ensure that it is preprocessed by the ARMCC compiler. However, this line should be followed by the correct CPU specification, such as --cpu=Cortex-A5
, to ensure that the compiler can recognize the target architecture. If the CPU specification is missing or incorrect, the scatter file should be updated to include the correct CPU type.
In cases where the C9912E error is caused by a mismatch between the MDK-Cortex-M license and the target CPU architecture, the license should be updated to match the target processor. This may involve purchasing a new license that is compatible with Cortex-A series processors or updating the existing license to include support for the target architecture. Once the license is updated, the ARM Development Studio IDE should be restarted to ensure that the new license is correctly applied.
Finally, if the error persists despite the above steps, it may be necessary to manually specify the CPU type in the command line arguments for the ARMCC compiler. This can be done by adding the --cpu=Cortex-A5
argument to the compiler command line, either directly in the IDE or in a build script. This ensures that the CPU type is explicitly specified, even if the project settings are not correctly applied.
By following these steps, the C9912E error can be resolved, allowing the ARM Development Studio IDE to correctly compile the project for the target CPU architecture. It is important to carefully check the project settings, the linker scatter file, and the license configuration to ensure that the CPU type is correctly specified and recognized by the ARMCC compiler.