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,
Issue:- Getting HALT in this function
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.
If this response, or one provided by another user, answers your question, please verify the answer. Thank you!
Renesas Engineering Community Moderatorhttps://community.renesas.com/https://academy.renesas.com/https://en-support.renesas.com/knowledgeBase/
Sergey (SWF) said: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.
Sergey (SWF) said: you can put your uart_main function inside it.
I have tried multiple times, and the same error occurs.
Sergey (SWF) said: 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?
Actually pins P511, 512 you are using for UART communication are merged with the LCD touch screen
You can check what pins are occupied in the PK-S5D9 board in the User's Manual: www.renesas.com/.../promotion-kit-s5d9-pk-s5d9-users-manual
Thanks for your response
I have configured one more UART as uart channel 0 that also same issue getting stuck in the same line.
I found out something once I made a UART configuration in.XML file after generating the project bsp_init_prng(); this function generated automatically in system_S5D9.c file line no 269.
tx_mutex_get flag is not updating so it's getting halted in the mem.c file.
My requirement is UART0 to integrate with the latest code.
Your project seems really huge now. Let me clarify some things.
1. When you just configure the UART in the SSP configurator, even if you don't use it in your code, does the program still hang?
2. If you totally delete the UART configuration, does everything become fine?
3. What's about the bsp_init_prng(); function? It seems to be unrelated to UART.
I don't find anything wrong in your initialization of the UART module, it all looks correct at the first sight.
Sergey (SWF) said:1. When you just configure the UART in the SSP configurator, even if you don't use it in your code, does the program still hang?
If I didn't configure UART in my project is working fine. Once I configured UART in XML after giving the generate option It got stuck In the same place. Even I didn't use UART in my code.
Sergey (SWF) said:2. If you totally delete the UART configuration, does everything become fine?
If I totally remove the UART in my project that time code is working fine.
Sergey (SWF) said:What's about the bsp_init_prng(); function? It seems to be unrelated to UART.
I also don't know much about this when I compare my working code and non-working code(UART configuration). This function only difference once it enters into this function getting halt in the mem.c file
This function is not related to UART.
But when I debug the code I put the breakpoint previous to this function(line no 266) and then moved to the next line bsp_init(NULL); That time My project(with UART) was working. You also debug it in the same way then you come to know where the issue is coming from.
Even If I comment bsp_init_prng(); build the project again automatically it's generating(uncomment).
Please help me to resolve this issue so that I can debug and QSPI (flash) my code to the board.
This is something really weird. I will forward this issue to our development team, probably there is some error in the SSP.
I will let you know once there are any updates.
Please let me know ASAP.
Please try to increase the heap and stack size of your application.
The SSP version is quite old so I cannot really migrate to my latest e2studio version.