시리얼 포트 매핑
직렬 포트(UART), 장치(예: "ttyS0")와 PX4에서 활성화된 특정 기능(예: TELEM1, TELEM2, GPS1, RC SBUS, 디버그 콘솔)간의 매핑 방법을 설명합니다.
STMxxyyy의 NuttX
보드 설정 파일을 검사하여 STMxxyyy 아키텍처에서 NuttX 빌드에 대한 매핑 획득 방법을 설명합니다. FMUv5를 사용하지만, 다른 FMU 버전/NuttX 보드에도 유사하게 확장할 수 있습니다.
default.cmake
default.cmake는 여러 직렬 포트 매핑을 나열합니다(텍스트 "SERIAL_PORTS" 검색).
/boards/px4/fmu-v5/default.cmake에서:
Alternatively you can launch boardconfig using make px4_fmu-v5 boardconfig
and access the serial port menu
nsh/defconfig
The nsh/defconfig allows you to determine which ports are defined, whether they are UART or USARTs, and the mapping between USART/UART and device. You can also determine which port is used for the serial/debug console.
Open the board's defconfig file, for example: /boards/px4/fmu-v5/nuttx-config/nsh/defconfig
Search for the text "ART" until you find a section like with entries formatted like CONFIG_STM32xx_USARTn=y
(where xx
is a processor type and n
is a port number). For example:
The entries tell you which ports are defined, and whether they are UART or USART.
DEBUG 콘솔 매핑을 가져오기 위해 SERIAL_CONSOLE
에 대한 defconfig 파일을 검색합니다. 아래에서 콘솔이 UART7에 있음을 알 수 있습니다.
To get the DEBUG console mapping we search the defconfig file for SERIAL_CONSOLE
. Below we see that the console is on UART7:
board_config.h
예: /boards/px4/fmu-v5/src/board_config.h
따라서 PX4IO는 ttyS6
에 있습니다(이전 섹션에서 이미 알고 있는 UART8에 매핑되는 것도 볼 수 있습니다).
최종 매핑은 다음과 같습니다.
결합
비행 콘트롤러 문서의 결과 표는 다음과 같습니다.
In the flight controller docs the resulting table is:
UART | 장치 | 포트 |
---|---|---|
UART1 | /dev/ttyS0 | GPS |
USART2 | /dev/ttyS1 | TELEM1 (흐름 제어) |
USART3 | /dev/ttyS2 | TELEM2 (흐름 제어) |
UART4 | /dev/ttyS3 | TELEM4 |
USART6 | /dev/ttyS4 | RC SBUS |
UART7 | /dev/ttyS5 | 디버그 콘솔 |
UART8 | /dev/ttyS6 | PX4IO |
기타 아키텍처
Last updated