TCP loopback
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: TCP loopback
by justinkim ·
안녕하세요?
DHCP를 사용하려면 공유기(DHCP Server)가 있어야합니다.
공유기에 연결하여 DHCP 설정을 한뒤 IP를 제대로 받아오는지 먼저 확인부탁드립니다.
감사합니다.
RE: TCP loopback
by artshlee ·
공유기로부터 DHCP IP address는 잘 읽어오고 있습니다.
PING에 대한 응답도 잘 하고 있는데…
(구성은 공유기 라인 중에 하나를 HUB로 분기시켜 PC와 저희 보드를 함께 연결시키고, PC에 TCP 서버 프로그램으로 Listen 하고 있습니다.)
Loopback 함수의 case문 맨 끝에
if((ret=socket(sn, Sn_MR_TCP, any_port++, 0x00)) != sn) return ret; // TCP socket open with ‘any_port’ port number
이것이 수행되고 나면 SR이 0x22로 계속 유지되므로 connect 시도조차 못하고 있습니다.
아래는 사용 중인 Loopback 함수입니다.
// this is a kind of LOOPBACK_MAIN_NOBLCOK
int32_t loopback_tcpc(uint8_t sn, uint8_t* buf, uint8_t* destip, uint16_t destport)
{
int32_t ret; // return value for SOCK_ERRORs
uint16_t size = 0, sentsize=0;
uint8_t sr;
static uint8_t ssr = 0;
// Port number for TCP client (will be increased)
static uint16_t any_port = 50000;
// Socket Status Transitions
// Check the W5500 Socket n status register (Sn_SR, The ‘Sn_SR’ controlled by Sn_CR command or Packet send/recv status)
sr = getSn_SR(sn);
if (sr!=ssr)
{
ssr = sr;
PrintF(“%d:SR=%02x\n”, sn, sr);
}
switch(sr)
{
case SOCK_ESTABLISHED :
if(getSn_IR(sn) & Sn_IR_CON) // Socket n interrupt register mask; TCP CON interrupt = connection with peer is successful
{
PrintF(“%d:Connected to - %d.%d.%d.%d : %d\r\n”,sn, destip[0], destip[1], destip[2], destip[3], destport);
}
return 1;
}
RE: TCP loopback
by justinkim ·
get Sn_SR을 읽어서 0x22가 나오셨으면 그건 UDP로 소켓이 Open 되어있는것입니다.
말씀하신 SEND KEEP 상태였다면 Sn_CR을 읽어 보신것 같습니다.
DHCP Client는 직접 짜셨나요? 고정IP로 되다가 DHCP를 해서 안되는 거면 DHCP Client 프로그램이 잘못되었을 수 있습니다.
W5500과 NXP 칩을 사용한 보드의 DHCP 예제가 있으니 참고해주시기 바랍니다.
링크 : github.com/Wiznet/W5500_EVB/blo … src/main.c
감사합니다.
RE: TCP loopback
by artshlee ·
ioLibrary 사용한 것인데요… ㅠㅠ
최신버젼 다시 다운 받아서 한번 더 해 보겠습니다.
STM에 조합했을때 사용한 소스를 활용한 것인데 그때는 잘 됐었는데 STR용 프로그램에 링크 시켰더니 이런 증상이 나네요…