This document discusses how to use CodeWarrior for PA to debug Linux Kernel on QorIQ PowerPC platforms. It describes how to configure and build Linux Kernel to support CodeWarrior debugging, how to configure CodeWarrior IDE settings to prepare for Linux Kernel debugging, how to debug Linux Kernel in different booting up stages starting from attaching to the running u-boot. 1. Build Linux Kernel for Debugging 2. Create CodeWarrior Project and Set Attach Launch Configuration for debugging 2.1 Import Vmlinux to Create a CodeWarrior project 2.2 Configure the Attach Launch Configuration 3. Debugging Linux Kernel by Attaching to a Running U-Boot 3.1 Debugging Linux Kernel at the entry point 3.2 Debugging the Kernel before the MMU is Enabled 3.3 Debugging the Kernel after the MMU is Enabled
This document uses LS1043ARDB as an example to introduce how to use CodeWarrior for ARMv8 to connect to the bare board to do flash programming, how to use attaching method to debug u-boot and Linux Kernel on QorIQ LS ARM 64 bit target boards. In the document some new features of CodeWarrior for ARMv8 are used, so it is needed to download the latest CodeWarrior Networked Application Suite v2016.01 and install CodeWarrior for ARMv8. 1. CodeWarrior Connects to the Bare Board to do Flash Programing 2. Debug u-boot with CodeWarrior for ARMv8 3. Debug Linux Kernel by Attaching Running U-boot
CodeWarrior for QorIQ related documents are located under CW installation path, like: D:\Freescale\CW_PA_v10.5.1\PA\Help\PDF And some docs in the official website:CodeWarrior Dev Tools for Networked Apps|NXP Knowledge center: Submit Form See below list in this place: QCVS: PBL Configuration using QCVS Debug with CodeWarrior: Debugging Linux Kernel with CodeWarrior for PA Use CodeWarrior for ARMv8 to Debug U-boot and Linux Kernel and Bring up Bare Boards Secure Boot/Debug Configuration for LS1 U-Boot debug on LS1021ATWR Debugging ARMv7 Applications running in an Environment initialized by U-Boot / ROM target debug U-Boot Debug using CodeWarrior for QorIQ LS series – ARM V7 ISA Aurora Trace for CodeWarrior Power Architecture T1040 debug with Codewarrior PA10.3.3 CodeWarrior U-Boot Debugging U-Boot Debug using CodeWarrior for ARMv7 Linux kernel and modules debug using CodeWarrior for ARMv7 Linux application debug using CodeWarrior for ARMv7 and AppTRK Secure Boot/Debug Configuration for LS1 CWTAP/USBTAP: How to use CodeWarrior TAP on LS1024ARDB Connecting Multicore with one TAP How to deal with connection error with CWTAP or USBTAP Using IDcode.tcl and Scanboard Tools: Adding nand flash(MT29F2G08ABBDA) support in CW 10.3 Flash Programmer for CodeWarrior Power Architecture How to install and use eGit plug-in in CodeWarrior.pdf Programing eMMC/SD card using CW for ARMv7 Release and packs: CodeWarrior 10.3 ready now for Power Architecture! CodeWarrior 10.2.1 for Power Architecture...don't miss this! VortiQa, the new magical AIS New Service Pack arrival for Power Architecture! (Windows)~ New Service Pack arrival for Power Architecture! (Linux)~ You'll need this Tips for your brand new CodeWarrior TAP! (Power Architecture) Other: Const_print_prob.zip
1. You should have CodeWarrior TAP( CWH-CTP-BASE-HE )and Probe Tips for LS1024A( CWH-CTP-VSPA-YE ) 2. Install CodeWarrior for QorIQ LS Series ARMv7 ISA Windows v10.0.4 3. Install CodeWarrior patch (LS1024A-2MA_Windows_SP.zip)forLS1024/MA 4. Connect this tool to LS1024A RDB board and run CodeWarrior environment. 5.Start the bootloader and stop it at Barebox command line 6. In CodeWarrior environment File->New->Codewarrior Bareboard project wizard to add a LS1024A project. Run->Debug configuration->Debug 7. Window->Show View->Registers. Only ARM architecture registers you read here. 8. If you want to read peripheral device controller register, please use shell mode Window->Show->Debugger Shell CodeWarrior Debugger Shell v1.0 %> cmdwin::mem <device based address>+offset -s (use command “help cmdwin::mem” to get the detail )
Sometimes you will need to connecting multi-cores for debug or trace purpose. Here is a step by step instruction of connecting Multicore with CodeWarrior for PA through one USBTAP. If you manually creating two projects, one for each core, with same connection configuration, and trying to connect to the same target board, there is no problem when connecting the first core, problem occurs when connecting the second one, you’ll get below error: It complains the connection is already in use, connecting the second core requires closing the previous one. If closing the first core session, the second core could be connected successful. But the purpose is to connecting both cores through same TAP simultaneously. The way for connecting Multicore with one TAP is using the CodeWarrior AMP option: • AMP (one project per core) - Select this option to generate a separate project for each selected core. The option will also set the core index for each project based on the core selection. • AMP (one build configuration per core) - Select this option to generate one project with multiple targets, each containing an lcf file for the specified core. Below are the steps of creating Bareboard project: Select File > New > CodeWarrior Bareboard Project Wizard from the CodeWarrior IDE menu bar. Specify a name for the new project in the Project name text box. Click Next. Select the target processor for the new project from the Processor list. Select Application from the Project Output group. Click Next. Select a supported connection type (hardware, simulator, or emulator), from the Debugger Connection Types group. Select the board you are targeting, from the Board drop-down list. Select the launch configurations, you want to include in your project, and the corresponding connection, from the Launch group. Select the interface to communicate with the hardware, from the Connection Type drop-down list. Click Next. Select the programming language, you want to use, from the Language group. Select a toolchain from the Toolchain group. Select an option from the Floating Point drop-down list, to prompt the compiler to handle the floating-point operations by generating instructions for the selected floating-point unit. Click Next. The Configurations page appears. 12. Select a processing model option from the Processing Model group. See below picture. 13. Select the processor core that executes the project, from the Core index list. Click Next. See below picture. Remember to choose ALL the cores you would like to connect. 14. Click Finish. If choosing the first option, it will create project for each core selecting in “Core index”. Even though the two projects use the same connection configuration, this way allows debugger to connect two projects without problem, see below capture: If choosing the second option, it will create one project only but with configurations for for each core selecting in “Core index”. Even though the two configuration use the same connection configuration, this way allows debugger to connect two sessions without problem, see below capture:
For use of CWTAP/USBTAP with CodeWarrior to connect target board, connection error is the type of issues that happened commonly. How to deal with it? Attached are tips for some general things to check, here assuming target device is Power Architecture, and the tap is USBTAP or CWTAP/USB. For other targets it may be similar in some tips. There might be variable reasons for the connection error, if the common tips in the attachment could not solve the problem, please enable CCS log and post on Freescale community or contact Freescale technical support for help. See attachment for steps to enable logging. Also there are two useful documents in C:\Freescale\CW_PA_v10.4.0\PA\Help\PDF: CodeWarrior TAP User Guide.pdf and USB TAP User Guide.pdf. Welcome any correction and supplement for the tips. Make CodeWarrior connection easier!