view src/cs/layer1/tools/make_cmd.pl @ 303:f76436d19a7a default tip

!GPRS config: fix long-standing AT+COPS chance hanging bug There has been a long-standing bug in FreeCalypso going back years: sometimes in the AT command bring-up sequence of an ACI-only MS, the AT+COPS command would produce only a power scan followed by cessation of protocol stack activity (only L1 ADC traces), instead of the expected network search sequence. This behaviour was seen in different FC firmware versions going back to Citrine, and seemed to follow some law of chance, not reliably repeatable. This bug has been tracked down and found to be specific to !GPRS configuration, stemming from our TCS2/TCS3 hybrid and reconstruction of !GPRS support that was bitrotten in TCS3.2/LoCosto version. ACI module psa_mms.c, needed only for !GPRS, was missing in the TCS3 version and had to be pulled from TCS2 - but as it turns out, there is a new field in the MMR_REG_REQ primitive that needs to be set correctly, and that psa_mms.c module is the place where this initialization needed to be added.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 08 Jun 2023 08:23:37 +0000
parents 4e78acac3d88
children
line wrap: on
line source

#!perl

# generate a dynamic Linker command file 
# PARAMETER ARE:
# 1 : Name of the Linker command file
# 2 : Name of the file with the parameter
# 

my ($cmd_file_temp,$tmp_file)=@ARGV;

open (TMP, "$tmp_file");
my $const_boot_lib = <TMP>;
my $bss_boot_lib = <TMP>;
my $bss_libs = <TMP>;
my $const_libs = <TMP>;
my $toolchoice_type = <TMP>;
close TMP;

# define the REPLACE STRINGS
my $const_boot_str="(CONST_BOOT_LIB)";
my $bss_boot_str="(BSS_BOOT_LIB)";
my $bss_str="(BSS_LIBS)";
my $const_str="(CONST_LIBS)";

# define some local variables
my $temp;
my @CMD;
my $line;

# determine the cmd file name
@CMD=split /.template/, $cmd_file_temp;
$cmd_file=$CMD[0].".cmd";

open (TMP1, ">$cmd_file");
open (TMP,$cmd_file_temp);
while ($line=<TMP>) {
	if ($line =~ m/$const_boot_str/g) {
		$line=mak_libs ($const_boot_lib)
	}
	if ($line =~ m/$bss_boot_str/g) {
		$line=mak_libs ($bss_boot_lib)
	}
	if ($line =~ m/$bss_str/g) {
		# insert the Libs
		$line=mak_libs ($bss_libs);
	}
	if ($line =~ m/$const_str/g) {
		$line=mak_libs ($const_libs)
	}

    # NEW COMPILER MANAGEMENT 
    # If use of VISUAL LINKER, needs to manage trampoline download.
    # Case of:
    #      - TOOL_CHOICE == 0 => compiler v1.22e with vlinker v1.9902
    if ($toolchoice_type == 0)  {
        $line =~ s(COMMENT2START)();
        $line =~ s(COMMENT2END)();    
    }
     
    if ($toolchoice_type == 3)  {
        $line =~ s(COMMENT2START)(/*);
        $line =~ s(COMMENT2END)(*/);
    }

	print TMP1 $line;
}
close TMP;
close TMP1;
unlink $tmp_file;

sub mak_libs
{
	my ($bss_libs) =@_;
	my @temp;
	@temp = split /=/, $bss_libs;
	$_="\t\t\t" . $temp[1];
	s/\) /)\n\t\t\t/g;
	$_ =~ tr /\"//d;
	return $_;
}