annotate src/cs/services/fcbm/fcbm_reset_mode.c @ 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 a5b00817a60f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
230
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * In this module we are going to implement FCBM functions
248
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
3 * for the reset or miscellaneous boot mode.
230
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 */
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include "rv/rv_general.h"
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include "rvf/rvf_api.h"
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include "rvm/rvm_use_id_list.h"
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 #include "fcbm/fcbm_func_i.h"
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #include "fcbm/fcbm_life_cycle.h"
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #include "fcbm/fcbm_timer_i.h"
243
35474f3a1782 FCBM: beginning of display output
Mychaela Falconia <falcon@freecalypso.org>
parents: 230
diff changeset
12 #include "r2d/r2d.h"
230
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 #include "r2d/r2d_blrr_api.h"
243
35474f3a1782 FCBM: beginning of display output
Mychaela Falconia <falcon@freecalypso.org>
parents: 230
diff changeset
14
248
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
15 extern char fcbm_prod_banner_string[];
245
3eccca3ac219 FCBM: charging state display implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 243
diff changeset
16
248
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
17 void fcbm_process_msg_reset_mode(void)
230
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 {
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 if (fcbm_life_cycle_state != FCBM_STATE_INACTIVE) {
248
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
20 rvf_send_trace("FCBM got reset mode request in wrong state",
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
21 42, fcbm_life_cycle_state,
230
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 RV_TRACE_LEVEL_ERROR, FCBM_USE_ID);
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 return;
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 }
248
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
25 rvf_send_trace("Entering reset boot mode", 24, NULL_PARAM,
230
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 RV_TRACE_LEVEL_DEBUG_HIGH, FCBM_USE_ID);
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 fcbm_subscribe_kpd();
243
35474f3a1782 FCBM: beginning of display output
Mychaela Falconia <falcon@freecalypso.org>
parents: 230
diff changeset
28 fcbm_display_init();
35474f3a1782 FCBM: beginning of display output
Mychaela Falconia <falcon@freecalypso.org>
parents: 230
diff changeset
29 fcbm_display_line(0, fcbm_prod_banner_string);
248
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
30 fcbm_display_line(1, "Misc boot state");
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
31 #ifdef LSCREEN
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
32 fcbm_display_line(3, "Long-press Power");
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
33 fcbm_display_line(4, "button to turn off,");
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
34 #else
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
35 fcbm_display_line(3, "Long-press PWR");
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
36 fcbm_display_line(4, "button to OFF,");
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
37 #endif
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
38 fcbm_display_line(5, "or send fc-tmsh");
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
39 fcbm_display_line(6, "phone-on command");
a5b00817a60f FCBM reset mode implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
40 fcbm_display_line(7, "to boot phone.");
243
35474f3a1782 FCBM: beginning of display output
Mychaela Falconia <falcon@freecalypso.org>
parents: 230
diff changeset
41 r2d_flush();
230
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 blrr_display_ctrl(BLRR_DISPLAY_CHG_BOOT);
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 rvf_start_timer(FCBM_TIMER_DSPL_OFF,
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 RVF_SECS_TO_TICKS(FCBM_DISPLAY_SECS), FALSE);
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 fcbm_life_cycle_state = FCBM_STATE_ACTIVE;
baa738eeb842 FCBM code implemented in first pass
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 }