Raisonance Tools for ARM Raisonance Tools for ARM core-based microcontrollers Getting started Document version 28 September 2011
Raisonance Tools for ARM Contents 1. INTRODUCTION................................................................................................................5 1.1 Purpose of this manual.................................................................................................................... 5 1.2 Scope of this manual....................................................................................................................... 5 1.3 Related documents....................................
Raisonance Tools for ARM 4.4.2 LD linker options..................................................................................................................... 17 5. DEBUGGING WITH THE SIMULATOR..........................................................................20 5.1 About the simulator........................................................................................................................ 20 5.2 Simulator options..................................................................
Raisonance Tools for ARM 8. CONFORMITY.................................................................................................................44 9. GLOSSARY.....................................................................................................................45 10. INDEX............................................................................................................................46 11. HISTORY................................................................................
Raisonance Tools for ARM 1. Introduction 1. Introduction This guide should be used by anyone with an interest in Ride7 for ARM. The new Ride7 and RKit-ARM must be registered to operate correctly. 1.1 Purpose of this manual This manual helps you get started using any of the Raisonance products that are offered by Raisonance’s application development solution for ARM core-based MCUs. It describes how to compile and debug your application or one of the included sample applications.
2. Raisonance tools for ARM overview Raisonance Tools for ARM 2. Raisonance tools for ARM overview Raisonance's integrated development environment, Ride7 for ARM®, interfaces with a range of development tools including: • Editor, debugger and project manager that is common to several ST microcontroller families of ARM cores and which integrates the GNU GCC toolchain. • RKit-ARM. • Software-based simulator. • RLink USB to JTAG dongle from Raisonance.
Raisonance Tools for ARM 2. Raisonance tools for ARM overview 2.3 SIMICE ARM simulator Raisonance's SIMICE ARM simulator can simulate some of the ARM peripherals, or connect to your ARM CPU for programming and debugging with JTAG standard emulators such as: • RLink USB to JTAG dongle from Raisonance, • JTAGjet USB to JTAG dongle from Signum Systems (for STRx devices only). SIMICE ARM is included in RKit-ARM-Lite. It simulates the core (including the entire memory space) and most peripherals.
2. Raisonance tools for ARM overview Raisonance Tools for ARM 2.6 Supported devices and tools 2.6.
Raisonance Tools for ARM 3. How to register the new Raisonance tools for ARM 3. How to register the new Raisonance tools for ARM The new Ride7 and RKit-ARM must be registered to operate correctly. Registration requires a Raisonance hardware product or software product license that is under a valid support contract (a standard support contract expires one year after the date of purchase).
3. How to register the new Raisonance tools for ARM Raisonance Tools for ARM 8. Check your server for an email from Raisonance Support team with the Activation Code. 9. Copy the Activation Code from the email to the Ride7 window. Click Finish. 10. Close Ride7 and open it again. Check in the About Ride7 window that you are in "Lite Suite" for RKit-ARM and "Standard version" for Ride7. Otherwise please contact our technical support (support@raisonance.com). 3.3 Register using a dongle 1. 2. 3. 4.
Raisonance Tools for ARM 4. Creating a project 4. Creating a project Assembly and C applications can be written using the free GNU GCC toolchain. This chapter gives an overview of how to create an ARM project with Ride7. Notes for users of other GCC toolchains: You may have to modify the GCC_EXEC_PREFIX environment variable to rectify compatibility issues between different GCC toolchains. If you have this kind of problem, look at the GCC documentation to see the usage of this variable. 4.
4. Creating a project Raisonance Tools for ARM The Ride7 environment should look like this: Boot Mode option (visible in the Advanced ARM Options) determines the memory space containing the image of the code that the target executes after a reset. You can select FLASH, RAM, or External Memory. For information about boot modes, refer to your device datasheet and the section Boot mode choices. For your first try, choose FLASH.
Raisonance Tools for ARM 4. Creating a project 4.2.2 Using Phyton CMC-ARM Compiler Kit (Enterprise version) To select a different third party compiler tool, in the Application Options, select ARM toolset > Build toolset > Phyton tools. The Compiler, Assembler and Linker sections are all used in a similar way: Enter a build command line for each of the tools. Each tool command line should be composed of the following elements: • It must start with the tool name with its full (system-dependent) path.
4. Creating a project Raisonance Tools for ARM Here is an example of Phyton CMC-ARM Compiler Kit commands: 4.2.2.1 Startup code When using the Phyton CMC-ARM Compiler Kit, you must provide your own application startup file. The automatic startup builder is available only for the GNU tools. Example startup files are provided with the Phyton CMC-ARM Compiler Kit in order to help you in this process. 4.2.2.
Raisonance Tools for ARM 4. Creating a project 4.3 Boot mode choices After a reset, the ARM microcontrollers start executing the code at address zero: • For the STR71x, STR75x and STM32x, this code is an image of one of the other memory spaces – Flash, RAM, or External Memory. The boot mode is determined by the state of specific pins at reset. See your device datasheet for more information. • For the STR73x, STR91x, and LPCxx, only the Flash can be mapped at 0.
4. Creating a project Raisonance Tools for ARM For the STR75x, the RAM is physically at 0x40000000 but it is also seen at 0x00000000. For the STR91x, the RAM is physically at 0x04000000. The reset and interrupt vectors are placed in the Flash and jump to some RAM addresses. • For the STM32, the RAM is physically at 0x20000000. • For the LPCx, the RAM is physically at 0x40000000. The reset and interrupt vectors are placed in the Flash and jump to some RAM addresses.
Raisonance Tools for ARM 4. Creating a project 4.4.2 LD linker options The LD Linker provides various options: • General • Startup • Scripts • Libraries. Ride7 provides some libraries which you can choose to include (or not) by (un)selecting the corresponding options. • More • C++ applications (RKit-ARM Enterprise version only). When you are using the Thumb instruction set, or Interworked mode, the libraries used are the corresponding Thumb libraries.
4. Creating a project Raisonance Tools for ARM Starter Kit Limited: This option should be used when debugging in RAM with the limited version of the RLink, such as the RLinks embedded in the REva evaluation boards, and the standard RLinks. • Because these RLinks only access the lower 64Kbytes of each memory area (RAM, Flash, etc.), the linker must initialize the stack pointer at an address lower than 64K and not at the very end of the RAM as it would do otherwise.
Raisonance Tools for ARM 4. Creating a project The reduced version (“Small printf”) links the \lib\ARM\small_printf(_thumb).a library, which includes a complete printf, reduced for embedded applications. • The no-float version (“no-float printf”) links the \lib\ARM\e_stdio(_thumb).a library, which includes a even more reduced printf that does not handle floating points. • These libraries (small and no-float) have been written by Raisonance but are free and opensource.
5. Debugging with the simulator Raisonance Tools for ARM 5. Debugging with the simulator The Ride7 for ARM simulator simulates ARM7, ARM9 and Cortex-M3 cores and most common peripherals, it lets you check your code and the interaction between your code and the peripherals. This section shows use of the simulator for ARM and Cortex-M3 microcontrollers. The interface is the same for all targets. Detailed documentation is in the Ride7 general documentation. 5.
Raisonance Tools for ARM 5. Debugging with the simulator 1. The upper part of the Debug tab. Shows the different Data views available on a given microcontroller. To see a specific view, double-click on its name. 2. The lower part of the Debug tab. Shows the peripherals available on a given microcontroller. To see a specific peripheral, double-click on its name. Most peripherals are NOT simulated. 3. The source file as edited in C or in assembly language.
5. Debugging with the simulator Raisonance Tools for ARM 5.4 Simulator toolbar The simulation is controlled by the simulator toolbar: 1. Run: Pressing this button launches the application. When the application is running, this button is grayed, then the Pause button becomes available. 2. Pause: Pressing this button stops the application. 3. Reset: Pressing this button resets the application. 4. Step Into: On a function call in a line of the C source code, this button steps into the called function.
Raisonance Tools for ARM 5. Debugging with the simulator 5.5 Viewing a peripheral To view a peripheral, you must open it by clicking on the corresponding item in the peripheral tree. For example, to view the Port 1, double click on the IOPORT1 icon. The Port 1 view appears. This view shows the state of each of the port’s pins. Green indicates a value of one, and red a value of zero. It is possible to connect each pin of the port to a Net, to VCC, to Ground or no connection.
5. Debugging with the simulator Raisonance Tools for ARM 5.7 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 on the left side of the source code, some lines with colored boxes (red green and yellow). These are code lines where a breakpoint can be set.
Raisonance Tools for ARM 6. Debugging with hardware tools 6. Debugging with hardware tools In addition to the Raisonance simulator, Ride7 for ARM can be used with a number of hardware debugging tools. • RLink USB to JTAG emulators from Raisonance. • JTAGjet USB to JTAG emulators from Signum Systems. • Serial Wire Viewer debugging features for Cortex ARM based micro controllers. The SWV provides a low cost method of obtaining information from inside the MCU using ARM CoreSight™ technology.
6. Debugging with hardware tools Raisonance Tools for ARM 6.2 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 ARM microcontrollers supported by Ride7 (see the up-to-date list in the Advanced ARM Options > Processor > Processor name). RLink uses: • JTAG protocol with ARM microcontrollers via the standard 20-point connector defined by ARM.
Raisonance Tools for ARM 6. Debugging with hardware tools 6.2.2 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. Uncheck the Debug option if you want to use RLink as a simple programmer, e.g. if you want to run the application on the ARM without debugging it.
6. Debugging with hardware tools Raisonance Tools for ARM 6.2.2.2 RLink JTAG-SWD ADP jumpers When using a stand-alone RLink, you must use an ADP to adapt the RLink’s 24-pins connector to the target connector. If using JTAG-ARM ADP, there is no configuration to perform. If using JTAG-SWD ADP, you must plug two jumpers on the left side, as shown in the picture (default factory setting). Note: SWD is supported by this version of the software.
Raisonance Tools for ARM 6. Debugging with hardware tools 6.2.2.3 Instant actions This allows you to carry out various instant actions without leaving this dialog box - useful for testing connections and retrieving information from the RLink and your ARM, and for programming the ARM and its configuration. • • • • • • View RLink REva jumpers configuration for ARM shows how you must set the jumpers on RLink for using it for programming and debugging ARM.
6. Debugging with hardware tools • Raisonance Tools for ARM Speed of the JTAG clock: specifies the clock speed. If your CPU’s clock is slow, then you must tell Ride7 to use a slow JTAG clock. If the JTAG clock is too fast compared with the target CPU’s clock, then communication fails.
Raisonance Tools for ARM 6. Debugging with hardware tools 6.3.2 Installing the Signum Systems USB driver for Ride7 To install the USB driver for JTAGjet: 1. Insert the Signum Systems CD-ROM into your CD drive. 2. Plug the JTAGjet into the USB port. Normally, MS Windows detects and installs the required driver automatically. If the OS cannot find the driver, direct it to the SigUSB.sys (SigUSB98.sys on Win98) file in the root folder of the Signum Systems CD-ROM.
6. Debugging with hardware tools Raisonance Tools for ARM 6.4 Cortex Serial Wire Viewer (SWV) debugging features (Open4 RLink only) Ride7 for ARM supports the SWV debugger for Cortex ARM based microcontrollers. The SWV uses the low cost ARM CoreSight™ technology to obtain information from inside an MCU. 6.4.1 Introduction SWV is the ability of the ARM™ core to send out real-time trace information via a single wire port called the Serial Wire Output (SWO).
Raisonance Tools for ARM 6. Debugging with hardware tools This panel configures the Serial Wire Output: • Check the Enable option if you want to use the SWO for SWV traces. • Enter the CPU clock frequency of your target in kHz (72 MHz in this example). This information is necessary for the RLink to set the speed of the SWO asynchronous communication port. • If you leave Auto checked, the system sets the maximum speed to 4.50 MHz (default value of SWO Clock).
6. Debugging with hardware tools Raisonance Tools for ARM Exampe 3: Look at the TestSWV application in {RideDir}\Examples\ARM\Primer\STM32EvoPrimer\Test_SWV This application periodically sends the message “Hello world !”, and the value of the loop counter. It implements a print function that prints strings with integers inside (%d formatter), and sends this string with the ITM_SendChar function. It also uses the previously described WriteITM function. 6.4.
Raisonance Tools for ARM 6. Debugging with hardware tools Cycle counter: • Every x cycles: enables periodic sampling of the Program Counter or the Cycle Counter value, based on the CPU Cycle Counter. The period of the event can be choose from 64 cycles up to 16K cycles. The highest values will probably not work because the SWO communication bandwidth is not big enough to handle that much flow of data.
6. Debugging with hardware tools Raisonance Tools for ARM 6.4.7 Configuring Ride7 to use the SWV watchpoint traces Go to the menu Debug->Advanced commands...->SWV watchpoints configuration to open the Watchpoint Configuration: This window configures watchpoints and data watch via four comparators. Watchpoints Enabled: This is a global enable/disable control for all comparators. If this is not checked then all comparators are disabled.
Raisonance Tools for ARM 6. Debugging with hardware tools - When Data Value matching 2 addresses is used, the Comparator 2 and 3 are implicitly used, and are no longer available for another match condition. These two addresses are not connected and do not form any range together. Action: A drop-down box allows selection of the action: • Sample PC: generates a trace event containing the address of the instruction that was executing at the moment of the matching condition, during read or write access.
6. Debugging with hardware tools Raisonance Tools for ARM 6.4.8 Start / Stop the trace The Start / Stop command is available on the SWV Global Trace View. 1. Click on Debug->Advanced commands...->SWV Global Trace View . 2. Click on Start Trace to start the trace acquisition. 3. Click on Suspend Trace to stop the trace acquisition. 4. Click on Start Trace again to continue trace acquisition: the new events are appended after the existing trace. 5.
Raisonance Tools for ARM 6. Debugging with hardware tools 6.4.9 Visualizing SWV traces with Ride7 Several views visualize traces during debug, whatever the CPU status, running or stopped. 6.4.9.1 SWV Software Trace View Menu Debug->Advanced commands...->SWV Software Trace View opens the SWV Software Trace View pane. This contains all the views of the channels that you configured with specific views, one per tab.
6. Debugging with hardware tools Raisonance Tools for ARM 6.4.9.2 SWV Global Trace View Debug->Advanced commands...->SWV Global Trace View opens the SWV Global Trace View: This view is global for all ITM channels and DWT features.
Raisonance Tools for ARM 6. Debugging with hardware tools Example of trace with PC time stamp: 6.4.9.3 SWV error messages Some error messages can occur in the Debug Output View, during an SWV session: • SWV unknown trace received (check CPU frequency or reduce trace speed): the system received data that it could not interpret. It may be a configuration or synchronization problem.
7. Raisonance solutions for ARM upgrades Raisonance Tools for ARM 7. Raisonance solutions for ARM upgrades Standard Software Features Entry Pro Hardware Product • Unlimited programming • Unlimited debugging • SWV Trace with RLink-STD ý ¨¹ ¨² Software Product • Support multiple MCU manufacturers • GCC Compiler • Integrated GCC compiler control • Integrated 3rd-party compiler control RKit-ARM-Lite ý ý ý ¨ RKit-ARM-Lite ý ý ý ¨ • Ride7 debug controls (run, step,...
Raisonance Tools for ARM 7. Raisonance solutions for ARM upgrades 7.2 Upgrade path 2 (RKit-ARM-Lite to RKit-ARM-Enterprise) The RKit-ARM capabilities are determined by a software-based license and are independent of the hardware that is used with them. Software licenses are node-locked licenses - specific to a computer. However, a dongle-based option is available when ordering.
8. Conformity Raisonance Tools for ARM 8. Conformity ROHS Compliance Raisonance products are certified to comply with the European Union RoHS (Restriction of Hazardous Substances) Directive (2002/95/EC) which restricts the use of six hazardous chemicals in its products for the protection of human health and the environment. The restricted substances are as follows: lead, mercury, cadmium, hexavalent chromium, polybrominated biphenyls (PBB), and polybrominated diphenyl ethers (PBDE).
Raisonance Tools for ARM 9. Glossary 9. Glossary Term Description SWD Serial Wire Debugger JTAG Joint Test Action Group (or "IEEE Standard 1149.1"). A standard specifying how to control and monitor the pins of compliant devices on a printed circuit board.
10. Index Raisonance Tools for ARM 10. Index Alphabetical Index Additional help or information..............................5 ARM MCUs.........................................................8 ARM upgrades..................................................42 Boot mode.........................................................15 Breakpoints.......................................................24 CMC-ARM Compiler Kit....................................13 Conformity.............................................
Raisonance Tools for ARM 11. History 11. History Date Description January 2009 Initial version June 2010 Added SWV Increase debug limit up to 64Kb October 2010 Corrections in the list of derivatives. March 2011 Completed SWV with DWT and watchpoints. Corrected RAM boot mode information. June 2011 Added generic compiler interface, new licensing/registering process. September 2011 Documented the Phyton Compiler interface.