Introduction - If you have any usage issues, please Google them yourself
Use STM32 timers 1 and USART1 implement MODBUS slave function, with read coil, write coil, a single register read and write single register functions, strictly follow the ModBus communications specifications.