background image

 

Cyclone Automated Control Package 

 

 

 

53 

6.4.2 Controlling Multiple Cyclones 

 
; Setup commands 
OPENTYPE=IP 
SETTIMEOUT=60          ;Configure for 1 minute timeout 
 
PORT=USB 
CYCLONE=192.168.1.1 
IMAGENUM=2 
 
CYCLONE=192.168.1.2 
IMAGENUM=2 
 
PORT=ETHERNET 
CYCLONE=192.168.1.3 
IMAGENUM=3 
 
; Operation commands 
ALLSTART 
 
This example connects to three separate Cyclone units. Two units are connected 
via USB (192.168.1.1 and 192.168.1.2) and the third is connected via Ethernet 
(192.168.1.3). The two Cyclone units connected via USB are configured to 
execute image #2, while the third Cyclone is configured to execute image #3. 
 

Содержание Cyclone for ARM

Страница 1: ...Cyclone Automated Control Package Developer s Manual Copyright 2016 P E Microcomputer Systems Inc All rights reserved Visit us on the web at http www pemicro com ...

Страница 2: ...4 Updated add_image_to_cyclone and update_image_with_file Updated connect_to_cyclonepromax and Launch to support PORT_NUM 1 5 30 December 2009 Added documentation for Compact Flash support Added documentation for set_cyclonepromax_media_type 1 4 2 October 2008 Added documentation for set_COM_port function Updated software license 1 3 1 July 2008 Added documentation for the included Cyclone Launch ...

Страница 3: ...3 6 Typical Usage 16 3 7 External Memory Storage Support 17 4 Application Programming Interface API 18 4 1 Constants 18 4 2 DLL Loading Unloading Calls 19 4 2 1 load_dll 19 4 2 2 unload_dll 19 4 2 3 enumerate_all_ports 20 4 2 4 close_all_ports 20 4 2 5 version 20 4 3 Cyclone Connecting Disconnecting Calls 21 4 3 1 connect_to_cyclonepromax 21 4 3 2 connect_to_cyclonepromax_by_ip 23 4 3 3 disconnect...

Страница 4: ...a_type 39 5 List of Error Codes 40 6 Cyclone Launch 43 6 1 Startup 44 6 2 Command Line Parameter Examples 45 6 3 Configuration Script File 46 6 3 1 SETUP Commands 46 6 3 2 Operation Commands that Control All Connected Cyclones 49 6 3 3 Operation Commands that Control a Single Cyclone 50 6 4 Examples 52 6 4 1 Typical Usage 52 6 4 2 Controlling Multiple Cyclones 53 6 4 3 Programming dynamic data 54 ...

Страница 5: ... extensions which come with this development package may be distributed in whole or in part without prior written permission from P E All documentation in this package is Copyright 2008 P E Microcomputer Systems Inc All rights reserved 1 1 Introduction to Cyclone Launch The Cyclone Launch application allows a developer to use simple ASCII script files to control Cyclone operations from the PC Once...

Страница 6: ... Visual MFC Application Microsoft Visual C 2005 Visual Application The sample applications come with project and workspaces defined for ease of use Simply open the project workspace in your compiler and you should be able to build the sample application without any modifications The sample applications come precompiled with ICONS so you can run them before jumping into the code The callable interf...

Страница 7: ...l version of the library Library file Calling Convention cyclone_control dll cdecl cyclone_control_cdecl dll1 cdecl cyclone_control_stdcall dll stdcall 1 Note that cyclone_control_cdecl dll is identical to cyclone_control dll 1 5 P E Compatible Hardware The following lists the P E hardware compatible with the Cyclone Automated Control Package To ensure proper operations P E recommends upgrading al...

Страница 8: ...munication protocols are not included UProfessional Edition DLL supports controlling of up to 3 Cyclone units simultaneously DLL supports all available function calls RS232 Ethernet communication protocols are not included Requires Compact Flash License sold separately to modify images on external Compact Flash cards Supports the modification of images on external SDHC cards on Cyclones with this ...

Страница 9: ...wo different computers provided that the software is never used on the two computers at the same time P E expects that group programming projects making use of this software will purchase a copy of the software and documentation for each user in the group Contact P E for volume discounts and site licensing agreements With respect to the physical media provided within P E Microcomputer Systems warr...

Страница 10: ...umentation for the purpose of distribution to others Under no conditions may you remove the copyright notices from this software or documentation With respect to the physical media provided within P E Microcomputer Systems warrants the same to be free of defects in materials and workmanship for a period of 30 days from the date of receipt If you notify us within the warranty period P E Microcomput...

Страница 11: ... 3 Install the new version of the software 4 Proceed with the software activation process using the new installation code that you should have received The pemicro lic file is found in the same directory where the DLL resides Normally this is found in the Windows System Folder WINDOWS SYSTEM for Windows 95 Windows 98 Windows ME WINNT SYSTEM32 for Windows 2000 Windows NT WINDOWS SYSTEM32 for 32 bit...

Страница 12: ... 5 0 Example MFC Visual Application INSTALLDIR msvcsharp2005 MSVC 2005 Example Visual Application These example programs are a valuable reference to use when starting your own custom application 3 2 Starting your own project To gain access to the functions available in the DLL the following files need to be added to the new project workspace UDelphi 2 0 Projects INSTALLDIR Delphi20 multiple_cyclon...

Страница 13: ...oject workspace the namespace of the class may optionally be modified to match the namespace of your project The project visual_sap_control sln has been tested in Microsoft Visual Studio Community 2015 To build and execute the project you must configure the compiler to build for the x86 platform only under Build Configuration Manager ...

Страница 14: ...function is required in order to properly initialize all devices This function should only be called once typically at the beginning of the application enumerate_all_ports UConnect to the P E hardware interface The next step is to establish communications with the P E Cyclone unit This is accomplished with the following function call connect_to_cyclonepromax Refer to Chapter 4 of this manual for a...

Страница 15: ...ly unloaded when the application closes 3 5 Initial Cyclone Setup The Cyclone Image Creation Utility software which is included with each Cyclone unit is used to create the standalone images that will be stored in the non volatile memory of the Cyclone These images contain the FLASH EEPROM programming algorithms the actual binary data to be programmed the sequence of programming operations and use...

Страница 16: ...rations defined in the stand alone image stored on the Cyclone unit START_dynamic_program_bytes allows the user to manually specify the data as well as the memory address of the programming Step 2 Wait for programming completion Note that no error checking is provided by the check_STARTED_cyclonepromax_status call A result of 0 will be returned even if an error has occurred or if communication wit...

Страница 17: ...media_type Cyclone Launch MEDIATYPE n and ALLMEDIATYPE n Image numbers will overlap between the two media types Image number 1 will refer to either the first image on internal Flash or the first image on the external memory card depending on the previously selected media type When you attempt to modify the images on the Compact Flash card eg erasing or adding images for the first time the user wil...

Страница 18: ...he Basic Edition of the DLL Please refer to section 1 6 of this manual for more details In each section the function prototypes are given in the following order Delphi C C C 4 1 Constants Name 32 bit Value PortType_USB 5 PortType_Ethernet 6 PortType_Serial 7 Open_by_IP_Address 1 Open_by_Name 2 Open_by_Port_Num 3 Media_Flash 1 Media_CompactFlash1 2 1 Note that Media_CompactFlash is also used for SD...

Страница 19: ... the other routines can be called This routine is only required for C C applications and is defined in the file multiple_cyclone_programming cpp returnvalue True if the load was successful False otherwise 4 2 2 unload_dll void unload_dll void Unloads the DLL loaded with load_dll This call should be made before the application starts to unload itself This routine is only required for C C applicatio...

Страница 20: ...e before the first call to connect_to_cyclonepromax 4 2 4 close_all_ports procedure close_all_ports void close_all_ports void void close_all_ports void This call closes all open Cyclone units if any and frees all dynamic memory used by the DLL This function should be called before the user application is closed 4 2 5 version function version pchar char version void String version void returnvalue ...

Страница 21: ...handle is returned If there is a failure contacting the Cyclone the function returns a 0 Note that the DLL does not support multiple Cyclones connected via the serial port If you require more than one Cyclone to use a serial port connection P E recommends using the RS232 communication protocols available in the Enterprise Edition param port_type Specifies how the Cyclone is currently connected to ...

Страница 22: ...connected by USB the string should be USB where is 1 8 If the Cyclone is connected by Ethernet the string should be in the format of xxx xxx xxx xxx where xxx 0 255 If the Cyclone is connected by Serial the string should be COM1 returnvalue The handle to the opened Cyclone unit A return value of 0 indicates a failure to connect to the specified Cyclone unit ...

Страница 23: ...sed for new applications connect_to_cyclonepromax should be used instead This call opens a session with a Cyclone unit that is connected via Ethernet by its IP address The handle that is returned by this function is passed as a parameter to all other calls in the DLL param port_identifier A pointer to a null terminated character string in the format xxx xxx xxx xxx where xxx 0 255 returnvalue The ...

Страница 24: ...clone unit to have its session terminated returnvalue True if the session terminated successfully False otherwise Examples of situations which could return a value of false Invalid handle number Cyclone unit specified is not currently open 4 3 4 set_local_machine_ip_number procedure set_local_machine_ip_number ip_number pchar void set_local_machine_ip_number char ip_number void set_local_machine_i...

Страница 25: ...umber Sets the COM port that should be used for serial communications By default COM1 is automatically selected If a different COM port is to be used this function should be called prior to calling connect_to_cyclonepromax param COM_port_number The COM port number that should be used for serial communications This value should be between 1 and 256 returnvalue True if successful False otherwise ...

Страница 26: ... the programming algorithms binary data and programming sequence Calling this routine instructs the Cyclone unit to start execution of a particular image After invoking this call the check_STARTED_cyclonepromax_status function should be used to wait for completion param cyclonepromaxhandle The handle of the Cyclone unit to begin programming operations param image_id Used to select which image stor...

Страница 27: ...e allows the user to program such dynamic data This function is valid to be called only after a programming image has been programmed into the target once START_execute_all_commands has completed Call the check_STARTED_cyclonepromax_status function to wait for completion If the target is reset after programming the image START_dynamic_program_bytes will fail The workaround to this is to execute a ...

Страница 28: ...yclone unit has completed a programming operation started with either the START_execute_all_commands or START_dynamic_program_bytes routines After this call returns with completed value get_last_error_code should be called to determine the programming result A result of 0 will be returned even if a programming error has occurred or if communication with the Cyclone unit is lost param cyclonepromax...

Страница 29: ...fied number of bytes from a specified memory address of the target processor This call is only valid after performing a START_execute_all_commands function param cyclonepromaxhandle The handle of the Cyclone unit that will perform the dynamic read param target_address The first memory address of the target processor where the data will be read param data_length The number of total bytes to read fr...

Страница 30: ...r code of the specified Cyclone unit A return value of 0 indicates that no error occurred during the programming process 4 4 6 get_last_error_addr function get_last_error_addr cyclonepromaxhandle longword longword unsigned long get_last_error_addr unsigned long cyclonepromaxhandle UInt32 get_last_error_address UInt32 cyclonepromaxhandle If the get_last_error_code function returns a non zero value ...

Страница 31: ... in order to enter monitor mode without erasing the device This function can be useful if testing needs to be performed after programming requiring the HC908 device to be powered off and powered back on and later you need to program a serial number for example param cyclonepromaxhandle The handle of the Cyclone unit that will have its HC908 security code set param buffer A pointer to a character a...

Страница 32: ...nepromaxhandle The handle of the Cyclone unit that will be reset param reset_delay_in_ms The reset delay specified in milliseconds The delay should be at least 5500 ms returnvalue True if reset was successful False otherwise 4 5 2 get_firmware_version function get_firmware_version cyclonepromaxhandle longword pchar char get_firmware_version unsigned long cyclonepromaxhandle String get_firmware_ver...

Страница 33: ...nal Flash or external memory card This description is specified by the user when the image is first created param cyclonepromaxhandle The handle of the Cyclone unit to get an image description from param image_id Used to select which image stored on the Cyclone unit to read the description from If a Cyclone only stores one image this parameter should be set to 1 The valid range of this parameter i...

Страница 34: ...ty param cyclonepromaxhandle The handle of the Cyclone unit that will have its image compared param aFile A pointer to a null terminated character string which contains the full path to the SAP file that will be compared param image_id Used to select which image stored on the Cyclone unit to compare against If a Cyclone only stores one image this parameter should be set to 1 The valid range of thi...

Страница 35: ...e internal Flash or external memory card This function should not be constantly called as this will shorten the lifespan of the non volatile flash memory It is recommended that the user make use of the compare_image_with_file function first to determine if an erase is indeed necessary e g if the images on the Cyclone unit do not match the latest images on a server param cyclonepromaxhandle The han...

Страница 36: ...extension and are created with the Cyclone Image Creation Utility If the Cyclone s storage limits are reached this routine will return an error The user may wish to erase all existing images first using the erase_all_cyclone_images function param cyclonepromaxhandle The handle of the Cyclone unit that will accept the new image param aFile A pointer to a null terminated character string which conta...

Страница 37: ...param cyclonepromaxhandle The handle of the Cyclone unit that will have its image updated param aFile A pointer to a null terminated character string which contains the full path to the SAP file to be added returnvalue True if the image updated is successful False otherwise 4 5 8 count_cyclonepromax_images function count_cyclonepromax_images cyclonepromaxhandle longword byte unsigned char count_cy...

Страница 38: ... also tristated during this time This call is normally used to power down and power up the target so that the processor is running normally after programming The Cyclone s jumper settings must be configured properly in order for the Cyclone s output target power to reach the processor Please refer to the Cyclone manual for more details Note This function has no effect for the Cyclone Max as the ou...

Страница 39: ... This affects all other functions in the library that deal with SAP images residing in the Cyclone Below is a comprehensive list of affected functions START_execute_all_commands get_image_description compare_image_with_file erase_all_cyclone_images add_image_to_cyclone update_image_with_file count_cyclonepromax_images The above functions will use the selected media type until the next call to set_...

Страница 40: ...nfigured 0x00A8 VM is not pre configured 0x00A9 VR is not pre configured 0x00AA VC is not pre configured 0x00AB USER1 is not pre configured 0x00AC USER2 is not pre configured 0x00AD USER3 is not pre configured 0x00AE USER4 is not pre configured 0x00AF USER5 is not pre configured 0x00B0 USER6 is not pre configured 0x00B1 Wrong USER function specified 0x00B2 PT is not pre configured 0x00B4 Error dur...

Страница 41: ...Byte Algorithm is not available 0x1003 Error during blank checking device using blank_check_byte algorithm 0x1004 Error during blank checking device using blank_check_word algorithm 0x2003 Error during erasing device 0x2004 Error during erasing device 0x3001 Program_Word Algorithm is not supported 0x3002 Program_Byte Algorithm is not available 0x3003 Error during programming device 0x3004 Error du...

Страница 42: ...Cyclone Automated Control Package 42 0x7007 Error during programming the trim value 0x7008 Error during verify trim value 0x7009 Trim value is 00 or FF 0xEEEE Error during communication with Cyclone ...

Страница 43: ...y easy to set up and use and offers functionality very similar to using the Cyclone Control DLL directly To find the Cyclone Launch application navigate to the following directory INSTALLDIR Cyclone Launch The Cyclone Launch software performs all operations specified in a simple ASCII script file written by the user A separate batch file would typically be used to launch the utility with the corre...

Страница 44: ...lename is a configuration file containing all operations to be carried out Refer to section 6 2 for more details This must be the first parameter passed to the application designates that Cyclone Launch should remain open when operations are completed If this parameter is not specified the utility will automatically close upon completion designates that Cyclone Launch should remain open if any err...

Страница 45: ... Cyclone executes all operations specified in the config_script cfg file The CYCLONE_LAUNCH application remains open if any error occurs CYCLONE_LAUNCH exe config_script cfg O output_log txt The Cyclone executes all operations specified in the config_script cfg file and logs all results to the output_log txt file ...

Страница 46: ...56 SETLOCALIP ipaddress Only needed if the host PC has more than one network card ipaddress indicates the IP address of the network card that should be used during communications If this command is used it should be the first command in the script file ipaddress should be in the format of xxx xxx xxx xxx where xxx 0 255 SETTIMEOUT timeout Specifies the maximum amount of time that a Cyclone unit ca...

Страница 47: ...his delay is important if using the USB interface which requires extra time to reenumerate when the Cyclone is reset OPENTYPE x Specifies whether Cyclone units will be identified by IP address or by device name Both of these Cyclone parameters are reconfigurable by the user The value of x may be IP Cyclone units will be identified by their IP addresses NAME Cyclone units will be identified by thei...

Страница 48: ... If OPENTYPE NAME the identifier should be the name of the Cyclone unit Note that the name is case sensitive If OPENTYPE PORT_NUM the identifier should be the port which the Cyclone is connected to If the Cyclone is connected via USB it will be USB where is 1 8 If the Cyclone is connected by Ethernet it will be in the format of xxx xxx xxx xxx where xxx 0 255 If the Cyclone is connected by Serial ...

Страница 49: ...ral this command is not necessary and should not be used ALLIMAGENUM n Sets the image number to be executed on all connected Cyclone units ALLMEDIATYPE n Sets the media type on all connected Cyclone units Valid values for n are 1 Cyclone internal Flash 2 External memory card ALLSTART Executes stand alone programming operations on all connected Cyclones ALLERASEIMAGES Same as ERASEIMAGES except tha...

Страница 50: ...of images stored on the Cyclone unit MEDIATYPE n Sets the media type on the selected Cyclone unit Valid values for n are 1 Cyclone internal Flash 2 External memory card By default a Cyclone unit will use the internal Flash media type RESET Resets the selected Cyclone unit In general this command is not necessary and should not be used START Executes stand alone programming operations only on the s...

Страница 51: ...also satisfy this requirement If the target is reset after programming the image PUTDYNAMICDATA will fail The workaround to this is to execute a second blank image that will re load the algorithm before using this command READDYNAMICDATA address numbytes Reads dynamic data with the selected Cyclone unit address is the starting memory address numbytes is the number of bytes of data to read All valu...

Страница 52: ...1 Operation commands ALLSTART This example connects to a single Cyclone via the USB port that is identified by its IP address 192 168 1 1 and executes its first image by default since we never used the IMAGENUM n command This is the most common usage of the Cyclone Control Utility Setup commands OPENTYPE PORT_NUM SETTIMEOUT 60 Configure for 1 minute timeout PORT USB1 CYCLONE Auriga Operation comma...

Страница 53: ... 192 168 1 2 IMAGENUM 2 PORT ETHERNET CYCLONE 192 168 1 3 IMAGENUM 3 Operation commands ALLSTART This example connects to three separate Cyclone units Two units are connected via USB 192 168 1 1 and 192 168 1 2 and the third is connected via Ethernet 192 168 1 3 The two Cyclone units connected via USB are configured to execute image 2 while the third Cyclone is configured to execute image 3 ...

Страница 54: ...ORT SERIAL CYCLONE PE_PRO1 IMAGENUM 1 Operation commands START PUTDYNAMICDATA 1080 45 44 49 53 4F 4E Here a Cyclone is connected via the Serial port and is identified by name rather than IP address After executing image 1 we write 6 bytes of dynamic data starting at address 0x1080 Note that all parameters for the PUTDYNAMICDATA command should be hexadecimal values ...

Страница 55: ...AGENUM 1 Operation commands ALLSTART SELECT PE_PRO1 IMAGENUM 2 START Two Cyclone units are connected via Ethernet and both Cyclone units execute their first image Afterwards the Cyclone with name PE_PRO1 will execute its second image This example is useful when the processor s code is split into two separate images For example one image could contain the bootloader while the second image contains ...

Страница 56: ...CLONE 209 61 110 144 Operation commands ALLERASEIMAGES ALLADDIMAGE C Images Image1 SAP In this last example two Cyclone units connected via USB have their images erased and a new image is added to both Cyclone units This type of script should only be executed when images need to be updated A separate script should be used to execute the images stored on the Cyclone ...

Страница 57: ... 0x00A0 BM is not pre configured 0x00A1 BR is not pre configured 0x00A2 EB is not pre configured 0x00A3 EW is not pre configured 0x00A4 EM is not pre configured 0x00A5 PB is not pre configured 0x00A6 PW is not pre configured 0x00A7 PM is not pre configured 0x00A8 VM is not pre configured 0x00A9 VR is not pre configured 0x00AA VC is not pre configured 0x00AB USER1 is not pre configured 0x00AC USER2...

Страница 58: ...00B Error reading data byte block 0x000C Error un securing 9S12 target 0x000D Error un securing 9S12 target 0x000F Stand alone operations for the Cyclone PRO are not configured 0x1001 Blank_Check_Word Algorithm is not supported 0x1002 Blank_Check_Byte Algorithm is not available 0x1003 Error during blank checking device using blank_check_byte algorithm 0x1004 Error during blank checking device usin...

Страница 59: ...value 0x7004 Trim value is not calculated 0x7005 Program Word Algorithm is not supported for writing the trim value 0x7006 Program Byte Algorithm is not available for writing the trim value 0x7007 Error during programming the trim value 0x7008 Error during verify trim value 0x7009 Trim value is 00 or FF ...

Страница 60: ...Sample batch files are given for most Microsoft Windows Operating Systems below Windows NT 2000 XP Vista 7 8 10 CYCLONE_LAUNCH test CFG if errorlevel 1 goto bad goto good bad ECHO BAD BAD BAD BAD BAD BAD BAD BAD good ECHO done Windows 95 98 START W CYCLONE_LAUNCH TEST CFG if errorlevel 1 goto bad goto good bad ECHO BAD BAD BAD BAD BAD BAD BAD BAD good ECHO done ...

Страница 61: ...y send individual byte packets which will be interpreted by the Cyclone as commands This is particularly useful for setups that wish to use multiple serial ports on a single host PC as the DLL does not support more than one serial port connection It is also useful for production environments that do not use Microsoft Windows operating systems For more detailed information please refer to the follo...

Отзывы: