Ride7 for ARM RAISONANCE Tools for the STRx and STM32 families Overview and Getting Started July 2007
Table of Contents 1. INTRODUCTION 4 1.1 RAISONANCE tools for the ARM family 6 1.2 Third party tools that can be used in conjunction with Ride7 for ARM 6 1.3 List of supported derivatives 7 1.4 Documentation 7 2. CREATING A PROJECT USING THE GNU TOOLCHAIN 8 2.1 Notes for users of other GCC toolchains 9 2.2 Using the example project 9 2.3 Creating a new project 9 2.4 Using and choosing the boot mode 10 2.4.1 FLASH mode for STR7 11 2.4.2 FLASH mode for STR9 11 2.4.
.4 Using the simulator 18 3.5 Viewing a peripheral 19 3.6 Viewing the Stack 20 3.7 Using breakpoints 21 4. DEBUGGING WITH HARDWARE TOOLS 23 4.1 Selecting hardware debugging tools 24 4.2 RLink-ARM programming and debugging features 25 4.2.1 RLink capabilities 25 4.2.2 Configuring Ride7 for using the RLink 26 4.2.2.1 RLink jumpers 27 4.2.2.2 Instant actions 27 4.2.2.3 JTAG Parameters 28 4.2.3 Hints and Troubleshooting 29 4.2.3.1 Example projects 29 4.2.3.
Introduction 1. Ride7 for ARM Introduction Ride7 for ARM devices is an integrated development environment (IDE), designed for the development of STRx (STR7 and STR9 ARM families) and STM32 (Cortex-M3 family) projects from beginning to end. Ride7 for ARM can be used with a range of development tools including the GNU toolchain, the software-based simulator, the RLink USB to JTAG dongle from RAISONANCE, and (for STRx only) the JTAGjet USB to JTAG dongle from Signum Systems.
Ride7 for ARM Introduction Ride7 for ARM Ride7 is the RAISONANCE Integrated Development Environment. It features an editor /debugger/project manager that is common to several ST microcontroller families of ARM cores, and integrates the GNU GCC toolchain.
Introduction Ride7 for ARM For compiling your application source files, Ride7 fully integrates the GNU GCC toolchain (C Compiler, Assembler and Linker) for ARM® core-based microcontrollers. Then, when debugging your application, you can use the RAISONANCE SIMICE ARM simulator capable of simulating some of the ARM peripherals, or connect to your ARM CPU for programming and debugging with JTAG standard emulators such as RAISONANCE’s RLink or the JTAGJet from Signum Systems. 1.
Ride7 for ARM 1.3 Introduction List of supported derivatives Ride7 for ARM supports most of the existing STRx and STM32 derivatives to various degrees. The up-to-date list of supported derivatives and the limitations to the software simulation can be seen in the Target Options in Ride7. At this time, all the derivatives of the STR71x, STR73x and STR91x sub-families are supported. 1.
Creating a project using the GNU toolchain 2. Ride7 for ARM Creating a project using the GNU toolchain Assembly and C applications can be written using the free GNU toolchain. This chapter gives an overview of how to create an STRx or STM32 project with Ride7. Note about the licenses: The GNU toolchain is under the GPL license, which makes it free of use without royalties, as are some of the files written by RAISONANCE and ST.
Ride7 for ARM 2.1 Creating a project using the GNU toolchain Notes for users of other GCC toolchains There are potential compatibility issues between the different GCC toolchains. Those that we encountered were related to the GCC_EXEC_PREFIX environment variable. If you have this kind of problems, look at the gcc documentation to see the use of this variable. Depending on the other toolchains that are installed, you could have to modify it by hand. 2.
Creating a project using the GNU toolchain Ride7 for ARM Your application project is now created. The Ride7 environment should more or less look like the one shown on the picture below: 2.4 • The “Boot Mode” option (visible in the Advanced ARM Options section on the screenshot above) determines the memory space containing the image of the code that the target executes after a reset. You can select either “FLASH”, “RAM”, or “External Memory”.
Ride7 for ARM Creating a project using the GNU toolchain The FLASH is the “standard” mode, which your application will very probably use in the final product. The RAM mode cannot be used in the final application because the RAM content is modified by a power down. You can debug in FLASH mode, but only 2 breakpoints can be set in the FLASH at a time, so you will probably prefer using RAM mode for debugging with hardware debuggers.
Creating a project using the GNU toolchain 2.4.3 Ride7 for ARM RAM mode This is the “debug” mode, which you will want to use during the development phase of your project for faster hardware debugging. (This mode can also be used with the software simulator, but then it offers no advantage in terms of download/programming time and number of breakpoints). In this mode, the RAM of the STR71x is at 0x20000000 but it is also seen at 0x00000000.
Ride7 for ARM 2.5.1 Creating a project using the GNU toolchain LD Linker Options Ride7 provides some libraries. You can choose to include them or not by (un)selecting the corresponding options. When you are using the Thumb instruction set, or Interworked mode, then the libraries used are the corresponding Thumb libraries. Thumb libraries have the same name as the non-thumb libraries, with “_thumb” appended. 2.5.1.1 General A) Generate MAP file This makes the Linker produce a map file (.MAP).
Creating a project using the GNU toolchain Ride7 for ARM C:\Program Files\Raisonance\Ride\lib\ARM.” directory for the associated script file. For example, if your device is the STR712FR2 and you are in RAM mode, the script generated is called “C:\Program Files\Raisonance\Ride\lib\ARM\ STR71xFx2_RAM.ld”. Please also note that there is no default linker script for the “STRx-TEST” device. Therefore, when you use this virtual device, you must use a custom linker script.
Ride7 for ARM 3. Debugging with the Simulator Debugging with the Simulator Ride7 for ARM provides a simulator capable of simulating the STRx and STM32 cores, and most of their common peripherals. The simulator lets you check your code and the interaction between your code and the peripherals before going on to debug with an emulator. This section shows the basic use of the simulator for STRx and STM32 microcontrollers. However, the interface is the same for all the targets.
Debugging with the Simulator 3.1 Ride7 for ARM About the simulator Ride7 for ARM supports most of the existing STRx and STM32 derivatives to various degrees. For the rest of this section, we will use the example project called “testR7,” found in the standard Ride7 installation directory: C:\Program Files\Raisonance\Ride\Examples\ARM\Test\TestR7.rprj This project uses the “General Purpose Input/Output Port 1” peripheral. It consists of a new empty project to which we added one very simple “main.c” file.
Ride7 for ARM Debugging with the Simulator To launch the simulator, type CTRL–D or select Debug -> Start in the main menu. If your project has not been built, this will be done automatically before launching the simulator. Otherwise the simulator is launched directly. You are now in the simulator. Your Ride7 window looks like the following: 1. The upper part of the Debug tab, which shows the different Data views available on a given microcontroller. To see a specific view, double-click on its name. 2.
Debugging with the Simulator Ride7 for ARM Code: The byte-code located at this address. Mnemonic: The mnemonic corresponding to the byte-code. Code Coverage: The number of times the byte-code at this address has been executed Last action: The most significant effect of the instruction during its last execution. 5. The Debug Output window provides feedback on the status of debugging process. Status information can include errors as well as debugging event logs.
Ride7 for ARM 9. Debugging with the Simulator Clear All breakpoints Clear all the breakpoints set. 10. Project Open the “Project” window. 11. Find in files Pressing this button opens the “Find in files” window allowing the search an expression in files of the project directory. 12. binoculars This will open the search window. 13. Documentation Pressing this button opens the “Documentation” window allowing to open Help html files. 14.
Debugging with the Simulator 3.6 Ride7 for ARM Viewing the Stack You can view the stack by clinking “View”->”Debug Windows” ->”View Call Stack”. This will open this window: It shows the list of functions currently in the stack, allowing you to trace the calls up to the main function or the current Interrupt Service Routine. Double-click on a function in the stack view to place the cursor in the associated source file.
Ride7 for ARM 3.7 Debugging with the Simulator Using breakpoints You can set a breakpoint either in the source file, or in the code view. Make sure that the application is not running (click on “PAUSE”). You can see in the source code, on the left side some lines with colored box (red green and yellow). This means that these lines are code lines where a breakpoint can be set.
Debugging with the Simulator Ride7 for ARM Then, click on “RUN” button and the application will stop running when this line is reached: Please refer to the Ride7 general documentation for more information about the simulator user interface.
Ride7 for ARM 4. Debugging with Hardware Tools Debugging with Hardware Tools In addition to the RAISONANCE simulator, Ride7 for ARM can be used with a number of hardware debugging tools. RLink and JTAGjet are two USB to JTAG emulators from RAISONANCE and Signum Systems, respectively. From a user interface point of view, basic debugging functions (setting a breakpoint, single-stepping and checking memory and registers) are identical whether you are using the simulator or a hardware debugging tool.
Debugging with Hardware Tools 4.1 Ride7 for ARM Selecting hardware debugging tools Within Ride7, you can choose your target hardware debugger either in the Project Options window if it is opened or with the "Options" -> "Project Properties" menu selecting -> Advanced ARM Options -> "Debug Environment". From the Debug Tool option you can choose between a list of available tools. Ride7 ARM supports RLink or JTAGjet for debugging and programming of STRx and STM32 microcontrollers.
Ride7 for ARM 4.2 Debugging with Hardware Tools RLink-ARM programming and debugging features RLink is a USB to JTAG interface device designed by RAISONANCE. It allows programming and debugging of various microcontrollers, including all the STRx and STM32 microcontrollers supported by Ride7 for ARM. With the STRx and STM32 microcontrollers, RLink uses the JTAG protocol for debugging and programming through the standard 20-point connector defined by ARM.
Debugging with Hardware Tools 4.2.2 Ride7 for ARM Configuring Ride7 for using the RLink After selecting RLink ARM as your debugging tool (see the section, "Selecting hardware debugging tools"), click on the "Advanced Options" button to open the Debug options dialog box shown below. To debug your application, make sure that Debug is checked as shown below. Uncheck the Debug option if you want to use RLink as a simple programmer, e.g. if you want to try the application on the ARM without debugging it.
Ride7 for ARM Debugging with Hardware Tools 4.2.2.1 RLink jumpers When using a starter kit’s embedded RLink (no plastic casing), ensure that your jumpers are set correctly on the RLink. To do this, click on "View RLink jumper configuration for STRx". The following illustrations showing the STRx configuration for the RLink jumpers is displayed: Note: If the pictures in this document differ from those in Ride7, assume that those shown in Ride7 are correct.
Debugging with Hardware Tools Ride7 for ARM • "Connect to RLink and read serial number" is useful for checking that RLink is working and properly connected and that the USB driver is correctly installed. It also allows you to read the RLink serial number, which you will be asked for if you contact our support team.
Ride7 for ARM 4.2.3 Debugging with Hardware Tools Hints and Troubleshooting 4.2.3.1 Example projects The examples in the REva folder of the “Ride” directory are configured for use with the REva evaluation board, which includes the RLink. For standard installations they are found at C:\Program Files\Raisonance\Ride\EXAMPLES\ARM\REva. These examples can also be used with other demonstration and evaluation boards with a standard JTAG connector and the RLink.
Debugging with Hardware Tools 4.3 Ride7 for ARM JTAGjet programming and debugging features Ride7 for ARM also supports the JTAGjet emulator from Signum Systems Corp. Even though very similar in concept and usage, the JTAGjet is considerably faster than the RLINK and offers a real-time trace (ETM) capability. The advanced options for both emulators are the same and have the same functions. The user interface is also the same. JTAGjet is allowed full access to the STRx.
Ride7 for ARM Debugging with Hardware Tools If using the REva board with the ETM connector, you MUST remove the enable jumpers for LEDs D4, D5, D6 and D7, because they would interfere with the trace signals. These 4 LEDs cannot be used by the application while using the trace. 4.3.4.1 The JTAGJet trace window Selecting option “Open Trace Window” will enable trace and open the associated window. This window is designed by Signum, and is the same as the trace window in Signum’s Chameleon debugger.