Taking fault location system of belt conveyor as application background, the paper proposed a design scheme of gateway of CAN bus and Profibus-DP bus based on STM32F103VE. The gateway is used as a CAN communication node in CAN network and a slave station in Profibus-DP network. Several CAN detection nodes are distributed along belt conveyor and each node is used to detect real-time data collected by four kinds of sensors. If fault is detected, CAN detection nodes would send fault message to the gateway which receives and stores message sent by CAN detection nodes. When the gateway is connected with Profibus-DP master station, the gateway is used as Profibus-DP slave station to send fault message to Profibus-DP master station through query mode to realize fault location function. The actual application showed that the gateway runs stably and reliably and realizes interconnection between CAN bus and Profibus-DP bus of fault location system of belt conveyor.