Debug with Arm DS¶
Install Arm DS¶
Please refer to the official Arm Development Studio Page 1 for details. Here
Version: 2020.b Build: 2020110909 is used in the following example.
Download Arm FVP BaseR AEMv8-R¶
Please refer to official FVP page 2 for download instructions. Here $FVP_D
is used to indicate which directory is FVP located.
Use DS perspective¶
From menu choose Window -> Perspective -> Open Perspective -> Other...:
In the opened window, choose Development Studio (default):
Create a new configuration database¶
Create a new configuration database by selecting File -> New -> Other... -> Configuration Database:
Choose a name for the database. Here Zephyr is used:
Click Finish and the new configuration database can be seen in Project Explorer:
Create a new model configuration¶
Right click Zephyr in Project Explorer, choose New -> Model Configuration:
In the opened window:
Choose
IrisforModel Interface, thenNext >.Choose
Launch and connect to specific model, thenNext >.Set
Model Pathto$FVP_D/FVP_BaseR_AEMv8R, thenFinish.
Then in FVP_BaseR_AEMv8R tab, change ARMAEMv8-R_ to V8R64-Generic,
click Save and then click Import:
Create a new launch configuration¶
From Project Explorer, right click FVP_BaseR_AEMv8R and select Debug as -> Debug configurations...:
Select Generic Arm C/C++ Application and click New launch configuration button.
A new configuration named New_configuration will be created.
In
Connectiontab:In
Select targetbox, selectImported -> FVP_BaseR_AEMv8R -> Bare Metal Debug -> ARMAEMv8-R_MP_0In
Connectionsbox, setModel parametersto:-C bp.dram.enable_atomic_ops=1 -C bp.sram.enable_atomic_ops=1 -C bp.refcounter.non_arch_start_at_default=1 -C gic_distributor.GICD_CTLR-DS-1-means-secure-only=1 -C gic_distributor.has-two-security-states=0 -C bp.vis.disable_visualisation=1 -C cluster0.has_aarch64=1 -a /home/fengqi/zephyrproject/build/zephyr/zephyr.elf
These parameters are passed to
FVP_BaseR_AEMv8Rwhen launches. RunFVP_BaseR_AEMv8R --helpto see all command line options. RunFVP_BaseR_AEMv8R --list-paramsto see all supported parameters. The filezephyr.elfspecified by-ais the binary built from Zephyr.
In
Filestab:In
Filesbox, setLoad symbols from fileto full path ofzephyr.elfthat you built.
In
Debuggertab:In
Run controlbox, checkExecute debugger commandsand insert:add-symbol-file "/home/fengqi/zephyrproject/build/zephyr/zephyr.elf" EL1S:0
Replace
/home/fengqi/zephyrproject/build/zephyr/zephyr.elfwith your local path.In
Pathsbox, setSource search directoryto the path to Zephyr source code.
After all these changes are made, click Apply, then click Debug. DS will
launch FVP_BaseR_AEMv8R and connect to it. You can see a new session is
connected in Debug Control window.