Two UARTS & RSPI implementations for simultaneous continuous data reception (S5D5 MCU)

Dear Renesas Community,

I am reaching out to seek assistance regarding an issue we are experiencing with the S5D5 MCU in our IV pole system, which we use at Aurolab.

We have integrated the S5D5 MCU into our IV pole system to handle various tasks, including receiving weight data from a load cell via UART3 port in continuous TTL format, receiving pole height data from a U/I interface via UART9 port in continuous RS232 format, and displaying the data via LED to the MAX7219 IC using the RSPI port.

While individual functionalities work seamlessly when operated alone, we are encountering a synchronization issue when attempting to utilize all three functionalities simultaneously. Specifically, the UART9 port, responsible for receiving pole height data, works for a period of time but stops functioning after approximately an hour, causing the pole to cease changing height.

We have thoroughly reviewed our code and configuration settings, and have attached screenshots of all configuration settings for reference. We suspect that the issue may be related to clock speed, interrupts, or a potential code issue.
We've attached several screenshot of the configurations that might be helpful.
Could you please provide guidance on troubleshooting steps to identify and resolve the root cause of this issue? Much appreciated for any help!
  • Hello dear Saro, thank you for posting to the Renesas community. 

    Unfortunately, we cannot address the exact issue in your code because it can be derived from different sources. but there's some general advice and best practices when you're dealing with real-time critical systems like this and should process multiple tasks.

    As you already know CPU can only do one task at a time, but by utilizing RTOS and interrupt handling and preemption we can make it similar to simultaneous processing. Probably there's some blocking pattern in your application that causes the CPU to be no longer available and you're missing some critical events there. 

    Before anything, try to utilize the software engineering best practices. like UML diagrams and state machine diagrams, dataflow diagrams, and embedded design patterns, if you're not using them. Designing the code before writing even a line of coding sometimes serves you hundreds of hours.  

    My recommendation is: 

    -Create an individual RTOS task as a data acquisition task: here you handle the sensors, Analog parameters, and other process-taking demands. utilize queues and buffers for the data to be processed later on.

    -An individual task for getting and processing the data from the U/I interface: make it a high-priority task if it is time-critical. 

    -An individual Processor task: Process the data, routines, and state machines in your code. here you get data from queues or buffers and don't accumulate or process any input data or time-critical tasks. 

    -Utilize the DMA, DTC, and ELC unit for offloading the CPU when exchanging data. 

    -Try not to process data or perform long tasks in interrupt functions. 

    -Also Make sure you're not manipulating the data from two different tasks simultaneously (using mutex) this synchronization mechanism helps you to wait for some other processes to be done and keeps you away from unknown bugs. 

    Finally, designing a robust application (Specifically in the medical field) can be challenging without proper software engineering, I strongly recommend taking a step back to get a big picture about the overall task process, and their priorities. design error detection mechanisms for each module and make them more traceable and fault tolerant. 

    I hope you're not exhausted by the long text, and find that information useful. don't hesitate to share your code, or to ask for help if needed.

    Best regards, 

    Hossein. 

    If this or any other user's response answers your concern, kindly verify the answer. Thank you!

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