Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions ide/Renesas/e2studio/RX72N/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
wolfSSH simple sftp client application project for RX72N EnvisionKit board
======
## 1. Overview
-----

We provide a simple sftp client program for evaluating wolfSSH targeting the RX72N evaluation board, which has RX72 MCU on it. The sample program runs in a bare metal environment that does not use a real-time OS and uses e2 studio as an IDE. This document describes the procedure from build to execution of the sample program.

The sample provided is a single application that can evaluate the following functions:

- SFTP Client: A program that performs SFTP communication with the opposite SSH/SFTP server

Since the H/W settings and S/W settings for operating the evaluation board have already been prepared, the minimum settings are required to operate the sample application.

The following sections will walk you through the steps leading up to running the sample application.
## 2. Target H/W, components and libraries
-----

This sample program uses the following hardware and software libraries. If a new version of the software component is available at the time of use, please update it as appropriate.

|item|name & version|
|:--|:--|
|Board|RX72N EnvisionKit|
|Device|R5F572NNHxFB|
|IDE| Renesas e2Studio Version:2025-04.1 (25.4.1) |
|Emulator| E2 Emulator Lite |
|Toolchain|CCRX v3.06.00|

The project of this sample program has a configuration file that uses the following FIT components.
However, the FIT components themselves are not included in the distribution of this sample application. You need to download it by operating in the IDE. Some FIT components (TSIPs) cannot be downloaded directly from within the IDE and may need to be downloaded separately from the Renesas download site.


|FIT component|version|name|
|:--|:--|:--|
|Board Support Packages|7.53|r_bsp|
|CMT driver|5.71|r_cmt_rx|
|Ethernet Driver|1.21|r_ether_rx|
|Generic system timer for RX MCUs|1.01|r_sys_time_rx|
|Memory Driver Interface for Open Source FAT File System|2.61|r_tfat_driver_rx|
|Open Source FAT File System|4.14|r_tfat_rx|
|SD Mode SD Memory Card Driver|3.01|r_sdc_sdmem_rx|
|SD Mode SDHI Driver|2.12|r_sdhi_rx|
|TCP/IP protocol stack[M3S-T4-Tiny] - RX Ethernet Driver Interface|1.09|r_t4_driver_rx|
|TCP/IP protocol stack[M3S-T4-Tiny] for Renesas MCUs|2.10|r_t4_rx|
|TSIP(Trusted Secure IP) driver|1.22|r_tsip_rx|

## 3. Importing a simple sftp client application project into e2Studio
----

There is no need to create a new sample program. Since the project file is already prepared, please import the project from the IDE by following the steps below.

+ e2studio "File" menu> "Open project from file system ..."> "Directory (R) ..." Click the import source button and select the folder from which the project will be imported. Select the folder (Renesas/e2studio/{MCU}/{board-name-folder}/) where this README file exists.
+ Three projects that can be imported are listed, but check only the four projects "app_sftpclient", "wolfcrypt_test", "wolfssl_RX72N" and "wolfssh_RX72N" and click the "Finish" button.

## 4. FIT module download and smart configurator file generation
----

You will need to get the required FIT modules yourself. Follow the steps below to get them.

1. Open the test project in Project Explorer and double-click the **app_sftpclient.scfg** file to open the Smart Configurator Perspective.

2. Select the "Components" tab on the software component settings pane. Then click the "Add Component" button at the top right of the pane. The software component selection dialog will pop up. Click "Download the latest version of FIT driver and middleware" at the bottom of the dialog to get the modules. You can check the download destination folder by pressing "Basic settings...".

3. The latest version of the TSIP component may not be automatically obtained due to the delay in Renesas' support by the method in step 2 above. In that case, you can download it manually from the Renesas website. Unzip the downloaded component and store the files contained in the FIT Modules folder in the download destination folder of step 2.

4. Select the required FIT components shown from the list and press the "Finish" button. Repeat this operation until you have the required FIT components.

5. Select the Components tab on the Software Component Settings pane and select the r_t4_rx component. In the settings pane on the right, specify the IP address of this board as the value of the "# IP address for ch0, when DHCP disable." Property (e.g. 192.168.1.9).

6. Press the "Generate Code" button at the top right of the software component settings pane to have the smart configurator generate the source files. A src/smc_gen folder will be created under the smc project to store source files, libraries, etc.

## 5. SFTP Server and Port Settings for SFTP Client Test Application
----

The test project is a very simple sftp client application, which connects to echo server and gets `working directory` listing.
Before building the test application, set the SFTP server IP address and port number in the project properties.

- SFTP_SERVER_IP : IP address of the SFTP server
- SFTP_SERVER_PORT : Port number of the SFTP server (default: 22222)

Then build the test application.

## 6. Build and run the the application
-----

Now that the test application is ready to build.

1. Build the wolfssl and wolfssh projects on the project explorer, then the test project.

2. After a successful build, connect the target board to the emulator and supply external power.

3. Select "Run" menu> "Debug" to open the debug perspective.

4. The test application outputs the operating status to the standard output. Keep the "Renesas Debug Virtual Console" open for viewing this standard output.

5. Press the run button to run the test application.


## 8. Running sftp client application to echo server
You can see the following log output on the Renesas Debug Virtual Console when the sftp client application runs successfully and connects to the echo server.

`Server output example`
```
./examples/echoserver/echoserver
Keying Complete:
WOLFSSH_TEXT_KEX_ALGO : ECDH
WOLFSSH_TEXT_KEX_CURVE : nistp256
WOLFSSH_TEXT_KEX_HASH : SHA-256
WOLFSSH_TEXT_CRYPTO_IN_CIPHER : AES-256 GCM
WOLFSSH_TEXT_CRYPTO_IN_MAC : AES256 GCM (in ETM mode)
WOLFSSH_TEXT_CRYPTO_OUT_CIPHER : AES-256 GCM
WOLFSSH_TEXT_CRYPTO_OUT_MAC : AES256 GCM (in ETM mode)
```

`Client output example`
```
config.status
.gitignore
sshd_config
apps
...
zephyr
libtool
Makefile.am
Makefile.in
src
aclocal.m4
sftp client completes 0
```

# 9. Support

For support inquiries and questions, please email [email protected]. Feel free to reach out to [email protected] as well.
65 changes: 65 additions & 0 deletions ide/Renesas/e2studio/RX72N/common/wolf_dummy.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* wolfssl_dummy.c
*
* Copyright (C) 2006-2025 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

#include <wolfssl/wolfcrypt/wc_port.h>

static int tick = 0;

#define YEAR ( \
((__DATE__)[7] - '0') * 1000 + \
((__DATE__)[8] - '0') * 100 + \
((__DATE__)[9] - '0') * 10 + \
((__DATE__)[10] - '0') * 1 \
)

#define MONTH ( \
__DATE__[2] == 'n' ? (__DATE__[1] == 'a' ? 1 : 6) \
: __DATE__[2] == 'b' ? 2 \
: __DATE__[2] == 'r' ? (__DATE__[0] == 'M' ? 3 : 4) \
: __DATE__[2] == 'y' ? 5 \
: __DATE__[2] == 'l' ? 7 \
: __DATE__[2] == 'g' ? 8 \
: __DATE__[2] == 'p' ? 9 \
: __DATE__[2] == 't' ? 10 \
: __DATE__[2] == 'v' ? 11 \
: 12 \
)

time_t time(time_t *t)
{
(void)t;
return ((YEAR-1970)*365+30*MONTH)*24*60*60 + tick++;
}

#include <ctype.h>
int strncasecmp(const char *s1, const char * s2, unsigned int sz)
{
for( ; sz>0; sz--, s1++, s2++) {
if(toupper((*s1)) != toupper((*s2)))
return 1;
}
return 0;
}
/* dummy return true when char is alphanumeric character */
int isascii(const char *s)
{
return isalnum(s);
}
3 changes: 3 additions & 0 deletions ide/Renesas/e2studio/RX72N/sftp_client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/HardwareDebug/
/src/smc_gen/
/trash/
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.renesas.cdt.launch.dsf.gdbremote.launchConfigurationType">
<booleanAttribute key=".setStepMode" value="false"/>
<stringAttribute key="com.renesas.cdt.core.additionalServerArgs" value=""/>
<intAttribute key="com.renesas.cdt.core.connectionTimeout" value="30"/>
<stringAttribute key="com.renesas.cdt.core.initCommands" value=""/>
<stringAttribute key="com.renesas.cdt.core.ipAddress" value="localhost"/>
<stringAttribute key="com.renesas.cdt.core.jtagDeviceId" value="com.renesas.hardwaredebug.rx.e2"/>
<listAttribute key="com.renesas.cdt.core.listGDBExe">
<listEntry value="rx-elf-gdb -rx-force-isa=v3 -rx-force-double-fpu"/>
</listAttribute>
<listAttribute key="com.renesas.cdt.core.listGDBLaunchName">
<listEntry value="main"/>
</listAttribute>
<listAttribute key="com.renesas.cdt.core.listGDBPort">
<listEntry value="61234"/>
</listAttribute>
<booleanAttribute key="com.renesas.cdt.core.loadImage" value="true"/>
<stringAttribute key="com.renesas.cdt.core.optionInitCommands" value="monitor set_internal_mem_overwrite 0-645&#10;monitor force_rtos_off&#10;&#10;"/>
<intAttribute key="com.renesas.cdt.core.portNumber" value="61234"/>
<stringAttribute key="com.renesas.cdt.core.runCommands" value=""/>
<stringAttribute key="com.renesas.cdt.core.secondGDBExe" value="green_dsp-elf-gdb"/>
<booleanAttribute key="com.renesas.cdt.core.secondGDBSupport" value="false"/>
<intAttribute key="com.renesas.cdt.core.secondGdbPortNumber" value="61237"/>
<stringAttribute key="com.renesas.cdt.core.serverParam" value="-g E2LITE -t R5F572NN -uConnectionTimeout= 30 -uClockSrcHoco= 0 -uInputClock= &quot;16&quot; -uPTimerClock= &quot;240000000&quot; -uAllowClockSourceInternal= 1 -uUseFine= 1 -uFineBaudRate= &quot;1.50&quot; -w 0 -z &quot;0&quot; -uRegisterSetting= &quot;0&quot; -uModePin= &quot;0&quot; -uChangeStartupBank= 0 -uStartupBank= &quot;0&quot; -uDebugMode= &quot;0&quot; -uExecuteProgram= 0 -uIdCode= &quot;FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF&quot; -uresetOnReload= 1 -n 0 -uWorkRamAddress= &quot;1000&quot; -uverifyOnWritingMemory= 0 -uProgReWriteIRom= 0 -uProgReWriteDFlash= 0 -uhookWorkRamAddr= &quot;0x7fb40&quot; -uhookWorkRamSize= &quot;0x4c0&quot; -uOSRestriction= 0"/>
<booleanAttribute key="com.renesas.cdt.core.setResume" value="true"/>
<booleanAttribute key="com.renesas.cdt.core.setStopAt" value="true"/>
<booleanAttribute key="com.renesas.cdt.core.startServer" value="true"/>
<stringAttribute key="com.renesas.cdt.core.stopAt" value="main"/>
<stringAttribute key="com.renesas.cdt.core.targetDevice" value="R5F572NN"/>
<booleanAttribute key="com.renesas.cdt.core.useRemoteTarget" value="true"/>
<stringAttribute key="com.renesas.cdt.debug.ioview.dsf.registerSelection0" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;selectedRegisterList ioFilePath=&quot;C:\Users\darkb\.eclipse\com.renesas.platform_1435879475\DebugComp\RX\IoFiles\RX72N.sfrx&quot;/&gt;&#13;&#10;"/>
<stringAttribute key="com.renesas.cdt.launch.dsf.IO_MAP" value="${support_area_loc}"/>
<booleanAttribute key="com.renesas.cdt.launch.dsf.USE_DEFAULT_IO_MAP" value="true"/>
<listAttribute key="com.renesas.cdt.launch.dsf.downloadImages">
<listEntry value="|true|true|true|0|true|No core|INTERNAL_MEMORY||false"/>
</listAttribute>
<booleanAttribute key="com.renesas.cdt.launch.dsf.downloadImagesUpgradedV30" value="true"/>
<listAttribute key="com.renesas.cdt.launch.dsf.externalFlashDestinationAddresses"/>
<listAttribute key="com.renesas.cdt.launch.dsf.externalFlashDownloadModules"/>
<stringAttribute key="com.renesas.cdt.launch.dsf.launchSeqType" value="com.renesas.cdt.launch.dsf.launchSequence.e2GdbServer"/>
<stringAttribute key="com.renesas.cdt.launch.dsf.serverPath" value="${renesas.support.targetLoc:rx-debug}\e2-server-gdb"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2.E2LiteDebugToolSettingsTree.resetAfterReload" value="true"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.allow.change.startup_bank" value="false"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.allow.clock.source.internal" value="true"/>
<intAttribute key="com.renesas.hardwaredebug.rx.e2lite.clock_source" value="0"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.connection.mode" value="0"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.e2lite_pwr" value="false"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.enable.hot.plug" value="false"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.enable_external_flash" value="false"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.execute.program" value="false"/>
<listAttribute key="com.renesas.hardwaredebug.rx.e2lite.ext_flash_definitions"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.external_memory" value=""/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.fine.baud.rate" value="1.50"/>
<intAttribute key="com.renesas.hardwaredebug.rx.e2lite.flash.id_code.input_type" value="0"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.flash_overwrite_blocks" value="0-645"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.hook_Stop_func" value="0x0"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.hook_enable_Stop" value="false"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.hook_enable_start" value="false"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.hook_start_func" value="0x0"/>
<intAttribute key="com.renesas.hardwaredebug.rx.e2lite.hook_work_ram_Addr" value="523072"/>
<intAttribute key="com.renesas.hardwaredebug.rx.e2lite.hook_work_ram_Size" value="1216"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.id_code" value="FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.inputclock" value="16"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.jtag.clock.freq" value="6.00"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.jtag.or.fine" value="1"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.le" value="true"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.mode" value="0"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.mode_pin" value="0"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.prog_rewrite_dflash" value="false"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.prog_rewrite_irom" value="false"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.rtosIntegrationInDebugView" value="false"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.rtosintegrationthreadsrunning" value="false"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.serial_number" value=""/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.startup_bank" value="0"/>
<stringAttribute key="com.renesas.hardwaredebug.rx.e2lite.supply.voltage" value="3.3"/>
<intAttribute key="com.renesas.hardwaredebug.rx.e2lite.timer_clock" value="240000000"/>
<booleanAttribute key="com.renesas.hardwaredebug.rx.e2lite.verify.on.writing.to.memory" value="false"/>
<intAttribute key="com.renesas.hardwaredebug.rx.e2lite.work_ram_start" value="4096"/>
<booleanAttribute key="com.renesas.hardwaredebug.timemeasurement" value="true"/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="0"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value="C:\workspace\wolfssh\ide\Renesas\e2studio\RX72N\sftp_client\app_sftpclient\HardwareDebug\app_sftpclient.x"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value="0"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value=""/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value="C:\workspace\wolfssh\ide\Renesas\e2studio\RX72N\sftp_client\app_sftpclient\HardwareDebug\app_sftpclient.x"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value="0"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="rx-elf-gdb -rx-force-isa=v3 -rx-force-double-fpu"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="true"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="HardwareDebug/app_sftpclient.x"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="app_sftpclient"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.configuration.694844217"/>
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/app_sftpclient"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>
Loading