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.

关于TIMAC1.5.1中,串口使用DMA方式的配置

RT:我在使用TIMAC1.5.1中,想通过DMA的方式进行串口的数据收发,我做了如下操作:

在工程文件option——>c/c++ Compiler——>Preprocessor我将HAL_DMA=TRUE,xPOWER_SAVING;

但无法使用HalUARTWriter(),期待回复~~



  • @kingper,

    Great.

    希望能把是什么原因导致的,怎么解决的和大家分享下,哈哈!

    前人栽树,后人乘凉!

  • 1、首先如上面说的,修改工程option里面的宏;

    2、我修改的配置文件内容如下:

    #if HAL_UART
    // Always prefer to use DMA over ISR.
    #if HAL_DMA
    #ifndef HAL_UART_DMA
    #if (defined ZAPP_P1) || (defined ZTOOL_P1)
    #define HAL_UART_DMA  1
    #elif (defined ZAPP_P2) || (defined ZTOOL_P2)
    #define HAL_UART_DMA  2
    #else
    #define HAL_UART_DMA  1
    #endif
    #endif
    #define HAL_UART_ISR  0
    #else
    #ifndef HAL_UART_ISR
    #if (defined ZAPP_P1) || (defined ZTOOL_P1)
    #define HAL_UART_ISR  1
    #elif (defined ZAPP_P2) || (defined ZTOOL_P2)
    #define HAL_UART_ISR  2
    #else
    #define HAL_UART_ISR  1
    #endif
    #endif
    #define HAL_UART_DMA  0
    #endif

    PS:因为先前程序有被我改过很多,不知道有没有影响,如果大家遇到这个问题,可以PM我,一起讨论 .