2023-01-01 07:25 PM
I'm trying to use STM32F730 for MODBUS communication. The datasheet and reference manual both shows support for MODBUS. However the problem is :
static void MX_USART1_Init(void)
{
/* USER CODE BEGIN USART1_Init 0 */
/* USER CODE END USART1_Init 0 */
/* USER CODE BEGIN USART1_Init 1 */
/* USER CODE END USART1_Init 1 */
/* USER CODE BEGIN USART1_Init 2 */
/* USER CODE END USART1_Init 2 */
}
As per my understanding this initialization function is not correct.
So all of you are requested to help me to understand what is the issue.
Regards
Solved! Go to Solution.
2023-01-03 04:22 AM
Data sheet and RM mention "basic support for the implementation of Modbus/RTU and Modbus/ASCII
protocols".
It further states "The control part of the protocol (address recognition, block integrity control and command interpretation) must be implemented in software."
There are now several possibilities:
You can also find the topic Modbus here in the community.
Maybe that will help you?
Regards
/Peter
2023-01-03 04:22 AM
Data sheet and RM mention "basic support for the implementation of Modbus/RTU and Modbus/ASCII
protocols".
It further states "The control part of the protocol (address recognition, block integrity control and command interpretation) must be implemented in software."
There are now several possibilities:
You can also find the topic Modbus here in the community.
Maybe that will help you?
Regards
/Peter
2023-01-05 12:26 AM
thanks sir
It further states "The control part of the protocol (address recognition, block integrity control and command interpretation) must be implemented in software."
sir, does it mean mean that everything related to USART initialization (such as baud rate, DMA utilization etc.) will be implemented in program
2023-01-05 12:27 AM
Correct.
2023-01-05 08:56 PM
Dear sir,
i've one more question
whether it will be better to use USART or UART initialization functions.
i'm asking because UART driver has directly RS485 function which has feature to activate the hardware flow control
2023-01-06 01:23 AM
This should not matter, as both USART and UART offer hardware flow control for RS232 as well as RS485.
Regards
/Peter
2023-01-06 01:35 AM
@NSing.5 A STM32 MCU can have three kinds of UART-like modules (IPs) called UART, USART or LPUART. They behave mainly same for usual applications, including RS422/485/232. So it indeed is confusing which HAL driver to use: UART or USART.
Recent Cube versions generate code with the "UART" HAL driver, for both UARTs and USARTs.
2023-01-06 01:36 AM
bit sir i'm unable to locate the hardware flow control enable element in USART initialization structure definition.
plz guide me how to do it.
regards
2023-01-06 02:56 AM
So, use the UART driver (stm32f7xx_hal_uart.h, stm32f7xx_hal_uart.c).
Even for a USART.