microcontroller
 

Ride7

 General

RIDEScripts

   Back to all FAQs


Q: How can I drive Ride from an outside program or script, for automatic testing or mass production ?

A: If you only want to program, the simplest thing is to use the command-line executables "ST7_pgm.exe", "STM8_pgm.exe", "Cortex_pgm.exe", etc. that come with Ride.

For debugging, which might be required for testing, it's more complex as you have to use COM interfaces. The Ride documentation pane contains a doc called "Debugger COM Interface" that contains the list of available COM entry points and their doc. And here is an example perl script that shows the basic operations to perform for achieving this:
ftp://www.raisonance.com/pub/Ride7/Debu … ecution.pl
(this is one of the sub-scripts we use for validating the ST7/STM8 compiler)


Q: I want to see the result of my program in characters, but the UART just prints out weird numbers. What is the reason ?
A: The default representation of the UART screen ('View | Hardware Peripherals | UARTn') is hexadecimal numbers. Just select the 'ASCII' radio button in the left box above the buffer and you will see real characters.

 ^top


Q: Can I run a .bin or .hex executable, possibly stemming from an outside compiler, from Ride7 ?
A: Yes, if you have a binary or Hex Intel file, you can run, simulate and debug your application within Ride7. Proceed in the following way:

  1. Use the 'Project | New' command to create a new project.
  2. Use the 'Project | Delete node' command to remove the default application from the project.
  3. Use the 'Project | New application' command to insert your .bin or .hex file into the project.
  4. Set the debug mode and options for your application and start debugging.

Note: Unlike an *.aof file, *.bin and *.hex files have no embedded debugging information. So although you can still, for example, watch the memory in step-by-step execution, information about symbols or breakpoints is not available.


Q: After changing my files, running the 'Project | Make all' command does not launch any tool. Why?
A: Two causes of 'no action when Make All' are most common:

  1. The project does not contain any files. You have created an empty project, and you forgot to specify the files it should contain. Thus, when the 'Make All' or the 'Build All' commands are run, nothing happens because there is no file in the project to recompile.
  2. If the 'Make All' seems not to work properly while the 'Build All' command is OK, it is probably a problem of date. The 'Make' command checks for dates to decide when a file needs to be recompiled. If computers are not synchronized, it happens very often that some are a few minutes, one hour or one day ahead. In the case in which the .AOF file has been touched from another PC with a 'future date', no file will be recompiled until your PC time will pass over this date.

 


 

Q: Ride7 build/make problems. Why?

A: In some situations, the Ride7 internal database may be corrupted and contain references to non-existent (zombie) files. This may happen when you move your project between different directories.

In order to restore your project to a clean state, you can delete the Ride7 project database file (which contains information about the files, build dates etc for its internal make facility):

  • Close any open Ride7 instance
  • Navigate to your project folder in Windows Explorer
  • Remove your project.rdb file
  • Restart Ride7
  • Open your project
  • Build it


Q: After a Ride General Protection Fault, I am not able to start a debug session for my project any more. What can I do?
A: In order to work around this problem, go to your poject directory and delete all the files of the following types: *.wmc, *.~mc, *.dbi and *.~bi. If the problem occurs outside a project environment, do the same in the ..\Ride\bin directory.


Q: Is it possible to redirect the serial UART to a file?
A: Yes, this feature is not directely accessible from the UART dialog box, but it exists. At the moment, the solution is to run a script (at least a one command script file) including the following call: SetPeripheralParam('uartname',"output",'filename');
where:

  • 'uartname' is the name you will find in the list 'View | Hardware Peripherals',
  • 'filename' is the whole pathname of the file you want to create. Note that the file will be removed and recreated each time you call this script function.

For example: SetPeripheralParam("UART0","output","c:\tmp\myouput.txt");


Q: How can I incorporate an external tool into Ride7?
A: The 'Tool' menu lets you run any programs, tools, and utilities without leaving Ride7. To run a program from the 'Tool' menu, choose the program you want from the list of available tools.
In order to install other tools, use the 'Options | Tools' dialog box and click on 'New'. Enter the requested information. 'Registered for Application' means that the tool is available not just for the current project, but also for other ones. Check the 'Linker' box if your tool is a linker.
The tools can be invoked from different places:

  1. Compiler tools:
    a) Select the file you want to compile in the project window.
    b) Within your project window, click on the right mouse button and select 'Node Properties'.
    c) Choose your tool in the frame with the title 'Translating'.
  2. Linker tools :
    a) Select the *.aof file you want to link in the project window.
    b) Within your project window, click on the right mouse button and select 'Node Properties'.
    c) All linking tools will appear under the title 'Link' if you have checked 'Linker' under 'Options | Tools | New'.
  3. Post-link tools:
    a) Select the *.aof file you want to apply a post-linking tool to in the project window.
    b) Within your project window, click on the right mouse button and select 'Node Properties'.
    c) If you want to run a tool after the linking phase, check the 'Run automatically after linking' box in the 'Post Link' frame and select your tool.
  4. Debugger tools:
    a) Enter the application extensions '*.aof;*.bin;*.hex' in the 'Translate from' text box in 'Options | Tools | Edit' to make your debugger tool available.
    b) Check 'Other Tool' under the heading 'Tool' in 'Options | Debug'.
    c) Choose your tool in the frame 'Debug tool'. The tool can only be chosen if a project has been opened.
  5. Other tools:
    a) Open a project.
    b) Select your tool from 'Tool | Run tool'.

Q: While simulating a project my simulator is abnormally slow. What can I do?
A: The most frequent causes for a slow simulation are:

  1. The trace is on and each instruction is traced. In case the total number of trace records is high (typically more than 1K) a large amount of memory will be used and the record allocation will make the simulator slower. Set the 'Maximum number of records' parameter in the second box of the 'Trace' tab in 'View | Trace | Options' lower, or simply switch the trace off by selecting the 'Off' parameter in the first box (title 'Mode') of the 'Trace' tab.
  2. The speed is settable (ruler in the toolbar) and it may be set in slow mode. Move the arrow inside the ruler to the right in order to obtain higher speed.
  3. The animated mode is on meaning that a lot of time is consumed in refreshing the screen. Click on the film icon in the toolbar in order to toggle modes.


Q: Where can I find the breakpoint list?
A: To view the list of breakpoints, select the menu 'View | Flags'.


Q: The symbols I defined in the 'View | Data dumped | Data View' window during a debug session are not saved. Why?
A: If the symbols are not defined within the source program, they will not be saved and are only valid for the current debugging session.


Q: I have some external references in my *.c file. Where do I put the referenced library?
A: The library is put at the same level as the *.c files in the project. If you want to add a library (or a *.c file), in the project window select the 'executable' *.aof file you want to add it to. Then either add the file from the menu with 'Project | Add node Source/Application' or click the right mouse button and select 'Add node Source/Application'.

The library has to be located below the *.c file in which it is referred. The relative position of a file may be changed by selecting it and then pressing the shift key together with either the up or down arrow keys.


Q: Which operating systems are the Raisonance tools available for?
A: You can install RKit on Windows 95, 98, 2000 and Windows NT.


Q: I would like to debug my assembler code. How can I change my register or data settings?
A: Click on 'View | Main registers' to view the main registers and flags, and hence can change their values directly in this window. By double-clicking on a data position in the 'View | Data dump | Data View' window(s), data settings can be changed.


Q: How can I create a .bin or .hex file?
A: Go to 'Options | Project | RL(ST6 | XA | 51) | Linker'. Check the boxes 'Generate a Hex file' and/or 'Generate a Binary file'. Then, every time you make the project, a new *.aof, *.bin and/or *.hex will be generated. The *.bin and/or *.hex file will be located in the same directory as the *.aof file.


Q: What is the difference between 'make all' and 'build all'?
A: 'build all' recompiles every *.c file in the project whereas
'make all' only recompiles the *.c files which were modified since the last compilation and the files which they depend on. The dependencies are created automatically by Ride7.


Q: Where do I find my symbols in data?
A: There are several possibilities:

  1. While debugging, open the data memory window with 'View | Data dump | Data View'. Click the right mouse button and choose 'Go to | Search symbol' from the menu. Enter the symbol name and click OK.
  2. Search for the symbol in the linker's information page ('View | Map Report from linker').
  3. Look at the machine code with 'View | Code (disassembly)'. The location in memory is given by the hexadecimal code of the instruction concerning the symbol.

Q: What do I need to do to trace a variable?
A: In order to trace a variable you first need to add this variable to the list of Watches. To do this you can either use the Debug | Add Watch menu or simply highlight the variable name in the editor and then press F6.
Once the variable is in the list of watches, you can right-click on it and select 'Add/Delete from Trace list'. A little 't' symbol in the watch window will tell you that the variable is in the trace list. You can now open the trace window (Windows | Trace) and your variable will appear in the text section of this window. By clicking on it you add/remove the variable from the graphic part of the trace window.
Now you need to make sure that the trace is set in a way that will actually show your variable changing: right-click in the upper half of the trace window and choose 'Options', make sure that the mode is not 'Off' and select a suitable numbers of records (around 30 for a typical example).
Now run your program and you will see your variable changing state in the Trace window.


Q: How can I simulate external interrupts, that is, how can I generate an edge on a pin that will cause an interrupt to occur?
A: The simplest way is:

  • Start the debugger,
  • Put a breakpoint on the first line of the interrupt routine,
  • Start the program with the GO button,
  • Open the window for the Port where the pin you want to toggle is,
  • Position the mouse on the pin you want to toggle until the world 'link' appears
  • Left click and choose connect to Vcc or connect to ground according to which level (or edge) will trigger your interrupt.

If you want your interrupt to occur at a given time you can connect the pin to a waveform generator rather then switching it manually.

If your interrupt routine is programmed correctly (right address, right priority, right enable mask and so on), the program execution will stop at the breakpoint.


Q: Are long file names managed correctly by Ride7 and the tools?
A: Long file names (that is, longer than 8.3 characters) are managed correctly by Ride7 and the tools, with some limitations:

  • parentheses "(" and ")" are not allowed in the filename
  • if the file name contains whitespaces it must be put between double quotes ("") when used with the command line version of the tools (this is done automatically when the tools are called via Ride7).

Q: How can I connect my Raisonance emulator to a PC with no serial port (or with serial port problems)?
A:  A USB to serial converter exists that can be successfully used to connect the emulator to the PC.
This is of course useful for the smaller PCs without any serial port, but it can also be used for PCs whose serial port does not work well with Ride7 (the latest Dells have some sort of polling on the serial port that interferes with Ride7).
USB to serial adapters usually come with a driver that creates a virtual COM port (usually COM3 or COM4) that can be selected into RIDE. The reference "USB to Serial Adapter cable ref : DA 70119" from Assmann has been tested and is guaranteed to work.


Q: My script is interrupted by a message box which tells me that there are too many warnings in the message window. How to disable this message box?
A:  It is not possible to disable this message box, but you can forward your script message ScriptCreateMessage( ) to a file by using the function ScriptMessageOptions( ) .


Q: How can I generate a report of my debugging session?
A: You can use the script facility to generate a file report. For this, try some of the functions :

  • ScriptMessageOptions( ) to forward the message into a file.
  • ScriptGetInfo( ) to have some information about the debugging session, the date, the product version, etc. ...
  • ScriptPrintIntValue( ) to print a register value, a variable, or an integer.
  • ScriptCreateMessage( ) to print a message.
  • ScriptInputBox(string MESSAGE ) to invite the user to enter some information.

  ^top


Q: How can I stop a script file during its execution?
A: When your script file has entered an infinite loop, or if you want to stop it before the end you can click on the small gears icon on the right of the Windows bar (just before the clock).


Q: How do I know that my script is running?
A: If your script is running, there is a small icon in the shape of 'gears' on the right of the Windows task bar, just before the clock.


Q: How can I find out the script version ?
A: The script version was introduced in build number BN6.21 of RIDE. If the build number shown via 'Help | About' is greater than or equal to 6.21 you can find out the script version by invoking the function:
CreateMessage(ScriptGetInfo("ScriptVersion")); 

 ^top

Q: How can I convert an address (an int value) to a string value ?
A: In order to convert an address into a string value, you can use the function ScriptSprintIntValue(string, int) .
This function was introduced in script version V1.2.

Example :

int addr;
string Saddr;

addr = DebugGetAddrSymb('MyFunction');
Saddr = ScriptSPrintIntValue("0x%x", addr);


Q: How can I write a 'for' loop in WScript ?
A: There is no 'for' in WScript, but you can make a loop with the 'while' instruction.

Example :
instead of:
for(i = 0; i < 5; i++)
my_function();

you can write:
int i = 0;
while (i < 5)
{
i = i + 1;
my_function();
}


Q: How can I change the values of the defines in the assembler or compiler while running the WScript inside Ride7?
A: WScript cannot directly modify the 'defines' of the compiler or assembler that is shown in the menu "Options | Project". However, it can insert text into the source files(s) and thereby create the defines dynamically. Use the function EditInsertText(string TEXT).


Q: How do I put the program counter (PC) to a symbol (or function)?
A: Create your own function in Wscript :

//******************************************************************
// DebugSetPCToSymbol()
// Position the PC on a symbol
//******************************************************************
int DebugSetPCToSymbol(string symbol)
{
int addr = DebugGetAddrSymb(symbol);
DebugSetValSymb("PC", addr);
return 1;
}

The parameter symbol in DebugGetAddrSymb varies according to the type of the function (e.g. recursive). See chapter "Interfacing 'C' Programs to Assembler" in the appropriate compiler documentation.


Q: Why do (long) scripts get slower during execution?
A: Scripts that create a lot of messages (with the functions ScriptCreateMessage( )) tend to become slow when the number of messages is big (>100) as all the messages are displayed in a window that is refreshed periodically.
Consider reducing the number of messages or redirecting the script output to a file (using the ScriptMessageOptions( ) function).

^top