I’m new with freertos, I’m having a hard time solving the following situation:
The UART_RTOS_Receive function is returning the status kStatus_UART_RxHardwareOverrun I am not able to solve it, I created a modbus code to communicate with the computer.
That almost certainly indicates you haven’t setup the device correctly. Hardware overrun indicates that the receiver has gotten too many characters before the code removed them, but a good driver, especially one designed for an RTOS should have and ISR that gets invoked as soon as a character arrives.
Either that ISR hasn’t been properly configured, or your code has very long critical sections that block the ISR from running.
Those settings look reasonable. As @richard-damon indicated, the root cause of a hardware overrun is receiving more characters than the hardware can buffer. Please verify that the UART0_RX_TX_IRQn handler is unloading all the characters that arrive. It is possible that it is not unloading characters or that a higher priority interrupt is preventing the UART interrupts from happening, or that a critical section is active long enough to block the UART interrupt.
In the past I have toggled a pin (high-low) in the UART interrupt. Then I can see where the characters arrive and the ISR handles them. It becomes quite clear if something is blocking the ISR.
I would recommend that you find a UART example in the Freescale example code. That is likely to be a much simpler program to study and learn from. After learning how that works, your learnings can be applied to correct this application.
Sadly, we support many different silicon platforms and cannot be the masters of each one.
Quite often the silicon vendors provide example code that does not use FreeRTOS. You can use this code to get a better understanding of the UART functionality. It will be easier to debug the FreeRTOS application with this understanding.