MT2503D配置debug和app串口

  • 1、在mcu\custom\common\hal\nvram\nvram_data_items.c中找到NVRAM_EF_PORT_SETTING_DEFAULT结构体变量,该变量定义了默认的串口参数。具体的参数定义如下:
typedef struct
{
    kal_uint16         tst_port_ps;
    kal_uint16         ps_port; 
    UART_baudrate      tst_baudrate_ps;
    UART_baudrate      ps_baudrate;
    kal_bool           High_Speed_SIM_Enabled;
    kal_uint8          swdbg;
    kal_uint8          uart_power_setting; /* For DCM, Start [Set UART POWER], CTI  */
    kal_uint8          cti_uart_port;
    UART_baudrate      cti_baudrate;
    kal_uint8           tst_port_l1;
    UART_baudrate       tst_baudrate_l1;
    kal_uint8          tst_output_mode;
    kal_uint8         usb_logging_mode;
    kal_uint16        tst_port_dsp;
    UART_baudrate       tst_baud_rate_dsp;
    kal_uint8   usb_cdrom_config;
} port_setting_struct;

具体代码如下:

#if !defined(__CUSTOMIZED_PORT_SETTING__)
static port_setting_struct const NVRAM_EF_PORT_SETTING_DEFAULT[]= 
{ 
{ 
// tst_port_ps,用于连catcher抓log
// ps_port,用于AT的uart口
// 0表示uart1,1表示uart2,4 表示usb,uart_port_usb表示USB CDC串口,99表示none,
// 建议使用宏来表示,在mcu\interface\hal\peripheral\dcl_uart.h中定义了uart_port1、uart_port_usb、uart_port_null等
#if defined (WISDOM_MMI) || defined(NEPTUNE_MMI) 
0, /* tst-ps uses uart_port2(value is 1) */ 
1, /* APP uses uart_port1 (value is 0) */ 
#elif defined(__USB_MULTIPLE_COMPORT_SUPPORT__) && defined(__L4_INIT_MULTIUSB_COM__) 
0, /* TST-PS uses uart_port1 */ 
5, /* ATCI uses uart_port_usb2 */ 
#else
0, /* tst-ps uses uart_port_null(value is 99) */
1, /* APP uses uart_port1 (value is 0) */ 
#endif 

//tst-ps的波特率设置,连catcher的话,catcher必须配置一致,如果是modem,就是EMPTY_MMI
#if defined(EMPTY_MMI) 
921600, /* tst default baud rate for project without MMI */ 
#elif defined (WISDOM_MMI) 
/* under construction !*/ 
#elif defined(__USB_MULTIPLE_COMPORT_SUPPORT__) && defined(__L4_INIT_MULTIUSB_COM__) 
921600, /* TST-PS baud uses 921600 */ 
#else 
115200, /* tst default baud rate base = 115200 = 0x0001C200 */ 
#endif 

// ps的波特率设置,例如连超级终端下AT,超级终端com口的波特率必须与此配置一致
#if defined (__PS_SERVICE__) 
961200, /* ps default baud rate base = 115200 = 0x0001C200 */ 
#else 
57600, /* ps default baud rate base = 57600 = 0x0000E100 */ 
#endif 

KAL_FALSE, /* High SpeedSIM */ 
0, /* SWDBG */ 
#if defined(__ONLY_ONE_UART__) 
1, /* uart power setting (0x03) */ 
#else 
3, 
#endif 

99, /* CTI uart port: uart_null (value is 0x63 (99) */ 
0, /* CTI baud rate: auto*/ 

#if defined (WISDOM_MMI) || defined(NEPTUNE_MMI) 
0, 
#elif defined(__USB_MULTIPLE_COMPORT_SUPPORT__) && defined(__L4_INIT_MULTIUSB_COM__) 
1, /* TST-L1 baud uses uart_port2 */ 
#else 
0, /* tst-l1 uart port, same as tst-ps*/
#endif 

#if defined(EMPTY_MMI)
921600, /* tst default baud rate for project without MMI */ 
#elif defined (WISDOM_MMI) 
/* under construction !*/ 
#elif defined(__USB_MULTIPLE_COMPORT_SUPPORT__) && defined(__L4_INIT_MULTIUSB_COM__) 
921600, /* TST-L1 baud uses 921600 */ 
#else 
115200, /* tst default baud rate base = 115200 = 0x0001C200 */ 
#endif 

0, /* tst output mode*/ 
#if !defined( __UL1_STANDALONE__ ) 
0, /* USB logging mode */ 
#else 
  #if defined(__MODEM_3G_LOGGING__) && defined(_DSPIRDBG__) 
  /* under construction !*/ 
  #else 
  1, 
  #endif /* defined(__MODEM_3G_LOGGING__) && defined(_DSPIRDBG__) */ 
#endif /* __UL1_STANDALONE__ */ 

99, //TST-DSP 
921600, //TST-DSP baudrate 

0 // USB CD-ROM config, 0:CD-ROM , 1: COM 
}, 
}; 
#endif /* !defined(__CUSTOMIZED_PORT_SETTING__) */

注意检查各个宏的定义!!!
__USB_MULTIPLE_COMPORT_SUPPORT__mcu\make\ULTRA2503D_11C_GPRS.mak定义,如果使用这个这个选项,需要在ULTRA2503D_11C_GPRS.mak中设为TRUE,再在NVRAM_EF_PORT_SETTING_DEFAULT修改。

  • 2、在mcu\interface\middleware\nvram_editor_data_item.h找到NVRAM_EF_PORT_SETTING_LID_VERNO,将值增加1,否则更改前面的更改无效。或者烧录时选择format后再烧录。

你可能感兴趣的:(MT2503D配置debug和app串口)