Whilst we recommend using the CrossCore Embedded Studio GUI for your development work, there are some occasions where you may find command line access useful such as build automation. This page contains a list of frequently asked questions about command line support for the Cortex-M processor families.
How do I install CrossCore Embedded Studio from a command line?
Download the latest CCES release from http://analog.com/cces
Linux (Ubuntu)
CCES is officially supported for the 32-bit variants of Ubuntu 14.04 and 16.04. It may also work on other flavours of Debian but will not be officially supported.
If you are using an unsupported 64-bit OS you'll need to ensure you have support for the 32-bit architecture with the following commands:
$ sudo dpkg --add-architecture i386
$ sudo apt update
$ sudo apt install libc6:i386 libstdc++6:i386
To install, run the following command to install:
$ sudo dpkg -i ${CCES-INSTALLER}.deb
CCES will be installed to:
/opt/analog/cces/${VERSION}/
You can uninstall CCES using the following commands:
$ sudo dpkg -r adi-cces-${VERSION}
$ sudo dpkg -P adi-cces-${VERSION}
$ sudo rm -rf /opt/analog/cces/${VERSION}
Windows
On Windows, run the following command to install:
> ./ADI_CrossCoreEmbeddedStudio-Rel${VERSION}.exe /S /V"/qn INSTALLDIR=\"${INSTALL_PATH}\""
CCES can be uninstalled via the uninstall link in the start menu, or via the control panel.
What CMSIS pack files do I need?
There are a few pack files required for development of the Cortex-M series processors.
First, to make use of the CMSIS support, you need the core ARM CMSIS support (ARM.CMSIS.4.5.0 or later).
When developing for a processor family, you'll need the device family pack (DFP) for that device family, which contains all of the configurations required to build and debug for that family of processors. For example, if developing for the ADuCM3029, you'll need the ADuCM302x device family pack (AnalogDevices.ADuCM302x_DFP.x.y.z.pack).
Additionally, if you are developing using an evaluation platform from ADI (EZ-Kit, COG, CUP) then you'll need the appropriate board support pack (BSP) for the board, which contains examples and drivers for off-chip peripherals provided on the board. For example, if you are using the EV-COG-AD3029LZ evaluation platform, then you'd need the EV-COG-AD3029 BSP (AnalogDevices.EV-COG-AD3029LZ_BSP.x.y.z.pack).
The CMSIS pack files have support for dependencies, so you should be prompted to install any missing pack files.
How do I install CMSIS pack files from the web?
To install a pack from the web, first identify the pack name by visiting http://keil.com/pack and finding the pack you want to install. The pack name is the filename with the .pack extension on the top row of the expanded tab, but without the .pack extension. For example, the pack file for the ADuCM302x Device Family Pack is "AnalogDevices.ADuCM302x_DFP.2.0.0".
To install directly from the web, use the following command:
${CCES}/Eclipse/cces -nosplash -consoleLog -application com.arm.cmsis.pack.installer -installPack ${PACK_NAME}
How do I install a pack file from my local filesystem?
To install a locally downloaded pack, use the following command:
${CCES}/Eclipse/cces -nosplash -consoleLog -application com.arm.cmsis.pack.installer -importPack ${PACK_FILE}
How do I remove a pack file I have installed?
To remove a pack, use the following command:
${CCES}/Eclipse/cces -nosplash -consoleLog -application com.arm.cmsis.pack.installer -deletePack ${PACK_NAME}
How do I see what CMSIS packs are installed from a command line?
There is no command line support for determining which pack files have been installed, however the pack structures will be installed into
${CCES}/ARM/packs/AnalogDevices/
Where the first level directory is the pack name and the second level is the pack version e.g.
ADuCM302x_DFP/2.0.0/
On Linux, you can get a full list of pack and versions in CCES 2.7.0 with the following ls command:
$ ls /opt/analog/cces/2.7.0/ARM/packs/AnalogDevices/*
/opt/analog/cces/2.7.0/ARM/packs/AnalogDevices/ADuCM302x_DFP:
2.0.0
/opt/analog/cces/2.7.0/ARM/packs/AnalogDevices/EV-COG-AD3029LZ_BSP:
1.0.0
On Windows, you can get a full list of pack files (without versions) with the following command:
> dir C:\analog\cces\2.7.0\ARM\packs\AnalogDevices\ /ad /b
ADuCM302x_DFP
EV-COG-AD3029LZ_BSP
How do I build an existing project from the command line?
To invoke the dependency, makefile generation and build process, you need to invoke the headless builder with the following commands.
On Linux:
$ /opt/analog/cces/2.7.0/Eclipse/cces -nosplash -consoleLog -application com.analog.crosscore.headlesstools \
-data ~/cces/cmdline/ -project ~/cces/cmdline/MyProject/ -build all
On Windows:
> C:\analog\cces\2.7.0\Eclipse\ccesc -nosplash -consoleLog -application com.analog.crosscore.headlesstools \
-data C:/path/to/workspace -project C:/path/to/project -build all
Where:
-data is the path to the workspace you want to build from
-project is the path to your project
-build identifies the configuration to build, or "all" to build all configurations. Configuration name is case insensitive.
When a project has been built, and you haven't changed any settings or added/removed any files, you can invoke the makefiles directly from your build area.
To do this, add the code generation tools location to your path
You can also use the makefile support generated by a project build to build directly.
First, ensure the ARM/gcc-arm-embedded/bin directory in your CCES install is in the PATH environment variable.
On Linux, you can use 'export' in your script or .bashrc:
$ export PATH=${PATH}:/opt/analog/cces/2.7.0/ARM/gcc-arm-embedded/bin/
On Windows, you can use the 'set' command or the "Advanced System Settings" GUI:
> set path "%PATH%;C:\analog\cces\2.7.0\ARM\gcc-arm-embedded\bin"
Then cd into your output directory, where you can invoke the following make commands:
"make all" to perform a full build of anything that's changed since the previous build.
"make clean" to perform a clean, which deletes any temporary/generated files allowing for a full build to be carried out.
Note: If you change any project settings or add/remove files, this won't be reflected in the makefiles unless you invoke the headless builder again. You can modify the makefiles directly but they will be overwritten if the headless builder is used.
How do I create a new project from the command line?
There is currently no support to create a CMSIS project from CCES via the command line. We're looking to add this in the future.
Currently your only options are to create the project under the CCES GUI, or to write a makefile based project.
How do I debug from the command line?
Debugging from the command line involves 2 components: OpenOCD (which handles the connection to the device) and gdb (which provides the debug interface)
Invoking OpenOCD
The OpenOCD command requires two configuration files (specified with the -f switch) : one for the target (CMSIS-DAP, ICE-2000, etc) found in:
${CCES}/ARM/openocd/share/openocd/scripts/interface/
and one for the target, found in the appropriate Device Family Pack under
${CCES}/ARM/packs/AnalogDevices/${DFP}/${DFP_VERSION}/openocd/scripts/target/.
You also need to include both scripts directories (specified with the -s switch):
${CCES}/ARM/openocd/share/openocd
${CCES}/ARM/packs/AnalogDevices/${DFP}/${DFP_VERSION}/openocd/scripts
You then need to invoke OpenOCD with "-c init" and an adapter speed.
Your full openocd command will therefore look something like this:
On Linux:
$ /opt/analog/cces/2.7.0/ARM/openocd/bin/openocd \
-f /opt/analog/cces/2.7.0/ARM/openocd/share/openocd/scripts/interface/cmsis-dap.cfg \
-f /opt/analog/cces/2.7.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/2.0.0/openocd/scripts/target/aducm3029.cfg \
-s /opt/analog/cces/2.7.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/2.0.0/openocd/scripts \
-s /opt/analog/cces/2.7.0/ARM/openocd/share/openocd/scripts \
-c init -c "adapter_khz 1000"
On Windows:
C:\analog\cces\2.7.0\ARM\openocd.exe \
-f C:\analog\cces\2.7.0\ARM\openocd\share\openocd\scripts\interface\cmsis-dap.cfg \
-f C:\analog\cces\2.7.0\ARM\packs\AnalogDevices\ADuCM302x_DFP\2.0.0\openocd\scripts\target\aducm3029.cfg \
-s C:\analog\cces\2.7.0\ARM\packs\AnalogDevices\ADuCM302x_DFP\2.0.0\openocd\scripts \
-s C:\analog\cces\2.7.0\ARM\openocd\share\openocd\scripts \
-c init -c "adapter_khz 1000"
Connecting via GDB
First, launch gdb.
On Linux:
/opt/analog/cces/2.7.0/ARM/gcc-arm-embedded/bin/arm-none-eabi-gdb
On Windows:
C:\analog\cces\2.7.0\ARM\gcc-arm-embedded\bin\arm-none-eabi-gdb.exe
Then use the 'target' command to connect to the OpenOCD session
(gdb) target remote localhost:3333
You can then use the standard gdb commands to manipulate your debug session, such as:
'load' command to load your executable
(gdb) load /path/to/executable
'continue' command to start running your application.
(gdb) continue