cancel
Showing results for 
Search instead for 
Did you mean: 

LPUart1 initialization fails on initialization (runtime)

OAtha.1
Associate

using STM32H743ZIT

We are using all the serial ports (i.e) 4 UART and 4 USART and all is good. In addition to the UARTS we are using thre I2c, and CAN

When attempting to add the LPUart1, the initialization fails. There is no pin assignment error etc. The code is generated fine but at runtime we end up in error_handler due to an assert on the following:

/**

 * @brief Set the TXFIFO threshold.

 * @param huart   UART handle.

 * @param Threshold TX FIFO threshold value

 *     This parameter can be one of the following values:

 *      @arg @ref UART_TXFIFO_THRESHOLD_1_8

 *      @arg @ref UART_TXFIFO_THRESHOLD_1_4

 *      @arg @ref UART_TXFIFO_THRESHOLD_1_2

 *      @arg @ref UART_TXFIFO_THRESHOLD_3_4

 *      @arg @ref UART_TXFIFO_THRESHOLD_7_8

 *      @arg @ref UART_TXFIFO_THRESHOLD_8_8

 * @retval HAL status

 */

HAL_StatusTypeDef HAL_UARTEx_SetTxFifoThreshold(UART_HandleTypeDef *huart, uint32_t Threshold)

{

 uint32_t tmpcr1;

 /* Check parameters */

 assert_param(IS_UART_FIFO_INSTANCE(huart->Instance));

Can someone help.

I have attempted to build using only LPUart and it works fine. Could this be an issue regarding some limitation of using all these peripherals simultaneously?

Thanks

4 REPLIES 4
OAtha.1
Associate

The issue is that the LPUART is not included in:

/******************** UART Instances : FIFO mode.******************************/

#define IS_UART_FIFO_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \

                     ((INSTANCE) == USART2) || \

                     ((INSTANCE) == USART3) || \

                     ((INSTANCE) == UART4) || \

                     ((INSTANCE) == UART5) || \

                     ((INSTANCE) == USART6) || \

                     ((INSTANCE) == UART7) || \

                     ((INSTANCE) == UART8))

Therefore it causes the assert.

When using the LPUART, "USE_FULL_ASSERT" preprocessor define cannot be used.

@Amel NASRI​ @Sara BEN HADJ YAHYA​ @Laura C.​ 

Can someone escalate this? The LPUART1 on the H743/H750 is documented as having a Rx and Tx FIFO

Thanks, -Clive

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
LauraCx
ST Employee

Hi @Community member​ ,

We are checking internally. Keep you posted.

Billy OWEN
ST Employee

Hi @OAtha.1​ 

The forum moderator had marked your post as needing a little more investigation and direct support. An online support case has been created on your behalf, please stand by for just a moment and you will hear from us.

Regards,

Billy