Index: /tags/ipp-pv3-20140717/ippScripts/scripts/sc_prepare_chip.pl
===================================================================
--- /tags/ipp-pv3-20140717/ippScripts/scripts/sc_prepare_chip.pl	(revision 37313)
+++ /tags/ipp-pv3-20140717/ippScripts/scripts/sc_prepare_chip.pl	(revision 37314)
@@ -32,4 +32,5 @@
 my $detselect= can_run('detselect') or (warn "Can't find detselect" and $missing_tools = 1);
 my $remotetool = can_run('remotetool') or (warn "Can't find remotetool" and $missing_tools = 1);
+my $ipp_burntool_fix = can_run('ipp_apply_burntool_fix.pl') or (warn "Can't find ipp_apply_burntool_fix.pl" and $missing_tools = 1);
 
 if ($missing_tools) {
@@ -199,4 +200,20 @@
         my ($ipp_btt, $remote_btt) = uri_to_outputs_raw($btt);
 
+	# Check burntool table for existance, and if it doesn't, regenerate it.
+	unless (-e $ipp_btt) {
+	    my $exp_name = $chipEntry->{exp_name};
+	    my $burntool_command = "$ipp_burntool_fix --exp_name $exp_name --class_id $class_id";
+	    $burntool_command   .= " -dbname $dbname" if defined($dbname);
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $burntool_command, verbose => $dbverbose);
+	    # That command repairs the tables, but the instance we learned about may not be correct.  
+	    # Look up the new one.
+	    ($ipp_btt, $remote_btt) = uri_to_outputs_raw($btt);
+	    
+	    unless (-e $ipp_btt) {
+		&my_die("Attempted regeneration of burntool table has failed.  Stopping everything.", $remote_id,$chip_id, $PS_EXIT_CONFIG_ERROR, $fail_state);
+	    }
+	}
+
         # Initialize the ppI command
         my $ppImage_command = "ppImage -file $remote_uri";
