background image

Remote Control Programming User’s Guide

       PM024A02 Rev.2

32     

2.

F_OpenInstances_AndFPAs( snlist ); // hardcoded SN list

 or 
3. 

// scanned available FPA’s SN list 

long SN[MAX_USB_DEV1], Snr[MAX_USB_DEV1];
CString snlist; 
char * buf[20];

F_OpenInstances( 1 );

// DLL initialization - one instance 

F_Set_FPA_index( 

1 ); 

// select access to the first instance

      n = 0;

//number of detected FPAs

for( k=1; k<=MAX_USB_DEV_NUMBER ; k++ )
 {
  SN[k] = F_Check_FPA_access(k);

                if ( SN[k] > 20000000 ) n++;

 }
F_CloseInstances();

// write your own procedure .......  
// remap available FPAs SN to desired FPAs order from SN[k] to Snr[p]

snlist = “*#”; 
for( k=1; k<=n ; k++ )

        sprintf( buf, “ %8.8li”, Snr[k] );

  = buf;

      }
      F_OpenInstances_AndFPAs( snlist );

2.The FPA list in the configuration file:

  

String ->  “C:\Program Files\Elprotronic\FPAs-setup.ini”

 Example of the FPA configuration file:

;

-> semicolon - comment

;  Syntax of the FPAs configuration specified
;  FPA-x   Serial Number
;  where  FPA-x can be  FPA-1, FPA-2, FPA-3 .... up to FPA-8
;   e.g
FPA-1   20050116
FPA-3   20050199
FPA-5   20050198
FPA-6   20050205
; FPA-x can be listed in any order and can contain gaps,
; like above without FPA-2, FPA-4
; When list like above is used, then following fpa can be valid
; fpa -> 1,3,5,6

Summary of Contents for FlashPro-CC

Page 1: ...FlashPro CC Flash Programmer for the CC series devices Chipcon product from TI Remote Control Programming User s Guide PM024A02 Rev 2 December 17 2007 Elprotronic Inc...

Page 2: ...ocument is furnished under a licence and mayonlybe used or copied in accordance with the terms of such a licence Disclaimer of warranties You agree that Elprotronic Inc has made no express warranties...

Page 3: ...AS ACQUIRED WITHIN THIRTY 30 DAYS OF PURCHASE AND YOUR MONEY WILL BE REFUNDED 1 License The software firmware and related documentation collectively the Product is the property of Elprotronic or its l...

Page 4: ...kind including lost profits regardless of the form of action whether in contract tort including negligence strict product liability or otherwise even if Elprotronic has been advised of the possibilit...

Page 5: ...e by one of more of the following measures Reorient or relocate the receiving antenna Increase the separation between the equipment and receiver Connect the equipment into an outlet on a circuit diffe...

Page 6: ...ce_OFF 28 F_OpenInstances 28 F_CloseInstances 29 F_OpenInstancesAndFPAs F_OpenInstances_AndFPAs 29 F_API_DLL_Directory 33 F_Set_FPA_index 34 F_Get_FPA_index 35 F_Disable_FPA_index 35 F_Enable_FPA_inde...

Page 7: ...Reset_Target 61 F_Get_Targets_Vcc 62 4 3 Encapsulated instructions 63 F_AutoProgram 63 F_Verify_Lock_Bit 64 F_Memory_Erase 65 F_Memory_Blank_Check 66 F_Memory_Write 66 F_Memory_Verify 66 F_Memory_Read...

Page 8: ...o_Buffer 78 F_Copy_Buffer_to_direct_RAM 79 F_Copy_direct_RAM_to_Buffer 80 F_Put_Byte_to_Buffer 80 F_Get_Byte_from_Buffer 81 F_Set_PC_and_RUN 81 F_Get_MCU_Data 82 Appendix A 84 FlashPro CC Command Line...

Page 9: ...rogramming speed in production Figure 1 1 shows the connections between PC and up to eight programming adapters The FPAs can be connected to PC USB ports directly or via USB HUB Direct connection to t...

Page 10: ...10...

Page 11: ...Multi FPA application DLL is presented on the Figure 1 2 To support the Multi FPA API DLL feature the software package contains nine dll files the Multi FPA API DLL selector eight standard single FPAs...

Page 12: ...lashProCC FPA8 dll Note Software package contains one FlashProCC FPA1 DLL Files FlashProCC FPA2 DLL to FlashProCC FPA8 DLL will be copied automatically if required The FlashProCC FPAsel dll is transpa...

Page 13: ...ions are executed sequentially from FPA 1 up to FPA 8 but that process can not be seen from the application software When the inactive fpa index is selected then return value from the selected functio...

Page 14: ...e functions used in C application and Visual Basic or similar applications All procedure names used in Visual Basic are starting from VB_xxxx when the procedure names used in C are starting from F_xxx...

Page 15: ...fault setup information This file can be modified and taken directly form the FlashPro CC Flash Programmer application software To create required config ini file the standard FlashPro CC Flash progra...

Page 16: ...re Source code and all related project files are located in the following directory C Program Files Elprotronic CCxx USB FlashPro CC API DLL Demo Cpp Program can be activated by selecting the FlashPro...

Page 17: ...FPA configuration file FPAs setup ini should be opened by pressing the Open FPAs setup ini button in the dialogue screen Take a serial numbers from the FPAs labels and write it on the desired FPAs loc...

Page 18: ...FPA s to USB connectors and run the FlashProCC DLL Demo Cpp exe demo software First the DLL instances should be opened and all connected FPA s should be assigned to desired FPA s indexes It is recomme...

Page 19: ...e DLL function F_Initialization and communication between programming adapter and PC is established Report message is displayed in the report window uses the F_ReportMessage function By default the co...

Page 20: ...nction should be pressed In the presented demo software all sequential functions have very small task to perform to demonstrate how to use the DLL functions See source code of the DLL Demo program in...

Page 21: ...ytes from each target devices taken from addresses 0x60 to 0x6F are displayed Set PC and Run Small program is written and downloaded to each target devices Following program is saved in the XRAM at lo...

Page 22: ...File 4 Power from FPA Enable 5 Open Target 6 Write XRAM Block 7 Read XRAM Block remember XRAM contents 8 Set PC and RUN 9 Read XRAM Block compare with the contents from point 7 On the right part of t...

Page 23: ...destination directory where your application software is installed It is recommended to use the demo program and verify if the setup in your PC and destination directory are done correctly To do that...

Page 24: ...dex 1 select FPA 1 F_Initialization init FPA F_ReadConfigFile filename read configuration data and save to API DLL F_ReadCodeFile format filename read code data and save to DLL do status F_AutoProgram...

Page 25: ...ancesAndFPAs FPAs setup ini DLL and FPA initialization F_Set_FPA_index ALL_ACTIVE_FPA select all FPA s F_Initialization init all FPA s F_ReadConfigFile filename read configuration data and save to all...

Page 26: ...A_index 1 select FPA 1 F_ReadCodeFile format filename1 read code data and save to API DLL 1 F_Set_FPA_index 2 select FPA 2 F_ReadCodeFile format filename2 read code data and save to API DLL 2 F_Set_FP...

Page 27: ...rst after that requested function is executed and at the end communication with the target device is terminated and target device is released from the programming adapter The encapsulated functions sh...

Page 28: ...equired F_Trace_ON F_Trace_ON This function activate the tracing Syntax void MSPPRG_API F_Trace_ON void The F_Trace_ON opens the DLLtrace txt file located in the current directory and records all API...

Page 29: ...it is not recommended to reassign once again the USB port using the F_Check_FPA_access function To check the communication activity with FPA use the F_Get_FPA_SN function that allows to check te comm...

Page 30: ...ents of the FPA list from strinc or configuartion file All FPAs not listed in the FPA configuration file and connected to USB ports are ignored Important Do not use the F_Check_FPA_access afterusingth...

Page 31: ...s serial number Only one character can be specified in the FPA list and must be located on the end of valid SN list All other serial numbers specified after will be ignored This option allows to speci...

Page 32: ...te your own procedure remap available FPAs SN to desired FPAs order from SN k to Snr p snlist for k 1 k n k sprintf buf 8 8li Snr k snlist buf F_OpenInstances_AndFPAs snlist 2 The FPA list in the conf...

Page 33: ...Example F_OpenInstancesAndFPAs FPAs setup ini DLL startup and FPA assignment F_Set_FPA_index ALL_ACTIVE_FPA select all available FPAs F_Initialization init all FPAs F_ReadConfigFile filename download...

Page 34: ...the full path of the directory where the DLLs are located can be specified The F_API_DLL_Directory must be used before F_Initialization function Syntax MSPPRG_API void F_API_DLL_Directory Cstring APID...

Page 35: ...esired DLL instance VALID FPA index 1 to 8 Function allows to disable communication with selected FPA adapter From application point of view all responses will be the same as from the not active FPA C...

Page 36: ...meters fpa FPA index of the desired status fpa index 1 8 Return value Last status from the desired FPAs All F_xxx functions returns the same parameters status as the original API_DLL is returning When...

Page 37: ...shPro CC DLL ID 0x5000 Single API DLL for the GangPro CC DLL ID 0x6000 Multi FPA API DLL for the FlashPro430 DLL ID 0x7000 Multi FPA API DLL for the GangPro430 DLL ID 0x8000 Multi FPA API DLL for the...

Page 38: ...assigning the FPAs to USB ports and it is not recommended to reassign once again the USB port using the F_Check_FPA_access function To check the communication activity with FPA use the F_Get_FPA_SN f...

Page 39: ...serial number every time to the same FPA index For example if the SN 1 20060123 SN 2 20060147 SN 3 0 adapter not present SN 4 20060135 and desired assignment FPA 1 20060123 FPA 2 20060135 FPA 3 20060...

Page 40: ...0FFF Version DLL ID 0x1000 Single DLL for the Parallel Port MSP430 FPA DLL ID 0x2000 Single DLL for the USB MSP430 FPA FlashPro430 DLL ID 0x3000 Single API DLL for the GangPro430 DLL ID 0x4000 Single...

Page 41: ...d then all internal data is cleared or set to the default value initial configuration is downloaded from the config ini file USB driver is initialized if has not been initialized before for the USB ve...

Page 42: ...l has been used the F_Initialization function must be called first Syntax MSPPRG_API INT_X F_Close_All void Return value 0 FALSE 1 TRUE Example F_Initialization required API Dll initialization F_Close...

Page 43: ...detailed description of the all configuration data contents typedef struct INT_X DeviceIndex INT_X PowerTargetEn INT_X CommSpeedIndex INT_X ResetTimeIndex INT_X CustomResetPulseTime INT_X CustomResetI...

Page 44: ...re2 INT_X Spare3 INT_X Spare4 INT_X Spare5 INT_X Spare6 INT_X Spare7 INT_X Spare8 INT_X Spare9 INT_X Spare10 INT_X Spare11 INT_X Spare12 INT_X Spare13 INT_X Spare14 INT_X Spare15 INT_X Spare16 CFG_BLO...

Page 45: ...0 ALL FPAs executed sequentially Similar to the F_ConfigSetup but only one selected item from the CFG_BLOCK structure is modified Syntax MSPPRG_API INT_X F_SetConfig INT_X index INT_X data Return valu...

Page 46: ...BLOCK3_EN 30 CFG_ERASE3_START_ADDR 31 CFG_ERASE3_STOP_ADDR 32 CFG_ERASE_DEFBLOCK4_EN 33 CFG_ERASE4_START_ADDR 34 CFG_ERASE4_STOP_ADDR 35 CFG_READ_DEFBLOCK1_EN 36 CFG_READ1_START_ADDR 37 CFG_READ1_STOP...

Page 47: ...1 SPEED_1MB_INDEX 2 CFG_RESET_TIME_INDEX 4 RESET_10MS_INDEX 0 RESET_100MS_INDEX 1 RESET_200MS_INDEX 2 RESET_500MS_INDEX 3 RESET_CUSTOM_INDEX 4 RESET_TOGGLE_VCC_INDEX 5 CFG_RESET_PULSE_TIME 5 time in m...

Page 48: ...FAST_INDEX 2 CFG_IEEE_ADDR_MODE 16 AP_IEEE_ADDR_DISABLE 0 AP_WR_NEW_IEEE_ADDR 1 AP_RETAIN_CODE_WR_IEEE 2 AP_IEEE_ADDR_BLANK 3 AP_RETAIN_IEEE_ADDR 4 AP_ASSIGN_WR_IEEE_ADDR 5 AP_WR_IEEE_ADDR_FROM_FILE 6...

Page 49: ...ART_ADDR 28 0x00000 to 0x1FFFF CFG_ERASE2_STOP_ADDR 29 0x00000 to 0x1FFFF CFG_ERASE_DEFBLOCK3_EN 30 0 disable 1 enable CFG_ERASE3_START_ADDR 31 0x00000 to 0x1FFFF CFG_ERASE3_STOP_ADDR 32 0x00000 to 0x...

Page 50: ...CFG_READ_DEFBLOCK4_EN 45 0 disable 1 enable CFG_READ4_START_ADDR 46 0x00000 to 0x1FFFF CFG_READ4_STOP_ADDR 47 0x00000 to 0x1FFFF CFG_IEEE_ADDR_LOCATION 48 0x00000 to 0x1FFF8 CFG_IEEE_ADDR_LOC_MODE 49...

Page 51: ...nfig CFG_MICROCONTROLLER F_DispSetup F_DispSetup Copy programmer s configuration to report message buffer in text form VALID FPA index 1 to 8 Syntax MSPPRG_API INT_X F_DispSetup void Return value 1 TR...

Page 52: ...haracters string length no less then REPORT_MESSAGE_MAX_SIZE characters When the F_ReportMessage is called then at the end the internal report message buffer in the programmer software is cleared When...

Page 53: ...comment for the F_ReportMessage function F_GetReportMessageChar allows to get character by character from the report message buffer This function is useful in the Visual Basic application where all me...

Page 54: ...from the file to internal memory buffer Code file format and file name and location path of the desired file must be specified Three file formats are supported Texas Instruments text format Motorola...

Page 55: ...OPEN_FILE_OR_READ_ERR Example int st st F_ReadCodeFile FILE_TI_FORMAT c test demofile txt if st 1 TRUE else if st CODE_IN_ROM if st CODE_OUT_OF_FLASH if st INVALID_CODE_FILE if st OPEN_FILE_OR_READ_E...

Page 56: ...eLoad F_Config_FileLoad F_ConfigFileLoad Modify programmer s configuration setup according to data taken or F_Config_FileLoad from the specified configuration file VALID FPA index 1 to 8 or 0 ALL FPAs...

Page 57: ...fined as follows error OPEN_FILE_OR_READ_ERR Configuration file is a standard text file with the parameters name and value Example st F_ConfigFileLoad c test configfile cfg if st 1 TRUE else Info st 0...

Page 58: ...en cleared first using F_Clr_Code_Buffer function Syntax MSPPRG_API INT_X F_Put_Byte_to_Code_Buffer INT_X address BYTE data Parameters value code address 0x0 to 0x1FFFF data 0x00 to 0xFF Return value...

Page 59: ...Autoprogram 0 is executed and when in the configuration setup this option is enabled Syntax MSPPRG_API void F_Put_IEEEAddr64_to_Buffer ULONG64 data Parameters value data 64 bits unsigned long integer...

Page 60: ...Addr data F_Get_IEEEAddr64_from_Buffer F_Get_IEEEEAddr64_from_Buffer Read IEEE address contents from the buffer VALID FPA index 1 to 8 Syntax MSPPRG_API ULONG64 F_Get_IEEEAddr64_from_Buffer BYTE no Pa...

Page 61: ...ter to target device VALID FPA index 1 to 8 or 0 ALL FPAs executed sequentially Function F_Power_Target switches ON or OFF power from the programming adapter to the target device Note PowerTargetEn fl...

Page 62: ...pulse time is specified by ResetTimeIndex in configuration setup See F_ConfigSetup description for details Syntax MSPPRG_API INT_X F_Reset_Target void Return value 0 FALSE 1 TRUE Example F_Reset_Targ...

Page 63: ...ing adapter becomes OFF if selected Target device is released from the programming adapter F_AutoProgram F_AutoProgram Target device program with full sequence erase blank check program verify and blo...

Page 64: ...from the programmer modify configuration if required F_ConfigSetup config download setup to programmer int st F_ConfigFileLoad c test configfile cfg if st 1 TRUE Info st 0xFFFE do prepare next microc...

Page 65: ...ug command 1 Enable debug command Syntax MSPPRG_API INT_X F_Verify_Lock_Bits void Return value 0x100 8 bits Lock Bits value see above if debug bit is enabled or 0x100 if debug bit is disabled access t...

Page 66: ...F_Memory_Blank_Check void Return value 0 FALSE 1 TRUE F_Memory_Write F_Memory_Write Write content taken from the Code file to the selected Target Devices Flash Memory VALID FPA index 1 to 8 or 0 ALL...

Page 67: ...ing data in flash memory is ignored Syntax MSPPRG_API INT_X F_Memory_Verify INT_X mode mode 0 mode 1 and up reserved Return value 0 FALSE 1 TRUE F_Memory_Read F_Memory_Read Read Flash Memory from sele...

Page 68: ...d be enabled in the configuration setup VALID FPA index 1 to 8 or 0 ALL FPAs executed simultaneously Syntax INT_X MSPPRG_API F_Write_IEEE_Address void Return value 0 FALSE 1 TRUE Example F_Put_IEEEAdd...

Page 69: ..._IEEE_Address IEEE F_Get_IEEEAddr64_from_Buffer F_Write_Lock_Bits F_Write_Lock_Bits Write lock bits to target devices Contents of the lock bits should be set first using configuration setup instructio...

Page 70: ...the code file is ignored in this case Very important The sequential functions allows to program words in the FLASH memoryon anyflash space location Also the same bytes words can be programmed few time...

Page 71: ...communication between programming adapter and target device is initialized Target device is ready to get other sequential instructions Syntax MSPPRG_API INT_X F_Open_Target_Device void Return value 0...

Page 72: ...void Return value 0 FALSE 1 TRUE Example See example above F_Open_Target_Device F_Segment_Erase F_Segment_Erase Erase any segment of the CCxx Flash memory VALID FPA index 1 to 8 or 0 ALL FPAs execute...

Page 73: ...p address of the tested memory should be specified VALID FPA index 1 to 8 or 0 ALL FPAs executed sequentially Parameters start address Even number from 0x0 to 0x1FFFE stop address Odd number from 0x1...

Page 74: ...T_X F_Write_Byte_to_XRAM INT_X addr BYTE data Return value 0 FALSE 1 TRUE Example F_Write_Byte_to_XRAM 0xF010 0x21 F_Read_Byte_from_XRAM F_Read_Byte_from_XRAM Reade one byte from XRAM VALID FPA index...

Page 75: ...yte to be written to target device Syntax MSPPRG_API INT_X F_Write_Byte_to_direct_RAM INT_X addr BYTE data Return value 0 FALSE 1 TRUE Example F_Write_Byte_to_direct_RAM 0x60 0x33 F_Read_Byte_from_dir...

Page 76: ...ers start address Flash address from 0x0 to 0x1FFFF size Size from 1 to MAX_FLASH_SIZE 0x20000 block of data in bytes to be written Syntax MSPPRG_API INT_X F_Copy_Buffer_to_Flash INT_X start_addr INT_...

Page 77: ...ddress INT_X size Parameters start address size Return value 0 FALSE 1 TRUE NOTE Specified address in the temporary RAM Flash buffer is the same as a physical RAM address Example st F_Copy_Flash_to_Bu...

Page 78: ...e for addr 0xF220 addr 0xF300 addr st F_Put_Byte_To_Buffer addr data addr st F_Copy_Buffer_to_XRAM 0xF220 0xE0 F_Copy_XRAM_to_Buffer F_Copy_XRAM_to_Buffer Read specified in size number of bytes from t...

Page 79: ...from_Buffer addr else F_Copy_Buffer_to_direct_RAM F_Copy_Buffer_to_direct_RAM Write size number of bytes from the temporary XRAM Flash buffer no 1 to direct RAM Starting address is specified in the st...

Page 80: ...ect_RAM_to_Buffer INT_X start_address INT_X size Parameters start address direct RAM address 0x00 to 0xFF size size in bytes Return value 0 FALSE 1 TRUE F_Put_Byte_to_Buffer F_Put_Byte_to_Buffer Write...

Page 81: ...F_Put_Byte_to_Buffer addr data addr n st F_Copy_Buffer_to_Flash 0x1000 0x20 F_Get_Byte_from_Buffer F_Get_Byte_from_Buffer Read one byte from the temporary RAM Flash buffer VALID FPA index 1 to 8 Synt...

Page 82: ...not been modified VALID FPA index 1 to 8 or 0 ALL FPAs executed sequentially Syntax MSPPRG_API INT_X F_Set_PC_and_RUN INT_X xram_en INT_X PC_address Parameters xram_en 0 run program located in Flash 1...

Page 83: ...rol Programming User s Guide PM024A02 Rev 2 83 0x40 PCON Idle 0x20 CPU halted 0x10 Power Mode 0 0x08 Halt Status 0x04 Debug Locked 0x02 Oscillator stable 0x01 Stack overflow Return value data from the...

Page 84: ...d contains FP CC commandline exe command line shell interpreter FlashProCC FPAsel dll standard API DLL files FlashProCC FPA1 dll All API DLL files should be located in the same directory where the FP...

Page 85: ...zation initialization with config taken from the config ini setup taken from the FlashPro CC with defined CCxx type code file etc Press ENTER result 1 OK Type F_AutoProgram 0 Press ENTER result 1 OK T...

Page 86: ...me put vaild path and code file name TI txt format F_AutoProgram 0 F_Report_Message F_Put_Byte_to_Buffer 1 0x8000 0x11 F_Put_Byte_to_Buffer 1 0x8001 0x21 F_Put_Byte_to_Buffer 1 0x801F 0xA6 F_Open_Targ...

Page 87: ...ypeVer F_Check_FPA_access index F_Get_FPA_SN fpa F_APIDLL_Directory APIDLLpath F_Initialization F_DispSetup F_Close_All F_Power_Target OnOff F_Reset_Target F_Report_Message F_ReadCodeFile file_format...

Page 88: ..._Read_Byte_from_direct_RAM addr F_Copy_Buffer_to_XRAM start_addr size F_Copy_XRAM_to_Buffer start_addr size F_Copy_Buffer_to_direct_RAM start_addr size F_Copy_direct_RAM_to_Buffer start_addr size F_Se...

Reviews: