参考如下几个文章: STM32 移植FreeModbus 详细过程 手把手教你移植FreeModbus到STM32 STM32 HAL库移植freemodbus-v1.6详细步骤 STM32 移植FreeModbus详细过程