S32G399A_RDB3 Linflexd Uart baudrate configuration

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32G399A_RDB3 Linflexd Uart baudrate configuration

389 次查看
superyyf
Contributor II

Dear NXP,

I was using S32DS to configure the baud rate of uart1 and found that the actual baud rate value did not match what I had configured. 

I set the baud rate to 9600, but the actual baud rate is 4800.

baud rate configuration:

const Linflexd_Uart_Ip_UserConfigType Linflexd_Uart_Ip_xHwConfigPB_1_BOARD_INITPERIPHERALS =
{
    /* Actual Baud-rate */
    9600,
    /* Baud-rate mantissa */
    651U,
    /* Baud-rate Divisor */
    1U,
    /* Parity control */
    (boolean)FALSE,
    /* Parity type */
    LINFLEXD_UART_IP_PARITY_EVEN,
    /* Number of stop bits, 1 stop bit (default) or 2 stop bits */
    LINFLEXD_UART_IP_ONE_STOP_BIT,
    /* Number of bits per transmitted/received word */
    LINFLEXD_UART_IP_8_BITS,
    /* Type of UART transfer (interrupt/dma based) */
    LINFLEXD_UART_IP_USING_INTERRUPTS,
    /* Callback to invoke for Uart events.*/
    NULL_PTR,
    /* User callback parameter pointer.*/
    NULL_PTR,
#if (LINFLEXD_UART_IP_HAS_DMA_ENABLED == STD_ON)
    /* DMA channel number for DMA-based rx. */
    255,
    /* DMA channel number for DMA-based tx. */
    255,
#endif
    /* Runtime state structure reference */
    &Linflexd_Uart_Ip_apStateStructure[0U]
};

 

clock configuration:

LINFLEXD_CLK: 50MHz

LIN_BAUD_CLK: 100MHz

According to the chip reference manual, I brought LIN_BAUD_CLK into the formula to calculate the baud rate as 9600, but it is actually 4800

superyyf_0-1701080999625.png

Since the actual baud rate is exactly one-half of my configuration, I'm guessing that the clock source for the baud rate calculation might be LINFLEXD_CLK. Is the LIN_CLK in the formula the corresponding LIN_BAUD_CLK? Or is there any configuration to select the clock source for LIN_CLK?

0 项奖励
回复
0 回复数