---
title: "W7500P UART2 컴파일에러문의"
url: "https://maker.wiznet.io/forum/13607"
markdown_url: "https://maker.wiznet.io/forum/13607/md"
type: "Forum topic"
category: "MCU & Boards"
author: "yongs1102"
created: "2019-12-13T01:26:40+09:00"
last_activity: "2019-12-16T00:10:32+09:00"
language: "en"
views: 543
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W7500P UART2 컴파일에러문의

## Question

Asked by yongs1102 on 2019-12-13 in MCU & Boards.

UART2를 사용해야하는데 아래처럼하면 컴파일 에러가 생깁니다.

…\main.c(91): error: #167: argument of type “S_UART_TypeDef *” is incompatible with parameter of type “UART_TypeDef *”

S_UART_Init(57600);
UART_StructInit(&UART_InitStructure);

UART_Init(UART2,&UART_InitStructure);

## Replies

### Reply 1 by becky, 2019-12-13

안녕하세요

UART2의경우
S_UART_Init(57600);
만하시면됩니다.

UART_Init()함수는 UART1, UART0을 위한 함수입니다.

Init외에 다른 함수들도 UART2의경우 S_가 붙은 함수들을 사용하시면 됩니다.

### Reply 2 by lawrence, 2019-12-16 (in reply to reply 1)

UART_Init 함수는 UART2를 지원하지 않기 때문에 해당 코드에서 에러가 발생했을 겁니다.

> UART_Init(UART2,&UART_InitStructure);

UART2를 사용하실때는 다음과 같이 선언하시면 됩니다.

> static void UART_Config(void)
> {
> UART_InitTypeDef UART_InitStructure;
>
> ```
UART_StructInit(&UART_InitStructure);
```
>
> #if uart2
> S_UART_Init(57600);
> #else
> UART_Init(UART1, &UART_InitStructure);
> #endif
> }

혹시 다음과 같이 진행하셨을때 제대로 동작되지 않는다면 사용하시는 펌웨어 버전 또는 다운받으신 경로를 알려주세요

감사합니다.

---

Source: https://maker.wiznet.io/forum/13607
