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サーバーのデモサンプル |
IP_WebserverSample | HTTPサーバーを実装したデモサンプル |
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 | |- lib_embOSLayer_RXv3_L.lib ....... OSインターフェース設定ファイル | |- SYS .................... SYS インターフェース設定(ソース・ヘッダ)
プロジェクト設定では「\Application\_Exclude\IP-Over-USB」フォルダはビルド対象外に設定しています。以下のどちらかの方法で動作確認を行うサンプルアプリケーションを選択します。
各テストアプリケーションの動作確認方法はテストサンプルアプリケーションのヘッダのコメント情報を参照ください。
プロジェクトを再ビルドし、EK-RX671評価ボードに接続してデバッグセッションを開始します。
J29 USBポートをパソコンに接続してプログラムを実行します。デバッガのIOコンソールのログ画面から結果を確認します。
評価ボードのジャンパー設定でJ29 USBポートをDEVICEモードに変更します。
操作手順:プログラム起動してUSBポートをパソコンに接続します。PC側の設定パネル又はデバイスマネジャウインドウからRNDIS LANアダプタデバイスとして認識されていることを確認します。パソコンのコマンドプロンプトから「ping usb.local」を実行してPINGレスポンスを確認します。
Debug IO Console:
SEGGER Software Evaluation Sample Eval Board: EK-RX671 RTOS: SEGGER embOS ---------------------------------------------- 0:019 MainTask - INIT: emNet init started. Version 3.52.0 0:020 MainTask - ********************************************************************* 0:021 MainTask - * emNet Configuration * 0:022 MainTask - ********************************************************************* 0:023 MainTask - * IP_DEBUG: 2 0:024 MainTask - * Memory added: 24568 bytes 0:025 MainTask - * Buffer configuration: 0:026 MainTask - * 12 buffers of 256 bytes 0:027 MainTask - * 9 buffers of 1516 bytes 0:028 MainTask - * TCP Tx/Rx window size per socket: 4380/4380 bytes 0:029 MainTask - * Number of interfaces added: 1 0:030 MainTask - * Interface #0 configuration: 0:031 MainTask - * Type: ETH 0:032 MainTask - * MTU: 1500 0:033 MainTask - * HW addr. not set, trying to read from driver later. 0:034 MainTask - ********************************************************************* 0:035 MainTask - INIT: Link is down 0:036 MainTask - INIT: Init completed 0:037 IP_Task - INIT: IP_Task started 0:038 USBD_Start 0:684 Renesas USB: 512 bytes unused EP buffer RAM (USB_ENDPOINT_BUFFER_POOL_SIZE) 0:719 OS_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 1:020 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 1:021 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 11:628 IP_Task - DHCPs: DISCOVER from 04:22:C7:FE:00:80 on IFace 0 11:629 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 11:630 IP_Task - DHCPs: OFFER 100.127.0.2 11:634 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 11:635 IP_Task - DHCPs: Requested 100.127.0.2 11:636 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 11:637 IP_Task - DHCPs: ACK
パソコン側:
操作手順:
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 RTOS: SEGGER embOS ---------------------------------------------- 0:019 MainTask - INIT: emNet init started. Version 3.52.0 0:020 MainTask - ********************************************************************* 0:021 MainTask - * emNet Configuration * 0:022 MainTask - ********************************************************************* 0:023 MainTask - * IP_DEBUG: 2 0:024 MainTask - * Memory added: 24576 bytes 0:025 MainTask - * Buffer configuration: 0:026 MainTask - * 12 buffers of 256 bytes 0:027 MainTask - * 9 buffers of 1516 bytes 0:028 MainTask - * TCP Tx/Rx window size per socket: 4380/4380 bytes 0:029 MainTask - * Number of interfaces added: 1 0:030 MainTask - * Interface #0 configuration: 0:031 MainTask - * Type: ETH 0:032 MainTask - * MTU: 1500 0:033 MainTask - * HW addr. not set, trying to read from driver later. 0:034 MainTask - ********************************************************************* 0:035 MainTask - INIT: Link is down 0:036 MainTask - INIT: Init completed 0:037 IP_Task - INIT: IP_Task started 0:038 USBD_Start 0:685 Renesas USB: 512 bytes unused EP buffer RAM (USB_ENDPOINT_BUFFER_POOL_SIZE) 0:713 OS_Idle() - LINK: Link state changed: Full duplex, 100MHz 0:714 IP_Task - SetAddrMaskEx done 0:715 IP_Task - IP_DHCPS_ConfigPool done 0:716 IP_Task - IP_DHCPS_ConfigDNSAddr done 0:717 IP_Task - IP_DHCPS_Start done 0:718 IP_Task - IP_MDNS_SERVER_Start done 0:719 IP_Task - IP_DNS_SERVER_Start done 1:020 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 1:021 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 3:214 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 3:215 IP_Task - DHCPs: Requested 100.127.0.2 3:216 IP_Task - *** Warning *** DHCPs: NAK, no previous DISCOVER 3:286 IP_Task - DHCPs: DISCOVER from 04:22:C7:FE:00:80 on IFace 0 3:287 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 3:288 IP_Task - DHCPs: OFFER 100.127.0.2 3:291 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 3:292 IP_Task - DHCPs: Requested 100.127.0.2 3:293 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 3:294 IP_Task - DHCPs: ACK 27:287 Telnet server - New IPv4 client accepted. 36:617 Telnet server - recv() timeout after 5 seconds of inactivity! 36:618 Telnet server - Disconnecting client.
操作手順:
操作手順:
Debug IO Console:
SEGGER Software Evaluation Sample Eval Board: EK-RX671 RTOS: SEGGER embOS ---------------------------------------------- 0:019 MainTask - INIT: emNet init started. Version 3.52.0 0:020 MainTask - ********************************************************************* 0:021 MainTask - * emNet Configuration * 0:022 MainTask - ********************************************************************* 0:023 MainTask - * IP_DEBUG: 2 0:024 MainTask - * Memory added: 24576 bytes 0:026 MainTask - * Buffer configuration: 0:027 MainTask - * 12 buffers of 256 bytes 0:028 MainTask - * 9 buffers of 1516 bytes 0:029 MainTask - * TCP Tx/Rx window size per socket: 4380/4380 bytes 0:030 MainTask - * Number of interfaces added: 1 0:031 MainTask - * Interface #0 configuration: 0:032 MainTask - * Type: ETH 0:033 MainTask - * MTU: 1500 0:034 MainTask - * HW addr. not set, trying to read from driver later. 0:035 MainTask - ********************************************************************* 0:036 MainTask - INIT: Link is down 0:037 MainTask - INIT: Init completed 0:038 IP_Task - INIT: IP_Task started 0:039 USBD_Start 0:675 Renesas USB: 512 bytes unused EP buffer RAM (USB_ENDPOINT_BUFFER_POOL_SIZE) 0:710 OS_Idle() - LINK: Link state changed: Full duplex, 100MHz 0:711 IP_Task - SetAddrMaskEx done 0:712 IP_Task - IP_DHCPS_ConfigPool done 0:713 IP_Task - IP_DHCPS_ConfigDNSAddr done 0:714 IP_Task - IP_DHCPS_Start done 0:715 IP_Task - IP_MDNS_SERVER_Start done 0:716 IP_Task - IP_DNS_SERVER_Start done 0:840 FTP server - Parent - FTPS: Using a memory pool of 8192 bytes for 2 connections. 1:020 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 1:021 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 2:509 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 2:510 IP_Task - DHCPs: Requested 100.127.0.2 2:511 IP_Task - *** Warning *** DHCPs: NAK, no previous DISCOVER 2:556 IP_Task - DHCPs: DISCOVER from 04:22:C7:FE:00:80 on IFace 0 2:557 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 2:558 IP_Task - DHCPs: OFFER 100.127.0.2 2:562 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 2:563 IP_Task - DHCPs: Requested 100.127.0.2 2:564 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 2:565 IP_Task - DHCPs: ACK 49:053 FTP server - Parent - New IPv4 client accepted.
操作手順:
Debug IO Console:
SEGGER Software Evaluation Sample Eval Board: EK-RX671 RTOS: SEGGER embOS ---------------------------------------------- 0:019 MainTask - INIT: emNet init started. Version 3.52.0 0:020 MainTask - ********************************************************************* 0:021 MainTask - * emNet Configuration * 0:022 MainTask - ********************************************************************* 0:023 MainTask - * IP_DEBUG: 2 0:024 MainTask - * Memory added: 24576 bytes 0:025 MainTask - * Buffer configuration: 0:026 MainTask - * 12 buffers of 256 bytes 0:027 MainTask - * 9 buffers of 1516 bytes 0:028 MainTask - * TCP Tx/Rx window size per socket: 4380/4380 bytes 0:029 MainTask - * Number of interfaces added: 1 0:030 MainTask - * Interface #0 configuration: 0:031 MainTask - * Type: ETH 0:032 MainTask - * MTU: 1500 0:034 MainTask - * HW addr. not set, trying to read from driver later. 0:035 MainTask - ********************************************************************* 0:036 MainTask - INIT: Link is down 0:038 MainTask - INIT: Init completed 0:039 IP_Task - INIT: IP_Task started 0:040 USBD_Start 0:690 Renesas USB: 512 bytes unused EP buffer RAM (USB_ENDPOINT_BUFFER_POOL_SIZE) 0:718 OS_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:725 IP_Task - IP_MDNS_SERVER_Start done 0:726 IP_Task - IP_DNS_SERVER_Start done 0:841 Webserver - Parent - WEBS: Using a memory pool of 5120 bytes for 2 connections. 1:020 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 1:021 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0622:C7FF:FEFE:0000 added to IFace: 0 2:241 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 2:242 IP_Task - DHCPs: Requested 100.127.0.2 2:243 IP_Task - *** Warning *** DHCPs: NAK, no previous DISCOVER 2:291 IP_Task - DHCPs: DISCOVER from 04:22:C7:FE:00:80 on IFace 0 2:292 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 2:293 IP_Task - DHCPs: OFFER 100.127.0.2 2:296 IP_Task - DHCPs: REQUEST from 04:22:C7:FE:00:80 on IFace 0 2:297 IP_Task - DHCPs: Requested 100.127.0.2 2:298 IP_Task - DHCPs: Lease time [s] requested 0, granted 7200 2:299 IP_Task - DHCPs: ACK 111:340 Webserver - Parent - New IPv4 client accepted. 111:376 Webserver - Parent - New IPv4 client accepted. 112:183 Webserver - Parent - New IPv4 client accepted. 112:344 Webserver - Parent - New IPv4 client accepted. 112:371 Webserver - Parent - New IPv4 client accepted. 112:412 Webserver - Parent - New IPv4 client accepted. 112:413 Webserver - Parent - New IPv4 client accepted. 112:424 Webserver - Parent - New IPv4 client accepted. 112:425 Webserver - Parent - New IPv4 client accepted. 112:486 Webserver - Parent - New IPv4 client accepted. 112:487 Webserver - Parent - New IPv4 client accepted.
USB-Hostインターフェース