This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] RM57L843:LwIP调试消息#2

Guru**** 2535750 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1094236/rm57l843-lwip-debug-message-2

部件号:RM57L843

QJ:您好!

根据上一个线程,客户添加了uartstdio.c和uartstdio.h 他在lwipopts.h中添加了以下陈述

#define LWIP_debug    1.

#define LWIP_platform_DIAG (消息)  UART打印f (消息)

但编译器构建失败。
客户 将以下内容添加到1.4 ..\lwIP-ports\HDK\include\arch\cc.h,现在构建成功完成。

#if 1 ///added
/* Define (sn)printf formatters for these lwIP types */ #define U16_F "u"
#define S16_F "d"
#define X16_F "x"
#define U32_F "u"
#define S32_F "d"
#define X32_F "x"
#endif


但仍然存在两个问题。
1)调试消息已损坏。
字母字符正确显示,但%d,%c,%x等已被奇怪的字符损坏。

2)显示几条调试消息后,将在uartstdio.c.中的UARTvprintf()内生成数据中止

谢谢,此致,
佐治一郎

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好 ,Koichiro-san,

    我没有找到用于启用LWIP_DEBUG并将调试消息打印到UART控制台的原始项目。

    给我一些时间再次测试。 谢谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    此zip文件中有6个文件,请将这些文件添加到lwip项目中:

    uartstdio.h

    uartstdio.c.

    ustdlib.h

    ustdlib.c.

    w_config.h

    w_debug.h

    e2e.ti.com/.../lwip_5F00_debug_5F00_utils.zip

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    修改lwipopts.h以定义 LWIP_PLATFORD_DIAG(..):

    /*************************************************************************
    **调试选项
    ***************** /
    #if 1//def调试
    #define U8_F "c"
    #define S8_F "c"
    #define x8_F "x"
    #define U16_F "u"
    #define S16_F "d"
    #define X16_F "x"
    #define U32_F "u"
    #define S32_F "d"
    #define X32_F "x"
    extern void uartprintf(const char *pcString,...);
    #define LWIP_debug
    #endif

    #define LWIP_platform_DIAG (消息) UART打印f (消息)

    e2e.ti.com/.../6064.lwipopts.h