Getting stuck in HALT();while configure the UART in xml

Hi All,

I'm working on PK- S5D9 dev kit, I have added the UART configuration Once properly configured just call the uart_main(); in main_thread_entry.c.

Most of the time it gets stuck in HALT(); in MallocLock(). Sometimes  I'm able to see the output in the terminal. I have no idea what's happening in my code. Even though I have deleted the project and import again facing the same issue.

What's the issue? If I want to test uart do I have to create a new thread in the main file or just call the uart main in main_thread_entry();?

I have attached the latest code which includes uart configuration.

Kindly help me out with this issue.

Thanks in advance,

UART_7.5.zip

Issue:- Getting HALT in this function

Regards,

SD

Parents
  • Hello SD,

    Sorry for the late reply

    The issue you face seems to be unrelated to the UART and is concerned the malloc function. Try to remove it from your code if possible to check if the issue is gone.

    As for the UART communication, it depends on the architecture of your program. If the main loop of the main_thread_entry is not overloaded, you can put your uart_main function inside it. Otherwise you better make a separate thread and provide means of communication between the UART and main threads.

    Kind regards,

    Sergey

    If this response, or one provided by another user, answers your question, please verify the answer. Thank you!

    Renesas Engineering Community Moderator
    https://community.renesas.com/
    https://academy.renesas.com/
    https://en-support.renesas.com/knowledgeBase/

  • Hi Sergey,

    The issue you face seems to be unrelated to the UART and is concerned the malloc function. Try to remove it from your code if possible to check if the issue is gone

    I have removed the UART thread and uart_main,c also still has the same error. I suspect that UART pins are mux with some other related to reset or something, so it's getting halted.

    you can put your uart_main function inside it.

    I have tried multiple times, and the same error occurs.

    Otherwise you better make a separate thread and provide means of communication between the UART and main threads.

    Actually, our main requirement is communication should happen between USB, UART and SPI to other devices.

    USB communication is okay same as I'm planning to do it for UART.

    Before integrating UART I just want to Loop back the code so that I can integrate it.

    The application code is fine until I add the UART configuration to the XML file.

    Related to the thread priority issue or any reset pin is mux with UART?

    Regards,

    SD

Reply
  • Hi Sergey,

    The issue you face seems to be unrelated to the UART and is concerned the malloc function. Try to remove it from your code if possible to check if the issue is gone

    I have removed the UART thread and uart_main,c also still has the same error. I suspect that UART pins are mux with some other related to reset or something, so it's getting halted.

    you can put your uart_main function inside it.

    I have tried multiple times, and the same error occurs.

    Otherwise you better make a separate thread and provide means of communication between the UART and main threads.

    Actually, our main requirement is communication should happen between USB, UART and SPI to other devices.

    USB communication is okay same as I'm planning to do it for UART.

    Before integrating UART I just want to Loop back the code so that I can integrate it.

    The application code is fine until I add the UART configuration to the XML file.

    Related to the thread priority issue or any reset pin is mux with UART?

    Regards,

    SD

Children