view src/cs/system/bootloader/inc/serial.h @ 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

/*******************************************************************************
 *
 * SERIAL.H
 *
 * This module contains functions to send or receive commands on the USART 8251.
 * Only polled mode is used.
 * 
 * (C) Texas Instruments 1998
 *
 ******************************************************************************/

#ifndef __SERIAL_H__
#define __SERIAL_H__

#include "main/sys_types.h"

/*
 * ser_receive_command and ser_receive_char have 2 modes:
 *      SER_INFINITE : Waits until a command is received.
 *      SER_IMMEDIATE: Returns imediately even if no character is received.
 */

enum {
    SER_INFINITE,
    SER_IMMEDIATE
};

/*
 * Return values of ser_receive_data_for_flash.
 */

enum {
    SER_DATA_READY,
    SER_DATA_ERROR,
    SER_END_OF_FILE
};

extern void ser_wait_no_activity (SYS_UWORD8 device_id);
extern long ser_send_command (SYS_UWORD8 *command, SYS_UWORD8 device_id);
extern SYS_UWORD8 ser_receive_command (SYS_UWORD8 *command, int mode);
extern long ser_receive_data_for_flash (SYS_UWORD32 *address, SYS_UWORD16 *data, SYS_UWORD8 device_id);
extern void ser_initialize_flash_data_detection (void);
extern void ser_initialize_serial_link (void);
extern void ser_wait_last_character_sent (SYS_UWORD8 device_id);

#endif /* __SERIAL_H__ */