주요 콘텐츠

Set COM Port for Upload and Communication in Simulink

R2026b

Simulink® automatically detects the correct COM port for Pixhawk® boards when uploading firmware and during host-target communication. If automatic detection fails for your board, use this page to identify the correct COM ports and manually configure them in Simulink.

Automatic COM Port Detection

On most Pixhawk boards, the COM port required to upload firmware (bootloader COM port) and the COM port required for MAVLink communication are the same. The Automatically determine serial port for firmware upload option in Simulink model settings detects the correct COM port.

Build options showing Automatically determine serial port for firmware upload option enabled

No additional settings are required in the External Mode, Connected I/O, or PIL tabs for the corresponding simulation modes.

External mode tab with Use the same host serial port option enabled

With automatic detection enabled, no additional configuration is needed even when the board has separate upload and communication ports.

Manually Set COM Port for Upload and Communication

If automatic COM port detection does not work for your board, clear the Automatically determine serial port for firmware upload option and manually configure the ports as described in the following sections.

Identify Bootloader and Communication COM Ports

On some boards, the bootloader COM port for uploading firmware and the main communications COM port are different. When you connect to such boards, the bootloader port appears first in the Device Manager. The port shows for a few seconds and then the main communications port appears. Use the bootloader COM port for firmware upload and the communications port for MAVLink communication or Monitor and Tune simulation.

For example, the following animation shows the Device Manager window when a board with separate ports is connected. After connecting, the bootloader port appears under ports first. This port stays briefly, after which the board loads the main firmware and the main communication port appears.

Device Manager showing bootloader port appearing before communications port

Set Bootloader COM Port for Firmware Upload and Deployment

  1. For the Simulink model, open the Hardware Settings.

    Hardware Settings button on the Simulink Hardware tab

    Build options showing CMake configuration and serial port settings

  2. Clear the Automatically determine serial port for firmware upload option and enter the bootloader serial port in Serial Port for firmware upload.

    Serial Port for firmware upload field with manual port entry

  3. Deploy the Simulink model. On the Hardware tab, in the Mode section, select Run on board and then click Build, Deploy & Start.

Set Communication COM Port for Monitor & Tune (External Mode)

  1. Perform the settings for Build options as shown in the topic Set Bootloader COM Port for Firmware Upload and Deployment.

  2. In the External mode tab, clear the Use the same host serial port for External Mode as used for firmware upload option and enter the main communications port in Host Serial Port (this must be different from the bootloader port you specified in Build options).

    External mode tab showing Host Serial Port with manual port entry

  3. Run the model in External Mode.

Set Communication COM Port for PIL

  1. Perform the settings for Build options as shown in the topic Set Bootloader COM Port for Firmware Upload and Deployment.

  2. In the PIL tab, clear the Use the same host serial port for PIL as used for firmware upload option and enter the main communications port in Host Serial Port (this must be different from the bootloader port you specified in Build options).

    PIL tab showing Host Serial Port with manual port entry

Set Communication COM Port for Connected I/O

  1. Perform the settings for Build options as shown in the topic Set Bootloader COM Port for Firmware Upload and Deployment.

  2. In the Connected I/O tab, clear the Use the same host serial port for Connected I/O as used for firmware upload option and enter the main communications port in Host Serial Port (this must be different from the bootloader port you specified in Build options).

    Connected I/O tab showing Host Serial Port with manual port entry

See Also

Topics