Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
  • Groups
    • Research Collaboration and Enablement
    • DesignStart
    • Education Hub
    • Innovation
    • Open Source Software and Platforms
  • Forums
    • AI and ML forum
    • Architectures and Processors forum
    • Arm Development Platforms forum
    • Arm Development Studio forum
    • Arm Virtual Hardware forum
    • Automotive forum
    • Compilers and Libraries forum
    • Graphics, Gaming, and VR forum
    • High Performance Computing (HPC) forum
    • Infrastructure Solutions forum
    • Internet of Things (IoT) forum
    • Keil forum
    • Morello Forum
    • Operating Systems forum
    • SoC Design and Simulation forum
    • 中文社区论区
  • Blogs
    • AI and ML blog
    • Announcements
    • Architectures and Processors blog
    • Automotive blog
    • Graphics, Gaming, and VR blog
    • High Performance Computing (HPC) blog
    • Infrastructure Solutions blog
    • Innovation blog
    • Internet of Things (IoT) blog
    • Operating Systems blog
    • Research Articles
    • SoC Design and Simulation blog
    • Tools, Software and IDEs blog
    • 中文社区博客
  • Support
    • Arm Support Services
    • Documentation
    • Downloads
    • Training
    • Arm Approved program
    • Arm Design Reviews
  • Community Help
  • More
  • Cancel
Open Source Software and Platforms
Open Source Software and Platforms
Wiki Debugging SCP Firmware
  • Help
  • Jump...
  • Cancel
  • About this wiki
  • Supported platforms
  • Obtaining support
  • +Arm Reference Platforms deliverables
  • +A-class platforms
  • +M-class platforms
  • +R-class platforms
  • +FPGA prototyping boards
  • -Open source software
    • +Linux/Android
    • +Trusted Firmware-A
    • Trusted Firmware-M
    • +EDK II UEFI
    • OP-TEE
    • +U-Boot
    • Robotics
    • Mbed OS
    • -SCP
      • Debugging SCP Firmware

Debugging SCP Firmware

This article outlines debugging SCP firmware on RD-N2.
Arm Developer Studio Platinum is required to debug RD-N2 FVP

Download the RD software stack

Follow the guide here to download and set up the software stack.

We will be using `RD-INFRA-2022.03.31` in this guide (FVP version 11.17.33)

Build the software stack

Navigate to where you insalled the software stack (~/rd-infra/ in this guide) and run the build-test-uefi script.
 
./build-scripts/build-test-uefi.sh -p rdn2 all

Leave the model running while we connect Arm DS

Set up the model for debugging

Modify model-scripts/rdinfra/platforms/rdn2/run_model.sh

Remove -R from the PARAMS= section. Removing this will make the model wait for the debugger to connect before execution

Run the model

 
cd model-scripts/rdinfra
export MODEL=~/FVP_RD_N2/models/Linux64_GCC-9.3/FVP_RD_N2
./uefi.sh -p rdn2 MODEL=~/FVP_RD_N2/models/Linux64_GCC-9.3/FVP_RD_N2

~/FVP_RD_N2 is the path where the FVP was installed in the RD infra installation guide

Connect the model to Arm DS

Create a new debug configuration

Open Arm DS

In the Debug Control window, click on the menu icon and select "New Debug Connection..." 

Select "Model Connection" and click next

Create a name for the connection. We will call it "RDN2 SCP" and click next

Select "Add a new model"

In the new window which appears, select CADI and click next

Select "Browse for model running on localhost" and click next

Select "System Generator:RD_N2" This will only appear while the FVP_RD_N2 window is open when running the model

Click Finish on both windows

In the edit configuration window which appears we need to select which core to debug.

Under Connection -> Select Target -> Imported -> RD_N2 -> Bare Metal Debug we can see all the cores available in our model

We are only interested in the Cortex M7 cores, which are the MCP and SCP.

Select Arm_Cortex-M7_1

Under Files select Load Symbols from file, File System, and select the SCP RAMFW ELF file, located at `scp/output/rdn2/0//scp_ramfw/bin/rdn2-bl2`

Select apply then debug

DS will now connect to the model and start debugging

Setting breakpoints

As we have loaded the ELF file, we can set breakpoints in the source code. To set a breakpoint, open the file in DS and double click next to the line number.

Then select Continue in the debug control panel and the model will break on your breakpoint.

You can find the UART output of the module in the SCP UART window.




  • Share
  • History
  • More
  • Cancel
Related
Recommended