The solution to the problem of USB interface damage
One of the flexibility of OpenRE is the quick and easy configuration of hardware resources. Our main control board reserves other serial ports besides serial port one as the default port for HFLink communication. If the serial port USB interface is damaged, it means that the hardware of serial port one is damaged, and other reserved serial ports that are not occupied can be used instead.
The specific method is shown below:
Change makefile
If using control_unit_v2:
Enter the folder .../OpenRE/0_Project/makefile and open the configuration.mk file.
Find the following code:
ifeq "$(strip $(BOARD_TYPE))" "control_unit_v2"
select the usartx for board debug info printf : usart_interface_x,usb_slave
DEBUG_PRINTF_INTERFACE ?= usart_interface_1
select the usartxfor pc communications (hf_link) :usart_interface_x,usb_slave
PC_INTERFACE ?= usart_interface_1
select the usartx for remote control (hf_link) : usart_interface_x
RADIO_INTERFACE ?= usart_interface_4 endif
"DEBUG_PRINTF_INTERFACE" is the serial port number used for debugging, currently serial port 1.
"PC_INTERFACE" is HFLink, that is, the serial port number used for communication between the upper and lower computers, and it is currently serial port 1.
The USB interface is damaged, which means that the serial port one cannot be used normally now. Just edit the text here:
DEBUG_PRINTF_INTERFACE ?= usart_interface_1
PC_INTERFACE ?= usart_interface_1
change into
DEBUG_PRINTF_INTERFACE ?= usart_interface_6
PC_INTERFACE ?= usart_interface_6
That's it.
Note: Serial port 2 is occupied by SBUS, and only serial port 6 is free on the V2 main control board.
If using control_unit_mini:
Enter the folder .../OpenRE/0_Project/makefile and open the system_para.mk file.
Find the following code:
ifeq "$(strip $(BOARD_TYPE))" "control_unit_mini"
select the usartx for board debug info printf : usart_interface_x,usb_slave
DEBUG_PRINTF_INTERFACE ?= usart_interface_4
select the usartx for pc communications (hf_link) : usart_interface_x,usb_slave
PC_INTERFACE ?= usart_interface_4
select the usartx for remote control (hf_link) : usart_interface_x
RADIO_INTERFACE ?= usart_interface_5 endif
DEBUG_PRINTF_INTERFACE is the serial port number used for debugging, currently serial port 4.
PC_INTERFACE is HFLink, that is, the serial port number used for communication between the upper and lower computers, which is currently serial port 1.
The USB interface is damaged, which means that the serial port one cannot be used normally now. Just edit the text here:
DEBUG_PRINTF_INTERFACE ?= usart_interface_4
PC_INTERFACE ?= usart_interface_4
change into
DEBUG_PRINTF_INTERFACE ?= usart_interface_5
PC_INTERFACE ?= usart_interface_5
That's it.
- Connect one end of the USB to the computer, and connect the other end to the usart4 port on the front of the Mini main control board using the USB to TTL adapter board sold in our Taobao store. At this point, the communication is successful.
Connect the USB to TTL adapter board
When we want the computer to communicate with the serial port, we need to connect a USB to TTL adapter board for communication, the following USB to TTL adapter board that we sell as an example to explain. When we change the makefile file, we need to see which interface we change to and connect to the corresponding interface of the board with a 5P molex terminal cable. With the example we mentioned above, control_unit_v2 needs to be connected to the uart6 port, so control_unit_mini needs to be connected to the usart4 port.