CANopen diagnosis with UDE CANOpen-MessageFormatter-PlugInEfficient combination between CANopen diagnosis and microcontroller debuggingLauta, January 2006 - For verification of microcontroller software and for diagnosis of CAN bus to date usually two different tools are used featuring two separate communication devices for CAN bus and debug interface to the microcontroller - running often on two diverse PCs. A solution for this dilemma is the integration of a CAN recorder in the microcontroller debugger including a flexible message formatting mechanism for CANopen and other protocols. This approach allows a significant increase of efficiency compared to traditional solutions based on separated tools. <definition line> := <message ID> , "<format string>" [, <parameter list>]The format string is made up of the printf function that is known from the standard C library. The integration of values from the parameter list is possible with % placeholders. The organization of the optional parameter list is as follows: <parameter list> := <keyword> [, <keyword> …]For keywords might be used <keyword> := <MSGID()> | <STDMSGID()> | >TIMESTAMP()> | <BITVALUE(start,end)> MSGID() creates the numerical value of the ID for the message that has to be formatted; STDMSGID() is equivalent to the chain of characters of the message that would be created by the CANopen interpreter; TIMESTAMP() generates the numerical value of the time stamp to run from the CAN recorder and BITVALUE(start, end) finally creates the numerical value of the specified bit array that is defined by the parameters "start" and "end". The last keyword allows extracting bit arrays of any size from the 64 bits of a CAN message. Due to the syntax elements it is possible to realize for every anticipated CAN message an easier to use plain text output compared to numerical values. Figure on right side shows an example file.Since a device configuration file features all necessary indications for useful monitoring CAN messages it allows creating from itself a description file for the message formatter. This task is done by the DCF converter that automatically generates such a description file from the indications of one or multiple device configuration files. The DCF converter is intentionally not directly integrated in the CAN recorder but operates on a temporary file. This has the advantage that the functionality of the message formatter is usable even when there are no device configuration files available. This happens for example in the early stage of development or if you work with proprietary CAN protocols instead of CANopen. The microcontroller debugging environment that acts as host application for the extended CAN recorder is made up modular with COM components and extendable via add-in interface. Parts of the program that are specific for the architecture or the target are encapsulated into modules and can be changed when a new microcontroller is used. Add-ins beside the CAN recorder are for example flash programming or support for real time operation systems. The user interface of the integrated CAN recorder consists of a debugger window featuring a list with selectable layout. For monitoring the following columns are selectable:
Furthermore the used baud rate and used identifier format are adjustable. For special applications it is also possible to directly program the CAN bit timing registers that are located in the 32-bit TriCore microcontroller used in the debugging communication device. This enables an alignment to any baud rate and values for the sample point. This allows the usage of the CAN interface in the communication device over the total baud rate up to 1 MBit/s as well as basic and extended identifier format (CAN base frame and CAN extended frame). The message masks of the CAN module in the TriCore microcontroller are also adjustable via a dialog page. Therefore filtering of the record is possible via the hardware. Additionally the storage of a file record for subsequent processing with other programs is also possible.To date debuggers are used only for troubleshooting and test of microcontroller applications. The integration of CAN/CANopen diagnosis into the Universal Debug Engine from pls a well known programming environment for design engineers results in a significant improved efficiency. Particularly the use of only one communication device is to be emphasized to access the target for debugging and CAN monitoring. Additionally the CAN recorder add-in and the microcontroller debugger as host environment provides an automation interface. This interface enables control of the functionality from extern for example by scripts. This allows the interaction between debugger and CAN recorder resulting in a significant improvement of the performance of the integrated tools. For example a debug event like a break point enables to start and stop the CAN recording or to send a CAN message. TrademarksTriCore is a registered trademark of Infineon Technologies AG.CANopen is a registered trademark of CAN in Automation (CiA). Editors contactpls Programmierbare Logik & Systeme GmbHHeiko Riessland Technologiepark D-02991 Lauta Phone: +49 35722 / 384 - 0 Fax: +49 35722 / 384 - 69 Email: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it Internet: http://www.pls-mc.com |