Crash CodeWarrior debugger

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Crash CodeWarrior debugger

Jump to solution
1,352 Views
romainbenet
Contributor III

Hi,

 

I run an automatic script on my application in tcl language which uses one breakpoint as you can look on the attached screenshot. This script is executed on Cyclone MAX. The goal is to perform data processing (Processor in the loop) tests. These tests can take several days given the amount of data to process.

 

Our Cyclone Max is connected to the computer through Ethernet. However, it is impossible for us to perform long test sessions because CodeWarrior always crashes after a few hours while running the script.

Do you have any ideas about what can cause such a problem ? We use CodeWarrior 10.6 build 140329.

 

This issue is very embarrassing for us as we plan to develop big market applications with Freescale targets and Code Warrior environment.

 

This week-end my debugger crashes: error CORBA connection. While? You can find an attached file for CORBA connection failed.

 

Thanks,

Romain

Original Attachment has been moved to: CORBA_connection.zip

Labels (1)
0 Kudos
1 Solution
953 Views
romainbenet
Contributor III

Hi,

yesterday I have run in debug mode my application without script and without breakpoint and I have only run the debugger and after many hours CodeWarrior lost the GDI connection to the Cyclone MAX probe.

You can find the following code of an example of the main script but I don't think there is any error.

Thank you for your help.

Romain

########################################################################################################################

########################################################################################################################

#################################                   DEBUGGER  SCRIPT                   #################################

########################################################################################################################

########################################################################################################################

################################################################################

############################## DEFAULT PARAMETERS ##############################

################################################################################

###################################

######### DEFAULT  VALUES #########

###################################

#Initialization by default of number of input data for this test

set InputDataNumber 0

#Initialization by default of number of output data for this test

set OutputDataNumber 0

########################################################################################################################

########################################################################################################################

###############################                   USER  INITIALIZATION                   ###############################

########################################################################################################################

########################################################################################################################

################################################################################

################################## CSV  FILES ##################################

################################################################################

## FOR THESE LINK TO FILE SET THE COMPLETED PATH WITH THE NAME OF THE FILE

# PATH_SOURCE CONTAINS PATH TO CLP WORKSPACE

# CSV USED FOR INPUT DATA

set CSVInputFile "$PATH_SOURCE/PIL/CLP_0/CLP_0_TC1_INPUT_MIL_v1.csv"

# CSV USED FOR OUTPUT DATA

set CSVOutputFile "$PATH_SOURCE/PIL/CLP_0/CLP_0_TC1_OUTPUT_MIL_RESULT_v1.csv"

################################################################################

############################ INPUT DATA DECLARATION ############################

################################################################################

## DATA ARE IN THE SAME ORDER AS CSV READ FILE

## NAME OF DATA ARE ONLY THOSE INTO THE C-CODE

### CSV READ FILE CHANGES VALUE OF THESE DATA

# IF VARIABLE: NAME_C_CODE

# IF ARRAY:    NAME_C_CODE INDEXOFDATAINARRAY

######## CREATION OF THE INPUT DATA TABLE ########

set InputDataTable($InputDataNumber) [list "CLP_u8ToothIndex" ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_au16AdcValues" 0 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_au16AdcValues" 1 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfCosSelected" 0 0 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfCosSelected" 0 1 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfCosSelected" 1 0 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfCosSelected" 1 1 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfSinSelected" 0 0 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfSinSelected" 0 1 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfSinSelected" 1 0 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfSinSelected" 1 1 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_u16DFGSaturationValue" ]; incr InputDataNumber 1

################################################################################

########################### OUTPUT  DATA DECLARATION ###########################

################################################################################

## NAME OF DATA ARE ONLY THOSE INTO THE C-CODE

# IF VARIABLE: NAME_C_CODE

# IF ARRAY:    NAME_C_CODE INDEXOFDATAINARRAY

######## CREATION OF THE OUTPUT DATA TABLE ########

set OutputDataTable($OutputDataNumber) [list "CLP_as16DfgSinSetPoint" 0 ]; incr OutputDataNumber 1

set OutputDataTable($OutputDataNumber) [list "CLP_as16DfgSinSetPoint" 1 ]; incr OutputDataNumber 1

set OutputDataTable($OutputDataNumber) [list "CLP_au16DfgSetPointAmp" 0 ]; incr OutputDataNumber 1

set OutputDataTable($OutputDataNumber) [list "CLP_au16DfgSetPointAmp" 1 ]; incr OutputDataNumber 1

################################################################################

############################# BREAKPOINT  LOCATION #############################

################################################################################

#LINE IN SOURCE FILE TO PUT THE BREAKPOINT FOR ASSOCIATED FUNCTION

#Breakpint at the call of CLP0_RunIteration function

set BreakpointFile CLPI.c

set BreakpointLine 249

########################################################################################################################

########################################################################################################################

###############################                 END USER  INITIALIZATION                 ###############################

########################################################################################################################

########################################################################################################################

########################################################################################################################

########################################################################################################################

###############################   SCRIPT CODE EXECUTION - DO NOT MODIFY FOLLOWING CODE   ###############################

########################################################################################################################

########################################################################################################################

########################################

## CREATION OF A LIST USED FOR CSV OUTPUT

set FirstEmplacement 0

for { set IndexActualData 0 } { $IndexActualData < $OutputDataNumber } { incr IndexActualData 1 } {

   set ActualDataList $OutputDataTable($IndexActualData)

   set NewName [lindex $ActualDataList 0]

   set NbElement [llength $ActualDataList]

   set IndexInElement 1

   while { $IndexInElement < $NbElement } {

      append NewName \[[lindex $ActualDataList $IndexInElement]]

   incr IndexInElement 1

   }

  

   if { $FirstEmplacement == 0 } {

      set ListOfNameForOutputData $NewName

   incr FirstEmplacement 1

   } else {

      lappend ListOfNameForOutputData $NewName

   }

}

## END CREATION OF A LIST FOR CSV WRITE

########################################

# VARIABLE USED TO KNOW IF THERE IS AN ERROR

set EndOfApplication 0

########################################

############ OPEN CSV FILES ############

set ID_CSVInputFile [PGOCF_open $CSVInputFile "r"]

if { $ID_CSVInputFile == "ERROR" } {

   puts "ERROR TO OPEN $CSVInputFile FILE !"

   incr EndOfApplication 1

}

set ID_CSVOutputFile [PGOCF_open $CSVOutputFile "w"]

if { $ID_CSVOutputFile == "ERROR" } {

   puts "ERROR TO OPEN $CSVOutputFile FILE !"

   incr EndOfApplication 1

}

########## END OPEN CSV FILES ##########

########################################

########################################

# READ FIRST LINE - COMMENT AND WRITE IT IN CSV OUTPUT

if { $EndOfApplication == 0 } {

   set ReadInputData [PGRWF_read $ID_CSVInputFile]

   set WriteFileStatus [PGRWF_write $ID_CSVOutputFile $ReadInputData]

   if { $WriteFileStatus == "ERROR" } {

      puts "ERROR ACCESS TO $CsvFileToWrite FILE"

   incr EndOfApplication 1

   }

}

# WRITE SECOND LINE WHICH CONTAINS NAMES

# IN THE CSV LOG

if { $EndOfApplication == 0 } {

   set WriteFileStatus [PGCSV_write $ID_CSVOutputFile $ListOfNameForOutputData]

   if { $WriteFileStatus == "ERROR" } {

      puts "ERROR ACCESS FILE TO WRITE DATA NAME IN $CSVOutputFile"

   incr EndOfApplication 1

   }

}

######### END WRITE FIRST LINE #########

########################################

########################################

## READ CSV FILE WHICH CONTAINS DATA

# READ SECOND LINE

# CONTAIN NAMES OF VARIABLE TO CHANGE THEIR VALUE

# CHECK NUMBER OF VARIABLE IN THIS FILE

if { $EndOfApplication == 0 } {

   set ReadInputData [PGCSV_read $ID_CSVInputFile]

   if { [llength $ReadInputData] != $InputDataNumber } {

      puts "ERROR: READ [llength $ReadInputData] NAMES AND NOT $InputDataNumber AT NAME DECLARATION!"

      incr EndOfApplication 1

   }

}

# READ NEXT LINE

# CONTAIN DATA

# CHECK NUMBER OF DATA ON THIS LINE

if { $EndOfApplication == 0 } {

   set ReadInputData [PGCSV_read $ID_CSVInputFile]

   if { $ReadInputData == "ERROR" } {

      puts "ERROR - NO ACCESS TO READ FILE $CSVInputFile!"

      incr EndOfApplication 1

   }

   if { $ReadInputData == "EmptyLine" } {

      puts "EMPTY LINE - NO DATA PRESENT IN FILE $CSVInputFile!"

      incr EndOfApplication 1

   }

   if { $ReadInputData == "EndOfFile" } {

      puts "END OF FILE - NO DATA IN FILE $CSVInputFile!"

      incr EndOfApplication 1

   }

   if { [llength $ReadInputData] != $InputDataNumber } {

      puts "ERROR: READ [llength $ReadInputData] DATA AND NOT $InputDataNumber IN FILE $CSVInputFile!"

      incr EndOfApplication 1

   }

}

##### END CSV FILE  READ OPERATION #####

########################################

#REMOVE ACTUAL BREAKPOINT AND PUT THE NEW

bp all off

if { $EndOfApplication == 0 } {

   set IDBreakpoint ""

   set IDBreakpoint [bp -auto $BreakpointFile $BreakpointLine]

   if { $IDBreakpoint == "" } {

      puts "ERROR LOCATION OF BREAKPOINT TO $BreakpointFile line $BreakpointLine"

   incr EndOfApplication 1

   }

}

# RUN THE APPLICATION ON THE MICROCONTROLLER

# MAKE SURE THAT APPLICATION DOESN'T YET RUN

stop

#reset

# ACTUAL POSITION IS BEGINNING OF STARTUP FUNCTION

# STOP AUTOMATICALLY IF NO BREAKPOINT HALTS THE PROGRAM DURING 10 SECOND

if { $EndOfApplication == 0 } {

   go 10

}

########################################

## MAIN APPLICATION

while { $EndOfApplication == 0 } {

   # APPLICATION HALTS AT ACTUAL BREAKPOINT

   ####################

   #### INPUT DATA ####

  

   for { set TableIndex 0 } { $TableIndex < $InputDataNumber } { incr TableIndex 1 } {

      # LOAD PROPERTY OF ACTUAL DATA

      set ActualDataList $InputDataTable($TableIndex)

      set InputDataToModify [lindex $ActualDataList 0]

      set NbElement [llength $ActualDataList]

      set IndexInElement 1

      ## IF THIS DATA IS AN ARRAY THEN COMPUTE LOCATION OF INDEX

      while { $IndexInElement < $NbElement } {

         append InputDataToModify \[[lindex $ActualDataList $IndexInElement]]

         incr IndexInElement 1

      }

  

      # WRITE NEW VALUE OF THIS DATA

      # ADD 0x PREFIX ON DATA - CSV DATA FORMAT IN HEXA WITHOUT 0x

      var $InputDataToModify %x = 0x[lindex $ReadInputData $TableIndex]

   }

  

   # RUN APPLICATION

   next

  

   #######################

   ##### OUTPUT DATA #####

   set FirstStep 0

  

   for { set TableIndex 0 } { $TableIndex < $OutputDataNumber } { incr TableIndex 1 } {

      # LOAD PROPERTY OF ACTUAL DATA

      set ActualDataList $OutputDataTable($TableIndex)

      set OutputDataToRead [lindex $ActualDataList 0]

      set NbElement [llength $ActualDataList]

      set IndexInElement 1

      while { $IndexInElement < $NbElement } {

         set NumeroIndex [lindex $ActualDataList $IndexInElement]

         append OutputDataToRead \[$NumeroIndex]

         incr IndexInElement 1

      }

  

      # READ CONTENT OF DATA

      set ReadOutputData [evaluate #x $OutputDataToRead]

      # ReadOutputData IS IN 0x FORAMT. REMOVE 0x PREFIX

      if { $FirstStep == 0 } {

         incr FirstStep 1

         set ListOutputData [format %x $ReadOutputData]

      } else {

         lappend ListOutputData [format %x $ReadOutputData]

      }

   # ListOutputData IS A LIST WHICH CONTAINS VALUE OF OUTPUT DATA

   }

   # SAVE VALUE OF DATA IN FILE

   set WriteFileStatus [PGCSV_write $ID_CSVOutputFile $ListOutputData]

   if { $WriteFileStatus == "ERROR" } {

      puts "ERROR ACCESS TO $CsvFileToWrite FILE"

   incr EndOfApplication 1

   }

  

   ########################################

   ######## READ NEW LINE FROM CSV ########

   set ReadInputData [PGCSV_read $ID_CSVInputFile]

   if { $ReadInputData == "ERROR" } {

      puts "ERROR - NO ACCESS TO READ FILE !"

      incr EndOfApplication 1

   }

   if { $ReadInputData == "EmptyLine" } {

      puts "EMPTY LINE - NO DATA"

      incr EndOfApplication 1

   }

   if { $ReadInputData == "EndOfFile" } {

      puts "END OF FILE - END OF DEBUGGER OPERATION"

      incr EndOfApplication 1

   }

   if { [llength $ReadInputData] != $InputDataNumber } {

      puts "ERROR: READ [llength $ReadInputData] DATA IN THIS FILE AND NOT $InputDataNumber !"

      incr EndOfApplication 1

   }

   ###### END READ NEW LINE FROM CSV ######

   ########################################

  

   #RUN APPLICATION TO BREAKPOINT

   go 10

}

########################################

############# CLOSE  FILES #############

########################################

PGOCF_close $ID_CSVInputFile

PGOCF_close $ID_CSVOutputFile

########################################

########## REMOVE BREAKPPOINT ##########

########################################

bp all off

## INDICATE TO USER THAN PROGRAM APPLICATION TEST IS ENDED

puts "End of script debugger"

########################################################################################################################

########################################################################################################################

############################################   END SCRIPT  CODE EXECUTION   ############################################

########################################################################################################################

########################################################################################################################

########################################################################################################################

########################################################################################################################

###############################                   END DEBUGGER  SCRIPT                   ###############################

########################################################################################################################

########################################################################################################################

View solution in original post

0 Kudos
4 Replies
953 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Romain,

Could you tell us which MCU are you using?

Thanks in advance!

Best Regards,

Carlos Mendoza

Technical Support Engineer

0 Kudos
953 Views
romainbenet
Contributor III

Hi,

I use a MPC5606B on TRK-MPC560xB demoboard with script debugger on tcl language.

Does it have an available update of CodeWarrior (I use 10.6 build 140329) which resolve this debugger problem? There is no document which refers difference between two updates.

Thanks,

Romain BENET

0 Kudos
953 Views
stanish
NXP Employee
NXP Employee

Hello Romain,

Could you possibly attach your .tcl sript?

This might help to find a root cause much faster.

Thanks!

Stan

0 Kudos
954 Views
romainbenet
Contributor III

Hi,

yesterday I have run in debug mode my application without script and without breakpoint and I have only run the debugger and after many hours CodeWarrior lost the GDI connection to the Cyclone MAX probe.

You can find the following code of an example of the main script but I don't think there is any error.

Thank you for your help.

Romain

########################################################################################################################

########################################################################################################################

#################################                   DEBUGGER  SCRIPT                   #################################

########################################################################################################################

########################################################################################################################

################################################################################

############################## DEFAULT PARAMETERS ##############################

################################################################################

###################################

######### DEFAULT  VALUES #########

###################################

#Initialization by default of number of input data for this test

set InputDataNumber 0

#Initialization by default of number of output data for this test

set OutputDataNumber 0

########################################################################################################################

########################################################################################################################

###############################                   USER  INITIALIZATION                   ###############################

########################################################################################################################

########################################################################################################################

################################################################################

################################## CSV  FILES ##################################

################################################################################

## FOR THESE LINK TO FILE SET THE COMPLETED PATH WITH THE NAME OF THE FILE

# PATH_SOURCE CONTAINS PATH TO CLP WORKSPACE

# CSV USED FOR INPUT DATA

set CSVInputFile "$PATH_SOURCE/PIL/CLP_0/CLP_0_TC1_INPUT_MIL_v1.csv"

# CSV USED FOR OUTPUT DATA

set CSVOutputFile "$PATH_SOURCE/PIL/CLP_0/CLP_0_TC1_OUTPUT_MIL_RESULT_v1.csv"

################################################################################

############################ INPUT DATA DECLARATION ############################

################################################################################

## DATA ARE IN THE SAME ORDER AS CSV READ FILE

## NAME OF DATA ARE ONLY THOSE INTO THE C-CODE

### CSV READ FILE CHANGES VALUE OF THESE DATA

# IF VARIABLE: NAME_C_CODE

# IF ARRAY:    NAME_C_CODE INDEXOFDATAINARRAY

######## CREATION OF THE INPUT DATA TABLE ########

set InputDataTable($InputDataNumber) [list "CLP_u8ToothIndex" ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_au16AdcValues" 0 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_au16AdcValues" 1 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfCosSelected" 0 0 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfCosSelected" 0 1 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfCosSelected" 1 0 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfCosSelected" 1 1 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfSinSelected" 0 0 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfSinSelected" 0 1 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfSinSelected" 1 0 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_as16FrfSinSelected" 1 1 ]; incr InputDataNumber 1

set InputDataTable($InputDataNumber) [list "CLP_u16DFGSaturationValue" ]; incr InputDataNumber 1

################################################################################

########################### OUTPUT  DATA DECLARATION ###########################

################################################################################

## NAME OF DATA ARE ONLY THOSE INTO THE C-CODE

# IF VARIABLE: NAME_C_CODE

# IF ARRAY:    NAME_C_CODE INDEXOFDATAINARRAY

######## CREATION OF THE OUTPUT DATA TABLE ########

set OutputDataTable($OutputDataNumber) [list "CLP_as16DfgSinSetPoint" 0 ]; incr OutputDataNumber 1

set OutputDataTable($OutputDataNumber) [list "CLP_as16DfgSinSetPoint" 1 ]; incr OutputDataNumber 1

set OutputDataTable($OutputDataNumber) [list "CLP_au16DfgSetPointAmp" 0 ]; incr OutputDataNumber 1

set OutputDataTable($OutputDataNumber) [list "CLP_au16DfgSetPointAmp" 1 ]; incr OutputDataNumber 1

################################################################################

############################# BREAKPOINT  LOCATION #############################

################################################################################

#LINE IN SOURCE FILE TO PUT THE BREAKPOINT FOR ASSOCIATED FUNCTION

#Breakpint at the call of CLP0_RunIteration function

set BreakpointFile CLPI.c

set BreakpointLine 249

########################################################################################################################

########################################################################################################################

###############################                 END USER  INITIALIZATION                 ###############################

########################################################################################################################

########################################################################################################################

########################################################################################################################

########################################################################################################################

###############################   SCRIPT CODE EXECUTION - DO NOT MODIFY FOLLOWING CODE   ###############################

########################################################################################################################

########################################################################################################################

########################################

## CREATION OF A LIST USED FOR CSV OUTPUT

set FirstEmplacement 0

for { set IndexActualData 0 } { $IndexActualData < $OutputDataNumber } { incr IndexActualData 1 } {

   set ActualDataList $OutputDataTable($IndexActualData)

   set NewName [lindex $ActualDataList 0]

   set NbElement [llength $ActualDataList]

   set IndexInElement 1

   while { $IndexInElement < $NbElement } {

      append NewName \[[lindex $ActualDataList $IndexInElement]]

   incr IndexInElement 1

   }

  

   if { $FirstEmplacement == 0 } {

      set ListOfNameForOutputData $NewName

   incr FirstEmplacement 1

   } else {

      lappend ListOfNameForOutputData $NewName

   }

}

## END CREATION OF A LIST FOR CSV WRITE

########################################

# VARIABLE USED TO KNOW IF THERE IS AN ERROR

set EndOfApplication 0

########################################

############ OPEN CSV FILES ############

set ID_CSVInputFile [PGOCF_open $CSVInputFile "r"]

if { $ID_CSVInputFile == "ERROR" } {

   puts "ERROR TO OPEN $CSVInputFile FILE !"

   incr EndOfApplication 1

}

set ID_CSVOutputFile [PGOCF_open $CSVOutputFile "w"]

if { $ID_CSVOutputFile == "ERROR" } {

   puts "ERROR TO OPEN $CSVOutputFile FILE !"

   incr EndOfApplication 1

}

########## END OPEN CSV FILES ##########

########################################

########################################

# READ FIRST LINE - COMMENT AND WRITE IT IN CSV OUTPUT

if { $EndOfApplication == 0 } {

   set ReadInputData [PGRWF_read $ID_CSVInputFile]

   set WriteFileStatus [PGRWF_write $ID_CSVOutputFile $ReadInputData]

   if { $WriteFileStatus == "ERROR" } {

      puts "ERROR ACCESS TO $CsvFileToWrite FILE"

   incr EndOfApplication 1

   }

}

# WRITE SECOND LINE WHICH CONTAINS NAMES

# IN THE CSV LOG

if { $EndOfApplication == 0 } {

   set WriteFileStatus [PGCSV_write $ID_CSVOutputFile $ListOfNameForOutputData]

   if { $WriteFileStatus == "ERROR" } {

      puts "ERROR ACCESS FILE TO WRITE DATA NAME IN $CSVOutputFile"

   incr EndOfApplication 1

   }

}

######### END WRITE FIRST LINE #########

########################################

########################################

## READ CSV FILE WHICH CONTAINS DATA

# READ SECOND LINE

# CONTAIN NAMES OF VARIABLE TO CHANGE THEIR VALUE

# CHECK NUMBER OF VARIABLE IN THIS FILE

if { $EndOfApplication == 0 } {

   set ReadInputData [PGCSV_read $ID_CSVInputFile]

   if { [llength $ReadInputData] != $InputDataNumber } {

      puts "ERROR: READ [llength $ReadInputData] NAMES AND NOT $InputDataNumber AT NAME DECLARATION!"

      incr EndOfApplication 1

   }

}

# READ NEXT LINE

# CONTAIN DATA

# CHECK NUMBER OF DATA ON THIS LINE

if { $EndOfApplication == 0 } {

   set ReadInputData [PGCSV_read $ID_CSVInputFile]

   if { $ReadInputData == "ERROR" } {

      puts "ERROR - NO ACCESS TO READ FILE $CSVInputFile!"

      incr EndOfApplication 1

   }

   if { $ReadInputData == "EmptyLine" } {

      puts "EMPTY LINE - NO DATA PRESENT IN FILE $CSVInputFile!"

      incr EndOfApplication 1

   }

   if { $ReadInputData == "EndOfFile" } {

      puts "END OF FILE - NO DATA IN FILE $CSVInputFile!"

      incr EndOfApplication 1

   }

   if { [llength $ReadInputData] != $InputDataNumber } {

      puts "ERROR: READ [llength $ReadInputData] DATA AND NOT $InputDataNumber IN FILE $CSVInputFile!"

      incr EndOfApplication 1

   }

}

##### END CSV FILE  READ OPERATION #####

########################################

#REMOVE ACTUAL BREAKPOINT AND PUT THE NEW

bp all off

if { $EndOfApplication == 0 } {

   set IDBreakpoint ""

   set IDBreakpoint [bp -auto $BreakpointFile $BreakpointLine]

   if { $IDBreakpoint == "" } {

      puts "ERROR LOCATION OF BREAKPOINT TO $BreakpointFile line $BreakpointLine"

   incr EndOfApplication 1

   }

}

# RUN THE APPLICATION ON THE MICROCONTROLLER

# MAKE SURE THAT APPLICATION DOESN'T YET RUN

stop

#reset

# ACTUAL POSITION IS BEGINNING OF STARTUP FUNCTION

# STOP AUTOMATICALLY IF NO BREAKPOINT HALTS THE PROGRAM DURING 10 SECOND

if { $EndOfApplication == 0 } {

   go 10

}

########################################

## MAIN APPLICATION

while { $EndOfApplication == 0 } {

   # APPLICATION HALTS AT ACTUAL BREAKPOINT

   ####################

   #### INPUT DATA ####

  

   for { set TableIndex 0 } { $TableIndex < $InputDataNumber } { incr TableIndex 1 } {

      # LOAD PROPERTY OF ACTUAL DATA

      set ActualDataList $InputDataTable($TableIndex)

      set InputDataToModify [lindex $ActualDataList 0]

      set NbElement [llength $ActualDataList]

      set IndexInElement 1

      ## IF THIS DATA IS AN ARRAY THEN COMPUTE LOCATION OF INDEX

      while { $IndexInElement < $NbElement } {

         append InputDataToModify \[[lindex $ActualDataList $IndexInElement]]

         incr IndexInElement 1

      }

  

      # WRITE NEW VALUE OF THIS DATA

      # ADD 0x PREFIX ON DATA - CSV DATA FORMAT IN HEXA WITHOUT 0x

      var $InputDataToModify %x = 0x[lindex $ReadInputData $TableIndex]

   }

  

   # RUN APPLICATION

   next

  

   #######################

   ##### OUTPUT DATA #####

   set FirstStep 0

  

   for { set TableIndex 0 } { $TableIndex < $OutputDataNumber } { incr TableIndex 1 } {

      # LOAD PROPERTY OF ACTUAL DATA

      set ActualDataList $OutputDataTable($TableIndex)

      set OutputDataToRead [lindex $ActualDataList 0]

      set NbElement [llength $ActualDataList]

      set IndexInElement 1

      while { $IndexInElement < $NbElement } {

         set NumeroIndex [lindex $ActualDataList $IndexInElement]

         append OutputDataToRead \[$NumeroIndex]

         incr IndexInElement 1

      }

  

      # READ CONTENT OF DATA

      set ReadOutputData [evaluate #x $OutputDataToRead]

      # ReadOutputData IS IN 0x FORAMT. REMOVE 0x PREFIX

      if { $FirstStep == 0 } {

         incr FirstStep 1

         set ListOutputData [format %x $ReadOutputData]

      } else {

         lappend ListOutputData [format %x $ReadOutputData]

      }

   # ListOutputData IS A LIST WHICH CONTAINS VALUE OF OUTPUT DATA

   }

   # SAVE VALUE OF DATA IN FILE

   set WriteFileStatus [PGCSV_write $ID_CSVOutputFile $ListOutputData]

   if { $WriteFileStatus == "ERROR" } {

      puts "ERROR ACCESS TO $CsvFileToWrite FILE"

   incr EndOfApplication 1

   }

  

   ########################################

   ######## READ NEW LINE FROM CSV ########

   set ReadInputData [PGCSV_read $ID_CSVInputFile]

   if { $ReadInputData == "ERROR" } {

      puts "ERROR - NO ACCESS TO READ FILE !"

      incr EndOfApplication 1

   }

   if { $ReadInputData == "EmptyLine" } {

      puts "EMPTY LINE - NO DATA"

      incr EndOfApplication 1

   }

   if { $ReadInputData == "EndOfFile" } {

      puts "END OF FILE - END OF DEBUGGER OPERATION"

      incr EndOfApplication 1

   }

   if { [llength $ReadInputData] != $InputDataNumber } {

      puts "ERROR: READ [llength $ReadInputData] DATA IN THIS FILE AND NOT $InputDataNumber !"

      incr EndOfApplication 1

   }

   ###### END READ NEW LINE FROM CSV ######

   ########################################

  

   #RUN APPLICATION TO BREAKPOINT

   go 10

}

########################################

############# CLOSE  FILES #############

########################################

PGOCF_close $ID_CSVInputFile

PGOCF_close $ID_CSVOutputFile

########################################

########## REMOVE BREAKPPOINT ##########

########################################

bp all off

## INDICATE TO USER THAN PROGRAM APPLICATION TEST IS ENDED

puts "End of script debugger"

########################################################################################################################

########################################################################################################################

############################################   END SCRIPT  CODE EXECUTION   ############################################

########################################################################################################################

########################################################################################################################

########################################################################################################################

########################################################################################################################

###############################                   END DEBUGGER  SCRIPT                   ###############################

########################################################################################################################

########################################################################################################################

0 Kudos