ARM DS-5 Development Studio is a suite of tools for editing, compiling, analyzing, and debugging embedded C/C++ software for the ARM architecture. The DS-5 Debugger can be used with virtual prototypes, hardware emulators, FPGA prototypes, and many different ARM boards using a variety of connection methods. DS-5 connects and communicates with models using the Component Architecture Debug Interface (CADI). DS-5 can connect to any model which supports CADI. As an interface, CADI has a few interesting aspects:
One of the benefits of using CADI with models is non-intrusive debugging. With simulated hardware it's easy to read and write register and memory content without any simulation. This ensures that the interactive debugging results are the same as running software with no debugger connected. For more information refer to the CADI Developer Guide.
DS-5 comes with a variety of fixed virtual platforms (FVPs) which utilize CADI to debug software. These models are included in DS-5 and their system descriptions are included in the DS-5 configuration database. There is an existing article describing how to import these models into DS-5, but this article expands on how to import new, custom systems and debug software.
ARM silicon partners are constantly working to create unique systems and software using ARM IP. For engineers working on these projects, creating a unique virtual platform based on ARM Fast Models and starting software development as soon as possible is critical.
Fast Models are great for early software development and can get new projects up and running quickly. Fast Models excel at tasks such as:
Compared to the FVPs included in DS-5, importing custom Fast Model systems into DS-5 is slightly more work to setup, but once the initial configuration is done DS-5 is very easy to connect and use. This article outlines the process and provides some tips to help import custom Fast Model systems into DS-5 and start running and debugging as quickly as possible.
To demonstrate the process, a system with heterogeneous ARM CPUs running different software will be used. The system has a single Cortex-A53 and a quad-core Cortex-R8. Each has different software and a different memory map.
The diagram from the Fast Models System Canvas is shown below. Each CPU has memory and a PL011 UART attached to it for input and output.
The goal is to import the system into DS-5, create debug configurations, and connect and debug the software. It is possible to focus on only one CPU core, one CPU cluster, or debug all of the CPUs at the same time.
The initial setup is a one-time task per system and consists of four steps:
The first step in importing a Fast Model system is to create a new DS-5 configuration database. Most users will be starting from the C/C++ perspective. If this is the case, use:
File -> New -> Other and then select Configuration Database under DS-5 Configuration Database.
Another way is to change to the DS-5 Configuration perspective.
Once this perspective is open the menus change context to make it easier so use:
File -> New -> Configuration Database
Enter a database name and click Finish.
Both methods result in a new configuration database used to hold the new system descriptions.
The next step is to create a model configuration for the system. There are a couple of ways to do this.
One is to use File -> New -> Other and then select Model Configuration under DS-5 Configuration Database.
It can also be done by right clicking on the Configuration Database in the Project Explorer and selecting New -> Model Configuration
This invokes the wizard to import the new system.
First, choose the database created in the previous step and click Next.
There are two options to choose from:
The first option, Launch, tells DS-5 to take care of starting the simulation and connect to the simulation when it starts. DS-5 will also take care of terminating the simulator when instructed to disconnect from the target. Everything can be done from within DS-5 when using this option. To make the connection DS-5 passes two arguments to the simulation: --cadi-server and --print-port-number and expects to be able to use the output from the printed port number to make the CADI connection. The specific model can be an executable or a script, but make sure it gets the arguments passed by DS-5.
The second option, Browse, tells DS-5 to look for an already running simulation and just connect. It also means that simulation must be started manually before DS-5 can connect and when DS-5 disconnects the simulator will not be terminated.
Select the method that best fits the desired use case.
For launching a model browse to the executable or script used to start the simulation. If a script is used make sure to pass the command line arguments sent by DS-5. For example, using bash to do some environment setup and run a simulation called system_sim should add $* to the command name.
#!/bin/bash
<do some environment setup>
./system_sim $*
To use the browse method to connect to a running simulation use the Browse button, select the running simulation and it will appear in the Model field.
When starting simulations manually make sure to use the –S or –cadi-server because Fast Model simulations don’t enable CADI automatically.
Once the system is identified, DS-5 will query the CADI targets in the system and create a new system description in the form of a model.mdf file.
The Manufacturer Name will be “Imported” unless it is changed before pushing the Import button. This is helpful to remember as there are hundreds of systems which are sorted by Manufacturer. The Manufacturer can be changed as desired.
Normally, there is nothing to change in the model.mdf file. The other tabs have additional customization such as changing how the simulation is launched or logging CADI communication to a file.
Click the Import button and new system will be added to the database of known systems.
DS-5 uses debug configurations to manage connections to target systems. The fastest way to get going is to click Debug after the system is imported. This will create a debug configuration with the imported system. There are a number of options. For this example, the first configuration is for bare metal debugging of the quad core Cortex-R8 cluster. Select ARM_Cortex-R8x4 SMP Cluster 1.
The Files tab can be used to specify the software to load. It can be from the file system or from a C/C++ project workspace. If the image has already been loaded by the virtual platform, the Load Symbols from file is a good option since there is no need to write the image to target memory.
The Debugger tab can be used to either debug from the image entry point or debug from a symbol such as main. Usually the “Debug from entry point” is the best option for bare metal software development.
Use Apply to save at any time and the Debug button to connect to the target.
If it’s only necessary to debug one core or one cluster DS-5 is now connected and ready to use.
Right click to disconnect as connect as needed keeping in mind the previously described choices of launching the simulation or connecting to an already running simulation.
When DS-5 is restarted all that is needed is to open the Debug perspective and right click the connection and connect.
Since the example system also includes a Cortex-A53 CPU another debug configuration can be created to connect to it. This time select the Cortex-A53 from the imported system. This enables the ability to set a different software image on the Cortex-A53.
Another tip is to copy the first debug configuration and just change the software image and the CPU to connect to. To copy a debug configuration use Run -> Debug Configurations to open the debug configurations and right click the existing configuration and select “Duplicate”. This will guarantee that everything else is the same.
Now DS-5 can connect to the Cortex-R8 cluster, the Cortex-A53, or both. Of course, if only one of the debug configurations is connected it means the other may not get any software loaded.
The DS-5 debug perspective will show both connections and all DS-5 windows will be linked to the selected CPU context.
DS-5 is an excellent debugger for ARM software development. Because it is capable of connecting to many different target types, it takes a little more setup to import and connect to a custom ARM Fast Model system simulation. Hopefully, this article provided some additional insight about how to quickly import a new system description and get connected. Once the system import has been completed the connection process is a simple two clicks.
The primary benefit of DS-5 is a single, synchronized view of all cores in the system. This makes understanding multi-core systems much more manageable compared to connecting a debugger to each core and trying to manage multiple debug windows. DS-5 also offers powerful scripting, familiar command line prompt, OS and RTOS awareness, and understands exceptions levels and complex breakpoints. If you are debugging software on Fast Models and need more insight into what is happening give DS-5 a try.
here are more detailed messages
exception stack trace:
java.lang.Exception at com.arm.debug.configdatabase.modelconfig.gui.pceditor.CdbImportProgress.run(CdbImportProgress.java:142) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:463) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:371) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:500) at com.arm.debug.configdatabase.modelconfig.gui.pceditor.PlatformConfigEditPart.performImport(PlatformConfigEditPart.java:3546) at com.arm.debug.configdatabase.modelconfig.gui.pceditor.PlatformConfigEditPart.access$6(PlatformConfigEditPart.java:3540) at com.arm.debug.configdatabase.modelconfig.gui.pceditor.PlatformConfigEditPart$3.widgetSelected(PlatformConfigEditPart.java:468) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4481) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1329) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3819) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3430) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:694) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at org.eclipse.equinox.launcher.Main.run(Main.java:1515) at com.arm.workbench.Hook.run(Hook.java:487)
session data:
eclipse.buildId=4.5.2.M20160212-1500java.version=1.8.0_45java.vendor=Oracle CorporationBootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=zh_CNFramework arguments: -product com.arm.ds.ceCommand-line arguments: -os linux -ws gtk -arch x86_64 -product com.arm.ds.ce
my ds5 version
DS-5 Community EditionVersion: 5.27.0Build number: 5270014
i followed your steps, but failed at "Importing the system", after I clicked the import button, the ds5 got error messages as "CDB import error null" in error log, can you give some advice on this issue?
hi jason