iCub-main

Use this application to download your firmware in DSP boards.

+ Collaboration diagram for canLoader:

Use this application to download your firmware in DSP boards.

Description

CanLoder20 is a YARP based application that allows the firmware update of the DSP boards of iCub. The board types currently supported by the CanLoader application are:

Libraries

YARP libraries.

Parameters

You can use the canLoader application in two ways: using a GUI or by command line. The GUI is executed by default if the canLoader application is launched without parameters. For example: ./canLoader executes the graphical version of the canLoader.

To use the canLoader application by command line, without the graphical interface, use the following syntax: ./canLoader –canDeviceType t –canDeviceNum x –boardId y –firmware myFirmware.out.S ./canLoader –canDeviceType ETH –canDeviceNum 1|2 –boardId y –firmware myFirmware.out.S –boardIPAddr aaa.aaa.aaa.aaa All of the parameters are mandatory. A description of the parameters follows: –canDeviceType t: specifies the type of canBusDriver used. The parameter t can assume the values 'ecan' or 'pcan' or 'cfw2can' or 'socketcan' –canDeviceNum x: specifies the canBus identification number. The parameter x can be 0,1,2 or 3. –boardId y: specifies the can address of the board on which the firmware will be downloaded. The parameter y ranges from 1 to 15. –firmware myFirmware.out.S: specifies the file name containing the firmware (binary code) that will be downloaded. –boardIPAddr aaa.aaa.aaa.aaa: it is the ETH board IP address.

Ports Accessed

None

Ports Created

None

Input Data Files

The canLoader application requires in input a file containing the firmware that will be downloaded. The extension of the firmware file is typically '.out.s' for the Motorola DSP-based boards and '.hex' fot DSPIC-based boards. The name of the file containing the firmware is specified using the –firmware parameter if the canLoader application is executed by command line or browsing the directories if the GUI is used.

Output Data Files

No output files are generated by the canLoader application.

If the application is executed using the command line modality, the following codes are retuned by the application, identifying the status (success or not) of the download.

#define ALL_OK 0

#define INVALID_CMD_STRING -1

#define INVALID_PARAM_CANTYPE -2

#define INVALID_PARAM_CANNUM -3

#define INVALID_PARAM_BOARDID -4

#define INVALID_PARAM_FILE -5

#define ERR_NO_BOARDS_FOUND -10

#define ERR_BOARD_ID_NOT_FOUND -11

#define ERR_UNKNOWN -12

#define DOWNLOADERR_NOT_CONNECTED -20

#define DOWNLOADERR_BOARD_NOT_SEL -21

#define DOWNLOADERR_FILE_NOT_SEL -22

#define DOWNLOADERR_FILE_NOT_OPEN -23

#define DOWNLOADERR_BOARD_NOT_START -24

#define DOWNLOADERR_TRANSFER_ERROR -25

In this way, an external script that invokes the canLoader application can check the result of the firmware download operation.

Configuration Files

The canLoader application uses a configuration file (config.txt) located in the same diretory of the executable. The configuration file specifies the filename of the firmware used in the last download operation. If the configuration file is not found when the canLoader application is executed in graphical modality, a new config.txt is generated. The configuration file is not used when the canLoader is executed in command line modality.

Tested OS

Linux and Windows.

Example Instantiation of the Module

canLoader canLoader –help canLoader –canDeviceType esd –canDeviceNum 2 –boardId 1 –firmware myFirmware.out.S canLoader –canDeviceType ETH –canDeviceNum 1 –boardId 4 –firmware myFirmware.out.S –boardIPAddr 10.0.1.8

Author
Marco Randazzo

Copyright (C) 2008 RobotCub Consortium

CopyPolicy: Released under the terms of the GNU GPL v2.0.

This file can be edited at src/myModule/main.cpp.