last update: 2025/05
開発環境/IDE:Renesas CCRX (e2Studio)
Modbus | Modbus Master (TCP), Modbus Slave (TCP) |
---|---|
セキュリティ | SSH Secure Shell, SSL / TLS Secure Sockets Layer |
IoT Toolkit | HTTP Client |
リリースプログラムの「RX72N_EnvisionKit」及び「Windows」フォルダを、開発環境インストール済みのユーザーパソコンのローカルドライブにコピーします。
[Workspace] ├ RX72N_EnvisionKit .... サンプルプログラム一式 └ Windows .............. テスト用PCツール
RX72N_EnvisionKit ├ Application ................... テスト用サンプルアプリケーション ├ BSP ................... ハードウエア依存設定、ドライバ ├ Config ................... コンフィグレーション設定、システム依存設定 ├ EVAL_Libs ................... SEGGERソフトウエア評価版ライブラリ ├ License.txt ................... 評価版ライブラリの利用条件 ├ .project ................... e2Studio環境用プロジェクト └ rx72n_envisionkit_m3s_t4.scfg ...... e2Studio FITコンフィグレータ設定
Application ├ Main.c ...... メインエントリハンドラ └ _Exclude ...... ※このフォルダはビルド対象外に設定しています ├ IOT .... HTTPクライアントデモサンプル ├ MB .... MODBUS/TCP MASTER・SLAVE機能のデモサンプル ├ SSL .... SSL 通信機能のデモサンプル ├ SSH .... SSH 通信機能のデモサンプル └ M3S_T4_Startup.c .... M3S-T4-Tiny TCP/IPスタックの基本デモサンプル
RX72N_EnvisionKit └ BSP ├ BSP.c ......... ボード上のLEDインターフェースのドライバ ├ BSP_M3S_T4.c .... M3S-T4-Tinyモジュールのスタートアップコード ├ Setup ......... 各ソフトウエアライブラリのハードウエア依存のドライバ設定 └ smc_gen ......... e2StudioのスマートFITコンフィグレータで作成されたBSP
ボードのクロック・PLL設定はFITコンフィグレータで行います。
メインクロック:16MHz
FlashIFクロック(FCLK):60MHz
システムクロック(ICLK):240MHz
周辺モジュールクロック(PCLKA):120MHz
周辺モジュールクロック(PCLKB):60MHz周辺モジュールクロック(PCLKC):60MHz
周辺モジュールクロック(PCLKD):60MHz
外部バスクロック(BCLK):80MHz
USBクロック:48MHz
CLKOUT25Mクロック:25MHz
※スマートFITコンフィグレータ設定内容の確認及び変更する場合は、以下の手順をご参照ください。
SU,SI,B_1,R_1,B_2,R_2,B,R,B_8,R_8/04,B_ETHERNET_BUFFERS*,B_RX_DESC*,B_TX_DESC*/0800000,BEXRAM_1,REXRAM_1,BEXRAM_2,REXRAM_2,BEXRAM,REXRAM,BEXRAM_8,REXRAM_8/0810000,PResetPRG,C_1,C_2,C,C_8,C$*,D*,W*,L,P/0FFC00000,EXCEPTVECT/0FFFFFF80,RESETVECT/0FFFFFFFC
0x0000_0004 | SU, SI, B_1, R_1, B_2, R_2, B, R, B_8, R_8 |
0x0080_0000 | B_ETHERNET_BUFFERS*, B_RX_DESC*, B_TX_DESC* |
0x0081_0000 | BEXRAM_1, REXRAM_1, BEXRAM_2, REXRAM_2, BEXRAM, REXRAM, BEXRAM_8, REXRAM_8 |
0xFFC0_0000 | PResetPRG, C_1, C_2, C, C_8, C$*, D*, W*, L, P |
0xFFFF_FF80 | EXCEPTVECT |
0xFFFF_FFFC | RESETVECT |
ルネサス社製 M3S-T4-TINY TCP/IPプログラムはスマートFITコンフィグレータから作成します。
追加するソフトウエアコンポーネント:
※ その他デフォルト設定値のまま
システムコールバックハンドラ(system_callback関数)はルネサス様提供標準サンプルのコードのまま使用しています。
File: BSP_M3S_T4.c
/****************************************************************************** * Function Name : system_callback * Description : Ethernet callback. * Argument : UB channel ; RJ45 interface * : UW eventid ; Event code * : VP param ; Parameter block * Return Value : ER ; always 0 (not in use) ******************************************************************************/ ER system_callback(UB channel, UW eventid, VP param) { uint8_t* ev_tbl[] = { "ETHER_EV_LINK_OFF", "ETHER_EV_LINK_ON", "ETHER_EV_COLLISION_IP", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "DHCP_EV_LEASE_IP", "DHCP_EV_LEASE_OVER", "DHCP_EV_INIT", "DHCP_EV_INIT_REBOOT", "DHCP_EV_APIPA", "DHCP_EV_NAK", "DHCP_EV_FATAL_ERROR", "DHCP_EV_PLEASE_RESET" }; #if defined(DEBUG_PRINT) printf("callback ch:%d, eventID = %s\n", channel, ev_tbl[eventid]); #endif /*#if defined(DEBUG_PRINT)*/ switch(eventid) { case ETHER_EV_LINK_OFF: { /* Do Nothing. */ } break; case ETHER_EV_LINK_ON: { /* Do Nothing. */ } break; case ETHER_EV_COLLISION_IP: { /* Do Nothing. */ } break; case DHCP_EV_LEASE_IP: { /* cast from VP to DHCP* */ gpt_dhcp[channel] = (DHCP*)param; #if defined(DEBUG_PRINT) printf("DHCP.ipaddr[4] %d.%d.%d.%d\n", gpt_dhcp[channel]->ipaddr[0], gpt_dhcp[channel]->ipaddr[1], gpt_dhcp[channel]->ipaddr[2], gpt_dhcp[channel]->ipaddr[3]); printf("DHCP.maskaddr[4] %d.%d.%d.%d\n", gpt_dhcp[channel]->maskaddr[0], gpt_dhcp[channel]->maskaddr[1], gpt_dhcp[channel]->maskaddr[2], gpt_dhcp[channel]->maskaddr[3]); printf("DHCP.gwaddr[4] %d.%d.%d.%d\n", gpt_dhcp[channel]->gwaddr[0], gpt_dhcp[channel]->gwaddr[1], gpt_dhcp[channel]->gwaddr[2], gpt_dhcp[channel]->gwaddr[3]); printf("DHCP.dnsaddr[4] %d.%d.%d.%d\n", gpt_dhcp[channel]->dnsaddr[0], gpt_dhcp[channel]->dnsaddr[1], gpt_dhcp[channel]->dnsaddr[2], gpt_dhcp[channel]->dnsaddr[3]); printf("DHCP.dnsaddr2[4] %d.%d.%d.%d\n", gpt_dhcp[channel]->dnsaddr2[0], gpt_dhcp[channel]->dnsaddr2[1], gpt_dhcp[channel]->dnsaddr2[2], gpt_dhcp[channel]->dnsaddr2[3]); printf("DHCP.macaddr[6] %02X:%02X:%02X:%02X:%02X:%02X\n", gpt_dhcp[channel]->macaddr[0], gpt_dhcp[channel]->macaddr[1], gpt_dhcp[channel]->macaddr[2], gpt_dhcp[channel]->macaddr[3], gpt_dhcp[channel]->macaddr[4], gpt_dhcp[channel]->macaddr[5]); printf("DHCP.domain[%d] %s\n", strlen(gpt_dhcp[channel]->domain), gpt_dhcp[channel]->domain); printf("\n"); #endif /*#if defined(DEBUG_PRINT)*/ } break; case DHCP_EV_LEASE_OVER: { /* Do Nothing. */ } break; case DHCP_EV_INIT: { /* Do Nothing. */ } break; case DHCP_EV_INIT_REBOOT: { /* Do Nothing. */ } break; case DHCP_EV_APIPA: { /* cast from VP to DHCP* */ gpt_dhcp[channel] = (DHCP*)param; #if defined(DEBUG_PRINT) printf("DHCP.ipaddr[4] %d.%d.%d.%d\n", gpt_dhcp[channel]->ipaddr[0], gpt_dhcp[channel]->ipaddr[1], gpt_dhcp[channel]->ipaddr[2], gpt_dhcp[channel]->ipaddr[3]); printf("DHCP.maskaddr[4] %d.%d.%d.%d\n", gpt_dhcp[channel]->maskaddr[0], gpt_dhcp[channel]->maskaddr[1], gpt_dhcp[channel]->maskaddr[2], gpt_dhcp[channel]->maskaddr[3]); printf("DHCP.gwaddr[4] %d.%d.%d.%d\n", gpt_dhcp[channel]->gwaddr[0], gpt_dhcp[channel]->gwaddr[1], gpt_dhcp[channel]->gwaddr[2], gpt_dhcp[channel]->gwaddr[3]); printf("DHCP.dnsaddr[4] %d.%d.%d.%d\n", gpt_dhcp[channel]->dnsaddr[0], gpt_dhcp[channel]->dnsaddr[1], gpt_dhcp[channel]->dnsaddr[2], gpt_dhcp[channel]->dnsaddr[3]); printf("DHCP.dnsaddr2[4] %d.%d.%d.%d\n", gpt_dhcp[channel]->dnsaddr2[0], gpt_dhcp[channel]->dnsaddr2[1], gpt_dhcp[channel]->dnsaddr2[2], gpt_dhcp[channel]->dnsaddr2[3]); printf("DHCP.macaddr[6] %02X:%02X:%02X:%02X:%02X:%02X\n", gpt_dhcp[channel]->macaddr[0], gpt_dhcp[channel]->macaddr[1], gpt_dhcp[channel]->macaddr[2], gpt_dhcp[channel]->macaddr[3], gpt_dhcp[channel]->macaddr[4], gpt_dhcp[channel]->macaddr[5]); printf("DHCP.domain[%d] %s\n", strlen(gpt_dhcp[channel]->domain), gpt_dhcp[channel]->domain); printf("\n"); #endif /*#if defined(DEBUG_PRINT)*/ } break; case DHCP_EV_NAK: { /* Do Nothing. */ } break; case DHCP_EV_FATAL_ERROR: { /* Do Nothing. */ } break; case DHCP_EV_PLEASE_RESET: { /* Do Nothing. */ } break; default: { /* Do Nothing. */ } break; } return 0; }
File: BSP_M3S_T4.c
評価版パッケージのサンプルプロジェクトはe2Studio環境でビルド・デバッグ可能です。
e2Studioプロジェクトのビルド構成:HardwareDebug
RX72N_EnvisionKit ├ HardwareDebug ............... 出力フォルダ(e2Studio環境プロジェクト) ├ .cproject ................... e2Studio環境用プロジェクト ├ .project ................... e2Studio環境用プロジェクト
デバッグツールはオンボード RX E2 Lite を使用します。評価ボードのECN1 USB micro-Bコネクタをパソコンに接続してe2Studio環境からプログラムのダウンロード及びステップ・実行デバッグ操作が可能です。
評価ボードの SW1 DIPスイッチを以下のように設定します。
SEGGER's Friendly License (SFL), January 16th 2020 For non-commercial use or for evaluation purposes, you - regardless whether you are an individual person or a legal entity - are welcome to use the software free of charge under this license. Any other use of the software is considered commercial use, for which a commercial-use license must be obtained from SEGGER. DEFINITIONS "Non-commercial use" means using the software for teaching, learning, studying, or projects that do not have a commercial background. If the software is used for products or services intended to be sold, the use is considered to be commercial. "Evaluation" means you are trying out the software for possible future use. While the length of this time period is up to you, once it becomes a standard part of your workflow we no longer consider it evaluation. DISCLAIMER OF WARRANTY When using the software under this license, you accept that it is provided on an "as is" basis, without warranty of any kind. LIMITATION OF LIABILITY When using the software under this license, you accept that SEGGER is not liable for any damages arising out of the use of or inability to use the software. 3RD-PARTY SOFTWARE AND LICENSES More information about 3rd-party components, if any, included in the software and the licenses that these components are under can be found in the file doc/license/3rd-party.txt after installation of the software. RESTRICTIONS You may not: (a) decompile, disassemble, reverse engineer, or otherwise attempt to derive the source code of the software, (b) redistribute, encumber, sell, rent, lease, sublicense, or otherwise transfer rights in the software, (c) remove or alter any trademark, logo, copyright or other proprietary notices, legends, symbols or labels of the software. REVOCATION SEGGER reserves the right to revoke the right to use the software granted by this license on a case-by-case basis. In this unlikely event, SEGGER will provide the revocation notice in writing, allowing an adequate notice period. APPLICABLE LAW, VENUE German Law (with the exception of its rules for Conflicts of Law) applies. Sole venue is Monheim/Rhein. (c) 2020 - 2021 SEGGER Microcontroller GmbH www.segger.com info@segger.com