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.

[参考译文] TMDS62LEVM:想知道为什么在启用 uart4中断时卡住

Guru**** 2455560 points


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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1484407/tmds62levm-wondering-why-get-stuck-when-enable-the-uart4-interrupt

器件型号:TMDS62LEVM

工具与软件:

您好!  

我注意到 info print ddddddddddddddddddddd 无法通过 UART4打印出来、而我尝试单独启用 UART4中断。 其中 info() print 使用 UART4 TX 线传输到 PC。

代码流程更像

    uart_init();

    uart_open();

    uart_interrupt_enable ();

}

我的 UART 中断使能代码如下所示:

    console_uart_interrupt_config.baseAddr = UART_getBaseAddr(console_uart_config.huart);
    DebugP_assert(console_uart_config.baseAddr != 0U); /* UART baseAddr Invalid!! */    
    /* Register interrupt */
    HwiP_Params     hwiPrms;
    HwiP_Params_init(&hwiPrms);

    hwiPrms.intNum      = console_uart_config.gUartParams.intrNum;
    info("intrNum = %d\n", hwiPrms.intNum);
    hwiPrms.priority    = console_uart_config.gUartParams.intrPriority;
    hwiPrms.eventId      = 1;
    hwiPrms.callback    = &console_RecvISR;
    hwiPrms.args        = (void *) &console_uart_interrupt_config;

    HwiP_construct(&console_uart_interrupt_config.hwiObject, &hwiPrms);

Then go in detail HwiP_construct():
    info("coreId = %d\n", coreId);
    gHwiCtrl.isr[params->intNum] = params->callback;
    info("ddddddddddddddddd\n");

我的 UART 参数设置是这样的,在我调用 uart_open()之前

    // initialize parameters
    console_uart_config.gUartParams.baudRate            = 115200,
    console_uart_config.gUartParams.dataLength          = UART_LEN_8,
    console_uart_config.gUartParams.stopBits            = UART_STOPBITS_1,
    console_uart_config.gUartParams.parityType          = UART_PARITY_NONE,
    console_uart_config.gUartParams.readMode            = UART_TRANSFER_MODE_BLOCKING,
    console_uart_config.gUartParams.readReturnMode      = UART_READ_RETURN_MODE_FULL,
    console_uart_config.gUartParams.writeMode           = UART_TRANSFER_MODE_BLOCKING,
    console_uart_config.gUartParams.readCallbackFxn     = NULL,
    console_uart_config.gUartParams.writeCallbackFxn    = NULL,
    console_uart_config.gUartParams.hwFlowControl       = FALSE,
    console_uart_config.gUartParams.hwFlowControlThr    = UART_RXTRIGLVL_16,
    console_uart_config.gUartParams.transferMode        = UART_CONFIG_MODE_USER_INTR,
    console_uart_config.gUartParams.skipIntrReg         = TRUE,
    console_uart_config.gUartParams.uartDmaIndex        = -1,
    console_uart_config.gUartParams.intrNum             = 132U,
    console_uart_config.gUartParams.intrPriority        = 4U,
    console_uart_config.gUartParams.operMode            = UART_OPER_MODE_16X,
    console_uart_config.gUartParams.rxTrigLvl           = UART_RXTRIGLVL_8,
    console_uart_config.gUartParams.txTrigLvl           = UART_TXTRIGLVL_32,
    console_uart_config.gUartParams.rxEvtNum            = 0U,
    console_uart_config.gUartParams.txEvtNum            = 0U,

我还 比较了 mine 和 uart_echo_low_latency_interrupt 示例项目之间生成的 ti 文件、例如 ti_board_config.c 等、这些文件几乎相同、但我根据需要独立设置 pinmux ()和 uart_open ()、而不是在应用开始时初始化所有文件。 含义  

 //驱动程序_uartOpen();
// Pinmux_init ()

谢谢!

Dazong

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

    我通过更改一个参数 console_uart_config.gUartParams.skipIntrReg 来修复      = false、