Skip to main content
Mujtaba
Associate III
June 4, 2018
Question

CubeMX USART LL Configuration not Working!

  • June 4, 2018
  • 2 replies
  • 775 views
Posted on June 04, 2018 at 09:54

Dear friends,

I am trying to send 8 bytes over RS485 protocol using LL libraries.

I could achieve sending data using HAL libraries (CubeMX configuration) and

SPL libraries.

Now I want to use LL APIs to transmit data. I've used the following code:

    DE_SIGNAL_GPIO_Port->BSRR = DE_SIGNAL_Pin;

    

    LL_mDelay(100);

    

    for(j=0;j<8;j++)

    {

        while(!LL_USART_IsActiveFlag_TXE(USART1)){}

        LL_USART_TransmitData8(USART1,snd_buff[j]);

        

    }

    

    while(!LL_USART_IsActiveFlag_TC(USART1)){}

    

        

    DE_SIGNAL_GPIO_Port->BRR = DE_SIGNAL_Pin;

The code is not working and no data is transmitted.

The SPL counterpart code that works fine is as follow:

  GPIOA->BSRR=GPIO_Pin_8;

  for(i=0;i<Length+2;i++)

     {

        while(USART_GetFlagStatus(USART1,USART_FLAG_TXE)==RESET){}

        USART1->DR = snd_buff[i];

        }

    while(USART_GetFlagStatus(USART1,USART_FLAG_TC)==RESET){}

    GPIOA->BRR=GPIO_Pin_8;

I'll be thankful if anyone could help run the USART using LL APIs.

    This topic has been closed for replies.

    2 replies

    ST Technical Moderator
    June 4, 2018
    Posted on June 04, 2018 at 10:26

    Hello

    Hossaini.Mujtaba

    ,

    We need some information tohelp you:

    - Which Hardware board, MCU used?

    - Which Firmware and CubeMx version used ?

    - Do you have an error message?

    Could you please share your .ioc file.

    With Regards,

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    Mujtaba
    MujtabaAuthor
    Associate III
    June 5, 2018
    Posted on June 05, 2018 at 07:15

    Dear Imen,

    Thanks for your quick reply.

    I've tested the USART LL APIs on both STM32F107RCt6 and STM32F103RCt6 MCUs and the didn't work.

    I'm using the latest version of CubeMX and my firmware version is 1.6.0.

    I could compile the project successfully without any errors.

    I've attached the whole project in my first message.

    I'll be really thankful if you could help me find the problem.

    Best regards,

    Mujtaba