last update: 2024/04
Demo Sample Application Folder:
Application └ _Exclude ├ IP ..... TCP/IPネットワーク通信機能のデモサンプル
Sample | 説明 |
---|---|
IP_Start | emNet TCP/IPスタックの基本的なスタートアップ手順を示すサンプル |
IP_SHELL_Start | TELNETサーバー(emNet Shellコンソール)を実装します |
IP_SimpleServer | 簡単なTELNETサーバーを実装します |
IP_FTPServerSample | FTPサーバーのデモサンプル |
BSP |- BSP_USB.c ..................... USBポートの初期化設定ファイル | |- Setup |- IP_Config_IP_over_USB.c .... IO-Over-USBドライバインターフェース設定ファイル Config |- IP_Conf.h ............... emNet IPコンフィグレーション設定ファイル |- IP_FTP_SERVER_Conf.h .... emNet FTP Serverコンフィグレーション設定ファイル | |- IO | |- IP_ConfigIO.c ....... デバッグコンソールIOインターフェース設定ファイル | |- OS | |- libFreeRT_OSLayer_RXv3_L.lib ....... OSインターフェース設定ファイル | |- SYS .................... SYS インターフェース設定(ソース・ヘッダ)
プロジェクト設定では「\Application\_Exclude\IP-Over-USB」フォルダはビルド対象外に設定しています。
「\_Exclude\IP-Over-USB」フォルダ下の動作確認を行うテストサンプルファイルをビルド対象設定の「\Application」フォルダ下にコピーします。 各テストアプリケーションの動作確認方法はテストサンプルアプリケーションのヘッダのコメント情報を参照ください。
評価ボードのジャンパー設定でJ29 USBポートをDEVICEモードに変更します。
操作手順:プログラム起動してUSBポートをパソコンに接続します。PC側の設定パネル又はデバイスマネジャウインドウからRNDIS LANアダプタデバイスとして認識されていることを確認します。パソコンのコマンドプロンプトから「ping usb.local」を実行してPINGレスポンスを確認します。
Debug IO Console:
SEGGER Software Evaluation Sample Eval Board: EK-RX671 Base: FreeRTOS V10.0.0 ------------------------------------------------ 0:020 MAIN_TASK - INIT: emNet init started. Version 3.52.0 0:021 MAIN_TASK - ********************************************************************* 0:022 MAIN_TASK - * emNet Configuration * 0:023 MAIN_TASK - ********************************************************************* 0:024 MAIN_TASK - * IP_DEBUG: 2 0:025 MAIN_TASK - * Memory added: 24568 bytes 0:026 MAIN_TASK - * Buffer configuration: 0:027 MAIN_TASK - * 12 buffers of 256 bytes 0:028 MAIN_TASK - * 9 buffers of 1516 bytes 0:029 MAIN_TASK - * TCP Tx/Rx window size per socket: 4380/4380 bytes 0:030 MAIN_TASK - * Number of interfaces added: 1 0:032 MAIN_TASK - * Interface #0 configuration: 0:033 MAIN_TASK - * Type: ETH 0:034 MAIN_TASK - * MTU: 1500 0:035 MAIN_TASK - * HW addr. not set, trying to read from driver later. 0:036 MAIN_TASK - ********************************************************************* 0:037 MAIN_TASK - INIT: Link is down 0:038 MAIN_TASK - INIT: Init completed 0:039 USBD_Start 0:694 Renesas USB: 512 bytes unused EP buffer RAM (USB_ENDPOINT_BUFFER_POOL_SIZE) 0:719 IDLE - LINK: Link state changed: Full duplex, 100MHz 0:720 IP_Task - SetAddrMaskEx done 0:721 IP_Task - IP_DHCPS_ConfigPool done 0:722 IP_Task - IP_DHCPS_ConfigDNSAddr done 0:723 IP_Task - IP_DHCPS_Start done 0:724 IP_Task - IP_MDNS_SERVER_Start done 0:725 IP_Task - IP_DNS_SERVER_Start done 0:757 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 0:758 IP_Task - DHCPs: Requested 100.127.0.2 0:759 IP_Task - *** Warning *** DHCPs: NAK, no previous DISCOVER 0:822 IP_Task - DHCPs: DISCOVER from 04:22:C7:FE:00:80 on IFace 0 0:823 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 0:824 IP_Task - DHCPs: OFFER 100.127.0.2 0:827 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 0:828 IP_Task - DHCPs: Requested 100.127.0.2 0:829 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 0:830 IP_Task - DHCPs: ACK 0:903 IP_Task - *** Warning *** TCP: Packet from 100.127.0.2 port 64197 to 100.127.0.1 port 80 dropped with reset! (pTCPCB == 0) 1:021 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 1:022 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0
パソコン側:
操作手順:
TIMEOUTマクロを編集して5秒のタイムアウト設定は変更可能です
File: IP_SimpleServer.c
// // Telnet server sample. // #define TIMEOUT 5000 // Timeout for recv() [ms].
パソコン側:
Debug IO Console:
SEGGER Software Evaluation Sample Eval Board: EK-RX671 Base: FreeRTOS V10.0.0 ------------------------------------------------ 0:020 MAIN_TASK - INIT: emNet init started. Version 3.52.0 0:021 MAIN_TASK - ********************************************************************* 0:023 MAIN_TASK - * emNet Configuration * 0:024 MAIN_TASK - ********************************************************************* 0:025 MAIN_TASK - * IP_DEBUG: 2 0:026 MAIN_TASK - * Memory added: 24576 bytes 0:027 MAIN_TASK - * Buffer configuration: 0:028 MAIN_TASK - * 12 buffers of 256 bytes 0:029 MAIN_TASK - * 9 buffers of 1516 bytes 0:030 MAIN_TASK - * TCP Tx/Rx window size per socket: 4380/4380 bytes 0:031 MAIN_TASK - * Number of interfaces added: 1 0:032 MAIN_TASK - * Interface #0 configuration: 0:033 MAIN_TASK - * Type: ETH 0:034 MAIN_TASK - * MTU: 1500 0:035 MAIN_TASK - * HW addr. not set, trying to read from driver later. 0:036 MAIN_TASK - ********************************************************************* 0:037 MAIN_TASK - INIT: Link is down 0:038 MAIN_TASK - INIT: Init completed 0:039 USBD_Start 0:699 Renesas USB: 512 bytes unused EP buffer RAM (USB_ENDPOINT_BUFFER_POOL_SIZE) 0:728 IDLE - LINK: Link state changed: Full duplex, 100MHz 0:729 IP_Task - SetAddrMaskEx done 0:730 IP_Task - IP_DHCPS_ConfigPool done 0:732 IP_Task - IP_DHCPS_ConfigDNSAddr done 0:733 IP_Task - IP_DHCPS_Start done 0:734 IP_Task - IP_MDNS_SERVER_Start done 0:735 IP_Task - IP_DNS_SERVER_Start done 0:759 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 0:761 IP_Task - DHCPs: Requested 100.127.0.2 0:762 IP_Task - *** Warning *** DHCPs: NAK, no previous DISCOVER 0:809 IP_Task - DHCPs: DISCOVER from 04:22:C7:FE:00:80 on IFace 0 0:810 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 0:811 IP_Task - DHCPs: OFFER 100.127.0.2 0:815 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 0:816 IP_Task - DHCPs: Requested 100.127.0.2 0:817 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 0:818 IP_Task - DHCPs: ACK 1:121 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 1:123 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 63:253 MAIN_TASK - New IPv6 client accepted. 70:705 MAIN_TASK - recv() timeout after 5 seconds of inactivity! 70:706 MAIN_TASK - Disconnecting client.
操作手順:
操作手順:
Debug IO Console:
SEGGER Software Evaluation Sample Eval Board: EK-RX671 Base: FreeRTOS V10.0.0 ------------------------------------------------ 0:020 MAIN_TASK - INIT: emNet init started. Version 3.52.0 0:021 MAIN_TASK - ********************************************************************* 0:022 MAIN_TASK - * emNet Configuration * 0:023 MAIN_TASK - ********************************************************************* 0:024 MAIN_TASK - * IP_DEBUG: 2 0:025 MAIN_TASK - * Memory added: 24568 bytes 0:026 MAIN_TASK - * Buffer configuration: 0:027 MAIN_TASK - * 12 buffers of 256 bytes 0:028 MAIN_TASK - * 9 buffers of 1516 bytes 0:029 MAIN_TASK - * TCP Tx/Rx window size per socket: 4380/4380 bytes 0:030 MAIN_TASK - * Number of interfaces added: 1 0:031 MAIN_TASK - * Interface #0 configuration: 0:032 MAIN_TASK - * Type: ETH 0:033 MAIN_TASK - * MTU: 1500 0:034 MAIN_TASK - * HW addr. not set, trying to read from driver later. 0:035 MAIN_TASK - ********************************************************************* 0:036 MAIN_TASK - INIT: Link is down 0:037 MAIN_TASK - INIT: Init completed 0:038 USBD_Start 0:678 Renesas USB: 512 bytes unused EP buffer RAM (USB_ENDPOINT_BUFFER_POOL_SIZE) 0:707 IDLE - LINK: Link state changed: Full duplex, 100MHz 0:708 IP_Task - SetAddrMaskEx done 0:709 IP_Task - IP_DHCPS_ConfigPool done 0:710 IP_Task - IP_DHCPS_ConfigDNSAddr done 0:711 IP_Task - IP_DHCPS_Start done 0:713 IP_Task - IP_MDNS_SERVER_Start done 0:714 IP_Task - IP_DNS_SERVER_Start done 0:742 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 0:743 IP_Task - DHCPs: Requested 100.127.0.2 0:744 IP_Task - *** Warning *** DHCPs: NAK, no previous DISCOVER 0:817 IP_Task - DHCPs: DISCOVER from 04:22:C7:FE:00:80 on IFace 0 0:818 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 0:819 IP_Task - DHCPs: OFFER 100.127.0.2 0:822 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 0:823 IP_Task - DHCPs: Requested 100.127.0.2 0:824 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 0:825 IP_Task - DHCPs: ACK 0:841 MAIN_TASK - FTPS: Using a memory pool of 4096 bytes for 1 connections. 1:021 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 1:022 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 30:242 MAIN_TASK - New IPv6 client accepted. 59:733 FTP server - Client connection closed.
USB-Hostインターフェース